Ask HN: Would Snippet Repo Help You?
snippetrepo.com
snippetrepo.com
How would you ensure code validity in Snippet Repo?
edit: Also, how would you handle multiple submissions for the same snippet in the same language? I.e., two Java snippets that both safely retrieve an element from a map.
There is no official way to ensure code validity just as there isn't with StackOverflow. But we do have a voting system and invite only community so by having this, developers can upvote and downvote based on quality and this weeds out low quality snippets and invalid/bad code.