I wrote this for my first book, while at @blendtweets. I keep meaning to expand it.