Like Djinn, but different. Original: https://gist.github.com/Barrucadu/6402042