×

Create GitHub Gist With Ruby

gists

Published: May 30, 2011

If you didn't know already, GitHub is freaking awesome. One of my favorite features is gists. Gists are a simple code pasting and sharing service. Also perfect for displaying code in blog posts.

I've grown tired of dealing with libraries to make my code examples look good. Some don't work that well, changes aren't revisioned, and they all around kind of suck to mess with. So in an effort to fix all that, I have decided to start using gists for my code examples.

I'm in the process of converting my site over to running Locomotive CMS instead of WordPress, so I needed to create a way to add gists through the admin interface and simply return the embed code.

It's pretty simple and works like a champ for me. Obviously I had to write a lot more stuff to integrate with Locomotive CMS, but that is for another post.

If you have questions or a better example, let me know in the comments.