Discourse isn’t really set up for this; it’d take significant customization and restructuring to make it feel natural and work well. We do have some long running threads about helpful/fun snippets here (like Fun One Liners) and others have thought about putting collections of snippets directly into a package (like Proposal for Tchotchke.jl – everything but the kitchen sink).
GitHub’s gist is indeed a pretty good place to find snippets — there are over 6000 Julia snippets there already: https://gist.github.com/search?o=desc&q=language%3Ajulia&s=stars.
Another new option is in JuliaHub: we’re augmenting published packages with publicly shared Pluto notebooks. Now notebooks serve yet a different purpose, but I think they may fill the gap that you’re after.