.

Coffee Powered

code and content

Author Archives: Chris Heald

Chris is 25 year-old a web developer and entrepreneur. He is the CTO of blippr, LLC, a startup providing a discovery and recommendation platform for various media. 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.

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 [...]

MongoMapper, Development Mode, and Memory Leaks

If you’ve worked with MongoMapper for a while, you’ve probably noticed that in complex apps, there are horrific memory leaks in development that magically disappear in production mode. While this is all well and good, and it’s rather handy that things Just Work in production, don’t you wish you didn’t have to restart your app [...]

WillPaginate and custom paging.

will_paginate is the de facto Rails paging plugin, and with good reason – it’s solid, fast, and reliable. Everyone I know uses it, but a lot of people don’t use it to its full power. I recently discovered some very cool functionality it includes – the WillPaginate::Collection class can be used as a custom paginator [...]

Setting up replica sets with MongoDB 1.6

Introduction MongoDB 1.6 was released today, and it includes, among other things it includes support for the incredible sexy replica sets feature – basically master/slave replication on crack with automatic failover and the like. I’m setting it up, and figured I’d document the pieces as I walk through them. My test deploy is going to [...]

Click mapping with HTML5 and node.js

I was recently in need of a click mapping solution, and didn’t like most of the solutions I came across. They had huge dependency chains and were generally unwieldy, or they didn’t work that well, or they were external services that I had to pay for…until I ran across heatmapthing. Now we’re talking. Client-side rendering [...]

FlexAuth: Portable authentication for Battle.net

I’ve just released my first Android app, called FlexAuth. It’s mostly an excuse to learn Android development, but it does something useful, too – it serves as a souped-up mobile authenticator for Blizzard’s Battle.net login infrastructure. If you’d like the gory details, there’s a specification floating around on the internet that’ll help you understand the [...]

Serving files out of GridFS, part 2

Since my initial experiments with GridFS and nginx-gridfs, I discovered a rather downer of a dealbreaker: compiling Passenger and nginx-gridfs into the same nginx binary makes nginx very unhappy. It hard-freezes (as in, blocks forever) when you request a GridFS file with Passenger enabled. Oops. So, I sat down and fixed gridfs-fuse. You can grab [...]

Serving files out of GridFS

GridFS is a nifty little feature in MongoDB that allows you to store files of all shapes and sizes in Mongo itself, getting the benefits of Mongo’s sharding and replication. However, since they’re in a database, and not on the filesystem directly, how do we serve them? There are lots of benchmarks and numbers under [...]

counter_cache for MongoMapper

I’ve started playing with MongoMapper, and it’s quite excellent, but it does suffer very much from being young. There are lots of pieces missing that veterans of ActiveRecord will take for granted. I’ve been working around or patching them, for the most part, but I felt that my solution to `:counter_cache` deserved a post. In [...]