I used to host some code I'd written for university assignments publicly on my GitHub account (after the deadlines had passed, of course). Before long, I received an email from the dep't asking me to take it down due to fears of plagiarism (if students were given the same or similar assignments in the years subsequent).
I did so, but recently I've been thinking - my university uses Turnitin for plagiarism detection, which as I understand it means that my code is already in the Turnitin database as shown in the below excerpt from this FAQ:
Misconception 7: Every student paper submitted becomes part of the Turnitin database--forever.
Reality: Turnitin has many options--including the ability to offer students an "opt out" of the database and the option of having an institutional database of student papers. Student papers may be removed only by request of the instructor of the class.
I don't recall opting out of anything, so if my code is in the Turnitin database surely undetected plagiarism wouldn't be an issue? Of course, the morality of providing a desperate student with both the temptation and means to plagiarise is another issue entirely.