I'm publishing a tutorial that includes a lot of code interspersed with documentation. I'm considering two ways of hosting the code:
Are there advantages of hosting in a gist v/s a repository? When would one prefer one of these over the other?
Gist is a simple way to share snippets and pastes with others. Whereas Repo is simply a place where the history of your work is stored.
There is no good answer, it's personal preference. I make mine a conceptual distinction. If it's code designed to demonstrate a technique, teach a principle, or show off a solution it goes in a gist. Doesn't matter if it's one file or 30 files. If it's actual code intended to be run, used as is, or forked as boilerplate I put it in a proper repository.