Well, as I’m posting my tips here, I came across the problem with pasting programming code. Now I’m looking for a good online utility that would take code and HTML-escape it. It would be even better if it also did color-coding.
If I find something good, I’ll post a link here. For now, I’ll just be using a utility to escape all > and < entities. This is the first one I found in Google.