Recently, I discovered Gists, a code snippet publishing platform by GitHub. In fact, a Gist is essentially a one-file GitHub repository.

I published two Gists recently. The first is a C# code sample of an ASP.NET Web API service that uses AttributeRouting. I found some examples of each piece, but not in combination. It took some time to get it working, so I thought it was worth sharing.

The other is a build script for the Sublime Text editor, which renders an AsciiDoc document in HTML on a Windows system. It was inspired by this user’s gist for a Unix system.

If you are looking for a quick way to share a code snippet, Gists are a good choice. Likewise, if you are looking for something similar to Markdown that’s more fully featured, Asciidoc may be the thing for you. Not only can you generate HTML, but it can be used to produce LateX, PDF and DocBook documents amongst others.