Now, something to recognize is that not all code can be licensed. There's something called the threshold of originality. In the United States, you can only copyright something that has a "minimal degree of creativity". A lot of code samples or code snippets or MVCEsMVCEs won't meet this threshold of originality. However, larger pieces of code will. So now, you have a large piece of code that took creativity to write posted on a Stack Exchange site (as part of a question or an answer). What now?
replaced http://opensource.stackexchange.com/ with https://opensource.stackexchange.com/