Thursday, July 15, 2010

Add Code Snippets with Github's Gist

I’ve been looking for a simple way to add formatted code snippets to my blog. I know that Wordpress has a few neat plugins that do the job, but because this is a Blogspot-based blog, I had to find an outside solution (or maybe there’s a way to it here, but I just don’t have the time and efforts to delve into that right now)

Well, I should say I found it. Plus, it’s not a miserable, banner-full service, but good old Github. Interestingly enought, the guys offer a nice way to make, share, fork, and embed code snippets in proper format, at the expense of adding a reference to a small js wherever the code should appear …. like that
<script src="”https://gist.github.com/765326.js?file=Test.cs”">
I think that the end result is good enough for sharing code snippets around.