Last active
August 29, 2015 14:24
-
-
Save JohnRoos/e6f5e63ae915216c05aa to your computer and use it in GitHub Desktop.
Show all gists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> | |
| <div id="placeholder"></div> | |
| <script> | |
| var username = 'johnbravo' | |
| $.getJSON('https://api.github.com/users/' + username + '/gists', function (data) { | |
| for (var i in data) { | |
| var oldDocumentWrite = document.write | |
| document.write = function (scr_content) { | |
| for (var i in data) { | |
| if ( $.trim( $("#" + data[i].id ).text() ).length == 0 ) { | |
| $("#" + data[i].id ).append(scr_content); | |
| return; | |
| } | |
| } | |
| } | |
| var scr = document.createElement('script'); | |
| scr.src = 'https://gist.github.com/JohnBravo/' + data[i].id + '.js'; | |
| $("#placeholder").append("<div><h2>" + data[i].description + "</h2></div>"); | |
| $("#placeholder").append(scr.outerHTML); | |
| $("#placeholder").append('<div id="' + data[i].id + '"></div>'); | |
| } | |
| document.write = oldDocumentWrite; | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment