Skip to content

Instantly share code, notes, and snippets.

@jacobthemyth

jacobthemyth/index.html

Last active Aug 29, 2015
Embed
What would you like to do?
<!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
You can’t perform that action at this time.