I have setup a simple page to help format source code for pasting in posts here:
http://www.myregextester.com/code.php
Select the language of the source code from the select list and paste your source code into the textarea and click "Submit".
The formatted source code will appear above the select list, copy and paste that source code into a post.
For plain text just choose TEXT.
I have arranged the top of the select list in the order that I commonly provide source code examples here.
Comments/suggestions welcome.