To be fair to OP, I think there's ways to structure throwaway projects in such a way that it contains flaws and they're useless to a real company but complex enough to gauge experience/familiarity, etc. I don't think GitHub would be optimal since then people could clone these throwaway projects and create brain dumps.
We actually pay contracted engineers (up $100/hr) to write these projects. They're usually recreations of interesting problems have had to implement or work on in their careers. Some are just forks of open source projects.
We don't turn around an use the code the candidate wrote. If you consider the cost to use to write the project AND the cost to have it reviewed N number of times, we'd be overpaying drastically for that feature to be implemented.