Add code examples

big thanks to @tyler-king for the original commit, that I just cleaned up a bit. Replaces #71