Tim Wasson - web nerd guy.


Optimizing Atomicast

I run a little internet podcast along with a buddy of mine, and found that as we collected more episodes, site load times slowed down. This was unacceptable.

Came in at just under 2.5 megs for 1 page load. This was clearly unacceptable, and the problem would only grow as time went on. 

The biggest offender was the images. iTunes requires a 1400X1400 JPEG for each episode, and I really wanted to display the episode artwork. But as we hit our 12th episode, each episode's artwork was slowing down the process. At around 100K each, that needed to change. 

I implemented this image resizing script to handle automatic resizing and server-side caching of the resized images. The result is pretty striking. 

Instead of 50-120K per image, we're looking at 17-50K per image. Spread over many episodes, the difference is substantial.

The main logo image had similar problems. iTunes required a large JPEG, so instead of using the iTunes image I created a custom PNG, resized it to 900X900 and sent it through tinyPNG, sending it from 130K down to 21K. 

Unfortunately I could not get rid of jQuery or jPlayer, which the site relies on for many interactive elements and playing of the episodes. I could also not get rid of Google Analytics. In theory I can get rid of Font Awesome, but in playing with icons and SVGs, I am not convinced I'd save any space in doing so. Especially since Font Awesome is stored via CDN, I think using that actually speeds things up a bit. 

The resulting changes took me from 2.5 megs total to 600K, or approximately 25% of its former, bloated self.

While making these changes, I also tweaked some CSS and JS for some cross-platform compatibility. All in all, a great performance boost! 

Next up, I'm going to introduce some lazy-loading to only load episode artwork when necessary, because for now it loads artwork even if you can't see it. Next revision, that's comin'! 

So how'd that happen?

Many years ago I was an artist. In high school, I dreamed of nothing more than being an illustrator. My ultimate goal was comic books, but greeting cards, flyers, etc.... I didn't care. I just wanted to draw. 

I got realistic though. I'm not a good enough illustrator to truly make a career out of it, and if I tried I'd end up hating illustration. Instead I keep up with my doodling habits, and I enjoy them as a creative outlet. But I still pursued creative arts as a career and a passion. I moved instead into design. 

I loved design. I was good at it. My creativity and illustrative ability worked well with my technical expertise. I could work on a computer and make pretty shit. And all was well with the world.

Somewhere along the way, I stopped designing. I found a certain comfort in dealing only with code. Others designed and passed that over to me, and I put it together and made it work. There was some freedom in that, really. Coding is still a creative endeavor, although it is a lot different than creativity with design. 

But lately, I've lost even the itch to design. I feel like this flat design stuff killed what it used to take to make websites beautiful. I understand "content first" design and, honestly, I think it's a better way to design a site. But with the emphasis all on the content and trying your damndest not to clutter that up with gradients or even colors. 

High contrast, easily readable fonts make sense for most monitors and most people reading. Fewer images and less "designy" work is better for responsive design. 

