Initial commit; from https://gist.github.com/eikeon/4391196 .