initial copy/paste from the gist

I could have and should have copied over everything from the other gist
github's gist authentication servers were down at the time and gist
doesn't do commit messages so ¯\_(ツ)_/¯