I really don't know what forum to post this in.

I want to post code snippets on my site. I'm sure you've all seem demos and tutorials where the author shows the code used. My questions is, do people copy and paste the code from the file into the markup or is there some way they are pulling the appropriate code into the page so said snippet is only maintained once?