I have to admit - I love Posterous, but for some reason I couldn't get code-snippets to post using the "[code]" tag or their markdown syntax. I went through a little tutorial/page on how to do it the old way (which I actually discovered something interesting I'll blog about later) and the new way they recently announced to mark code.
None of them worked! I will assume that it was my fault and it has something to do with the custom CSS I used to edit this theme.
Either way, the solution is simply use Gist.
Just head over to Gist.
Name your Title
Name your File
Choose a Language
Start typing your code, and at the end just copy the url at the top of the address bar (will look something like )
And paste the link directly into your blog (if it's a posterous, if not then copy the embed code).
Here's how I found out how to post Gist to Posterous.