?
https://gist.github.com/kazuho/4122754#file-gistfile1-txt-L34