Share source code using Gist

Gist is a modern pastebin service operated by GitHub. Unlike a simple pastebin site, a gist behind the scenes is using the Distributed Version Control System (DVCS) Git. “All gists are Git repositories, so they are automatically versioned, forkable and usable from Git.”

When including source code on a site there are scripts that allow one to include the code from the gist site. Anyone interested in the source has a cleaner interface to view, copy, download, or fork.

An example is on one of my blog posts. To show the source on the page took only one line:

[gist id=”6680049″ file=”Gather.groovy”]

This depends on the gist support you have on your blog system. WordPress, for example, supports gist embedding by use of ‘shortcodes‘.

Yes, this is old news, but I had this post in draft mode, so I may as well post it.
 

References

Similar Posts:

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

Leave a Reply

Your email address will not be published. Required fields are marked *