Ok so previously I used SyntaxHighlighter to do this but have noticed that has stopped working on some of my blog posts.
So I had a look for another solution and came across Gist from GitHub. You can save snippets of code on there site as a public file and then embed them into your blog and they look great.
Try it out. https://gist.github.com/