I have a doubt related to licensing, which is something I clearly don't master.
Let's say I've posted code created by me on Stack Overflow, which gets automatically licensed in CC-BY-SA.
Users should then refer to the site and to the author as the source of the code (Jeff Atwood said also to the user's profile, but that's overkill, especially due to answers edited by multiple authors).
Now, let's say I'm building something on GitHub I want to release as MIT License, and including the code I created and posted on StackOverflow previously.
Can I do that? Provided that I link back to the original Stack Overflow answer from the GitHub file, can I relicense the code snippet under the new license?
Or can/should I license only that file under CC-BY-SA and the rest of the files under MIT License?
How is this (common, I suppose) contamination between GitHub and Stack Overflow supposed to be handled?