Code dump from various blog posts.