After copy and pasting this snippet around a few times now, I figured I should make this a quick post.
Adding syntax highlighting.