GitHub Gist


One common problem in programming is showing code examples to others. It’s unfortunate, but some days you spend more time trying to understand errors than writing new code. Those days you spend a lot of time searching forums or Stack Overflow. But many of these forums don’t support code formatting with nice syntax highlighting, and it is difficult for others to contribute fixes.

This is where paste websites such as Pastebin, Pastie and Codepad become useful, allowing you to paste and share code with others. GitHub has a similar system, called GitHub Gist.

Basic usages is simple. Just paste your code and select one of the billion or so languages from the Language list. Your code will show up formatted and you can share the URL with anybody and everybody. GitHubbers can add their own comments, or fork your gist into gists of their own.

Shiny text gists

Using Markdown in your gist will end up with it being rendered into HTML when viewed on the GitHub website. So if you have some important piece of text feel free to add some format to it.

Gist is just Git!

A gist is a Git repository. So it can be cloned, pulled and pushed just like any other Git repository. You can use this to “upgrade” your gist repository into a full GitHub repository.

More gist magic

There are a few third-party services that have started around gists: