Skip to content

Instantly share code, notes, and snippets.

@systemist
Last active August 29, 2015 14:14
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 systemist/baf5c7e49238c066b38c to your computer and use it in GitHub Desktop.
Save systemist/baf5c7e49238c066b38c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="bower_components/octicons/octicons/octicons.css">
</head>
<body>
<ul class="repositories">
</ul>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/underscore/underscore.js"></script>
<script type="text/template" data-template-name="repo">
<li>
<a href="<%= html_url %>"><%= name %></a>
<%= pushed_at %>
<%= language %>
<%= stargazers_count %>
<%= forks_count %>
<%= stargazers_url %>
<%= forks_url %>
</li>
</script>
<script src="main.js"></script>
</body>
</html>
(function(){
var baseUrl = "https://api.github.com/users/jacobthemyth/";
$(document).ready(function(){
if(typeof githubToken !== 'undefined'){
$.ajaxSetup({
headers: { 'Authorization': 'token ' + githubToken }
});
}
var repoTemplate = _.template($('[data-template-name=repo]').text())
var $repositoriesUl = $('.repositories');
$.ajax(baseUrl + "repos").done(function(repos){
_.each(repos, function(repo) {
$repositoriesUl.append(repoTemplate(repo));
});
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment