initial commit

extracted from https://gist.github.com/heycarsten/6638842