.

Coffee Powered

code and content

Author Archives: Chris Heald

Chris is 25 year-old a web developer and entrepreneur. He is Chief Architect for Mashable. He’s been in the web development business for about 8 years, and dabbles in about as many languages as he can get his hands on. He began working in Ruby and Rails in late 2006.

Making HAML faster

Haml’s among my favorite of the Rails technology stack. Clean, self-correcting templates that mean less typing and more doing for me. I love it. Unfortunately, there have been a number of performance regressions introduced into Haml recently, and that sucks, because Rails spends a lot of time building views, and I’d really like those numbers [...]

JRuby Performance: Exceptions are not flow control

I started playing with JRuby tonight, and got my application up and running on it in under 10 minutes (kudos to the JRuby team!), but when I started measuring its performance, I was seriously unimpressed. This didn’t quite line up with what I’ve read of JRuby, so I decided to do a little digging.

Mongrations reloaded

Users of MongoMapper may be familiar with mongrations, a Rails plugin to provide you with ActiveRecord-style migration tools for MongoDB. You don’t need them for schema changes, obviously, since MongoDB is schemaless, and you can define any changes you need to in your model. However, there are times that deploying a changeset will require some [...]

Rails, Varnish, Cookie Sessions, and CSRF tokens

I’ve recently been trying to figure out how to get Rails to place nicely with Varnish. It doesn’t do that very well. In a nutshell: Varnish is easy to use, if your app isn’t setting session cookies until you actually need them. The presence of a session cookie usually means that content shouldn’t be cacheable. [...]

Mobile and secure – setting up OpenVPN with DD-WRT and Android

So, with all the hubbub about Firesheep lately, and the fact that I’m becoming more mobile in my computing, I figured that it was time for me to get a VPN set up. I didn’t want to pay for one, and hey, it turns out that I have all the tools I need to manage [...]

Hack night at Gangplank

So, I finally made it down to Gankplank. I’ve been meaning to get down here for a while, but I’ve just not made it happen. I took the weekend to get my development environment up to snuff on my laptop (so I can actually work anywhere now!) and decided to give it a shot. This [...]

Solving error n8156-6003 when trying to play Netflix Watch Instantly content.

This is mostly search engine bait, because I couldn’t find a solution on my own when searching, but managed to stumble across it anyhow. I recently did a Windows 7 x64 reinstall, and after doing so, Netflix wouldn’t play in any of my clients – Windows Media Center, Chrome, IE, you name it. After various [...]

Write-once read-only fixtures for Rails tests

In the project I’m currently working on, I’m heavily using factory_girl to generate test data, rather than using the old Rails fixtures standby. However, I still have a set of read-only fixtures (which are used for testing read-only models against a legacy database). I’m using these in my tests, but since they are read only [...]

Pain-free CSS3 with Sass and CSSPie

So, you have a great design for a site. Lots of rounded corners, soft shadows, and beautiful gradients. “This’ll be fun!”, you think. Enter IE. “Oh, crap”, you think. Modern web design in IE is a pain in the rear. Fortunately, we have modern tools that make it a not-pain. SASS (Syntactically Awesome Stylesheets) is [...]

Debugging memory leaks in Ruby with GDB, round 2.

In part 1, I described how I located leaky Sets in MongoMapper by diffing the Ruby ObjectSpace with GDB. Today, I’m going to show you how to solve the problems that those sorts of diffs can reveal. In today’s example, we’re tracking leaky sets. In particular, a set is holding onto class references. We are [...]