Dynamically including Github code
SORRY: Github have changed their API and this no longer works.
I like writing code, and sharing it.
Often I want to post a snippet here or on another website, to illustrate a point or to share a cool trick. But pasted code is dead code - real living code changes, and short of going back and repasting, the code on the web quickly becomes out of date.
So this is a little snippet I whipped up to dynamically (by the wonders of cross-site ajax) load code from a github branch. This means, when you update the git branch and repush, the code will update.
Here it is, bootstrapped and ready, and completely up to date.
Code available at http://github.com/peterbraden/peterbraden.github.com/blob/1ca083ed7890f5bc0d8b5555548a853ca2e6d420/github-code.js
(Standard disclaimer applies - untested on IE, YMMV. Hack at will)