In theory, I get it. But in reality, this flat design movement makes all sites (including the one you're one) look identical. Toned-down pastel colors, flat buttons, large background images. They're just so... boring. Some are beautiful, but after seeing the same stuff recycled over and over, the beautiful ones start blending in with the "others". It's all the same. And it's boring. 

Code right now is exciting. There's a new front-end framework every other day. There's new tools to do better work faster. CLI is fast and effective and fun. 

I don't miss design. The former artist inside of me is screaming knowing that all I do now is manipulate code, but I think this is where I need to be right now. 

I give up.

I tried to embrace the Android lifestyle. I gave it my best shot, but I couldn't ever get used to it. For a rundown on why...

The camera. Man, it sucked. Even after Google's updates that "improved" it, the quality was never up to the quality of my iPhone 5. Even worse was response time. I couldn't open the camera and take a photo quickly. I missed many great shots with my kid trying to get the camera open and focused. Even on the rare occassion it focused quickly, it snapped the shot slowly. Pics were blurry, out of focus, and generally bad. Constantly. The camera was fine for still objects, but 90% of what I take pics of is my hyper toddler. Still doesn't describe her. 

The app selection sucked. I mean, there's lot of apps but they are all lacking when compared to the iPhone version. No app worked as good on Android as it did on iPhone. 

Customizability. Android wins here. It is infinitely more customizable than the iPhone, but I think what I've found is that I don't want customizable. I want easy. And I want it to work. With Android, I loaded up some notifier app, then customized it with a bunch of buttons, then found it wasn't sufficient. So, uninstall, try another. That sucked. Ok, Google around to find a good one. Hey, okay, so now it worked and it took 90 minutes of screwing around to find it and get it working... and even when it was working, it didn't work as well as iPhone. Customizability is this weird double-edged sword. The tinkerer in me likes to spend hours customizing it. But the busy adult in me just wants the thing to work in a smooth, consistent way. 

Consistency. Android was terrible here. The back button is the worst offender, working sometimes and other times doing nothing. Sometimes it wouldn't just go back 1 screen, but instead swap to a totally different app. Sometime it'd just refresh the screen. 

Ecosystem. This clearly shows my bias, but with my MacBook Pro, iMac, Mac mini, iPad, and AppleTV, I found a lone Android device to be a tough pill to swallow. All my media, apps, music and movies, couldn't be moved easily to my Android. I couldn't AirPlay to my AppleTV without ridiculous workarounds. 

General useability. I understand many of these complaints are because of my years in the iPhone camp, but everything I tried to do on the Android was more cumbersome and annoying. It's difficult to put this into words exactly, but things didn't quite make sense to me in terms of how to change settings. Each app had it's own method, which was different from the way you managed Android itself. It was never just "brainless" to adjust settings. It may be silly to complain about a device that makes me think, but here I am. I hate thinking about it. I just want the thing to work. Android worked, but required more work to work. I didn't like that. 

Anyway, I'm going back to the iPhone. I wish I could say I enjoyed my time with an Android or came away from this with something I wish the iPhone had, but unfortunately there's nothing about Android that I prefer over iPhone. 

Digital Ocean and Drupal, part II

My previous entry covered some of the pitfalls of setting up Drupal on Digital Ocean, but I found every 2-3 days my Drupal droplet would need mySQL restarted. It's not the end of the world, but it's very annoying. 

I found I wasn't the only one with the problem. 

As the problem page advised, simply creating a swap file seems to have fixed the issue. Of course, with intermittent issues like these, you never really know if the problem is resolved. I'll cross my fingers but for now, it seems like we're good to go. 

Pragmatic Optimism

So, our family is going through a bit of a rough time at the moment, and in my own little way the issues we're tackling are making me ask bigger questions about life in general. 

I've always been sort of a cynical guy. I used to really assume the worst, and ask a ton of questions. These days, it's the opposite. I always assume things will work out okay for me because... well... they always have in the past. No matter how naively optimistic I can, I can't pretend that this will always be the case. 

In the face of our current issue, I've remained intensely optimistic, but to my own credit I think I've also been pretty pragmatic about what needs to be done. Sometimes the only thing you have control over is your attitude, and right now is one of those times. A positive attitude and optimistic outlook goes a long, long way in keeping yourself and everyone around you sane. When all else fails, keep that chin up and press on. Sometimes that's all you can do. 

I have little to say.

But, in an effort to continue the new year's resolution of blogging, I'm going to try to blog even when there's nothing blogworthy to blog about. 

We've had some bad news and stressful times in my family lately. We've been incredibly fortunate that our family hasn't really had a lot of trauma or emergencies to deal with, but that means that when these things come up we're relatively unsure how to handle it. I guess we're handling things admirably, but that doesn't mean there's not a general cloud of stress and sadness throughout the family. 

The good news is that I've actually been productive at work, getting some things taken care of and making some progress on integrating myself into a new job. I've never wanted a job to work out more than I want this one to work out, so I'm working on weekends and evenings to catch up and work ahead a little, and try to ease out the learning curve that comes when you take a new job. 

The Home Office

Illinois was getting a bit too cold for me, so I jetted off to sunny California to visit my employer for the first time. It only took a few hours for me to go from "I don't know if I can do this job..." to "Yeah, I can totally do this job". In the few weeks since I was hired and given little direction or assistance on how to actually get work done, my brain went to weird places on what the job entailed and how there was no way I was competetant to actually do the work. 

Thankfully, those fears were put to rest upon my arrival. The job is well within my skill level, and as long as I can navigate some subtleties with servers and Git, I should be good to go. 

Afterall, it's just Drupal, a system I've worked with for many clients over many years. At this point, I should be more than capable of managing my way around Drupal, quickly and easily. In retrospect, it was silly for me to get worked up about maybe not being able to do it. 

In other, non-work news, Daisy is awesome and getting more awesome every day. She's such a funny, strange little kid. I'm not sure if that's nature or nuture, or a combination of both. Either way, fatherhood is just really satisfying, and I am really enjoying seeing Daisy get older and learn at every step along the way. 

New Year's Resolutions.

I do this about every year, and this year is no different. 

Lose Weight. No shit, everyone has this goal. This year isn't spectacularly different from any of the other years I've tried and failed to lose weight, but I figure the battle has to be keeping my waistline in check a little bit, right? 

Blog more. This blog is severely neglected, and blogging about my everyday goings-on is a good way to keep my memory as good as possible... which is still bad, by the way. But every little bit helps.

Learn something. In my field, if you're not learning, you're failing. I'm making strides with node.js and want to pick up some Ruby on Rails skills this year as well. Gotta keep up.

Podcast. I've started and failed at more podcasts than I care to admit, but 2014 is my year. I'll start a podcast and do... let's say, 20 episodes of one this year. Nothing helps with resolutions more than arbitrary number assignments. 

Side Projects. I suppose blogging and podcasting could count here, but to be more specific about it, I want to get into a side project that is fun and that I learn from. I have no idea what that'll be as of now.

Other than that, life is pretty great. I have a great job, great family, and not a lot that needs improvement. 

Switching from iPhone to Android

I've been an iPhone guy since the very first iPhone. I fell in love with the interface, the usability, the functionality. I was an iPhone lover before the App Store, before the SDK. I paid $600 for that phone, plus ETF fees from Verizon to switch over to AT&T, the only carrier at the time who had the iPhone. I've owned every version of the iPhone. But then something happened.

The 5s underwhelmed me. While every other version of the phone offered something good and useable, the 5s did nothing for me. It was the first upgrade that didn't impress me enough to make the leap into the new phone. 

iOS 7 sucks. It's hideously ugly and buggy. Many things changed just just for the sake of changing, and didn't introduce any real improvements. The UI sucks. It's a perfect example of flat design not working. The icons look like a child created them. I thought I'd get used to it, but after several months of using it, I still hated it. I moved on to the Nexus 5.

First things first, the screen is beautiful. The phone is a good size. Sometimes I love the extra real estate it offers over my iPhone 5, but sometimes I wish it was a hair smaller so I could operate it with one hand. I guess the "perfect size" is a very difficult compromise to find. 

I like KitKat. It's mostly intuitive, and the things it handles differently from the iPhone are relatively easy changes to make sense of. I like how literally EVERYTHING on Android is customizable, from the lock screens to notification bar. Unfortunately, sometimes too many choices also make things complicated. One of the things I loved from iOS 7 (maybe the only thing) was the Control Center, with shortcuts to the camera and flashlight and calculator. To recreate this, I investigated some apps to add those icons to the notification bar. There was an overwhelming amount of choices there, and it took me quite a while to find a good solution. 

In the end, I believe the solution I used it better than Apple's, but that's not the point. In my youth, I enjoyed tinkering with technology, trying things out and spending my time tweaking. As I get older, I don't enjoy that process nearly as much. I find myself just wanting it to work, and not caring if it's not 100% to my liking as long as it's "close enough". 

Don't even get me started on the transition from iMessage to Hangouts. I guess that's a post for another day. 

The camera also sucks, even on 4.4.2. 

I'm going to give this Android an honest shot and see if I come out the other side as a Google/Android fan boy. I haven't made any decisions on that point just yet.