Skip to content

Instantly share code, notes, and snippets.

@djonsson
Created September 6, 2013 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djonsson/6464687 to your computer and use it in GitHub Desktop.
Save djonsson/6464687 to your computer and use it in GitHub Desktop.
Get code from github repository
var repository = 'https://api.github.com/repos/fredr/silex-html5-boilerplate/contents/README?ref=master';
$.getJSON(repository, function(data) {
var code = data.content;
var codeArray = code.split("\n");
var output;
for (var i = 0; i < codeArray.length; i++) {
output += window.atob(codeArray[i]);
}
console.log(output);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment