Small code snippets for posting to stackoverflow