The Opera web browser's Fit to Width feature eliminates horizontal scrolling on pages like this. However, if you don't or rarely use Opera, then here are some partial solutions. Mozilla browsers have a userContent.css option:
pre { white-space: -moz-pre-wrap !important; }
That will auto-format the aforementioned page, but it won't work on pages like this. The following bookmarklets, based on Ruderman's original and some variants attempt to fix this:
word-wrap for gecko browsers
WebKit browsers have a word-wrap:break-word built in, but not inside certain tags, and no -moz-pre-wrap equivalent:
word-wrap++ for webkit browsers
Change the width and/or prewidth variables to suit your screen size/resolution and possibly to get it to work with other sites. If the bookmarklets are mangled, you can copy the code/links directly from the source.
[robg adds: Keep in mind that the reason the pages get wide is that users have submitted code snippets without line breaks. Based on my testing (in Camino at least), the way these reformatters work is by inserting actual line breaks. If you then copy and paste the code as-is, it may or may not work. Remove the added line breaks if you have issues. I try to always format stories such that they don't require horizontal scrolling, but I have no control over comments.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20070613235507819