https://gist.github.com/3634373
UPDATE: Off's link looks a lot better than my gist, I'm gonna give it a try.