I must say right away I’ve found one WP shortcoming so far – you just can’t type a code snippet to show it properly as a snippet in your post.
So after a while I figured: wrap your code snippet both in code tag and pre tag. Code tag with square brackets, pre tag – as the ordinary HTML tag.
This is bytesize post – tutorial but it will save you the time you spend on looking all over the web on how to post just few code lines!
And – every time you edit your post, it will kill your snippet so you rather write a new post but don’t touch the one with your nifty snippet! Pffff…