Useful code snippets.