I noticed that marking, copying and pasting code snippets in StackOverflow is a bit cumbersome.
How about adding a "Copy to clipboard" button, like it is done for example in Microsoft's MSDN and some other developer sites?
In this example, after clicking "allow access" once, the entire source code has been transferred to the clipboard and can now simply be pasted by using Ctrl+V
into the source editor of your choice.