Skip to content

Instantly share code, notes, and snippets.

@itsananderson
Last active August 29, 2015 13:58
Show Gist options
  • Save itsananderson/9968400 to your computer and use it in GitHub Desktop.
Save itsananderson/9968400 to your computer and use it in GitHub Desktop.
Shows repo counts in GitHub repository list

Installation & Usage

  • Copy the text in bookmark.js
  • In your browser, create a new bookmark and paste the copied text into the "URL" field of the bookmark.
  • Navigate to a GitHub user/organization repository list and click on your newly created bookmark
  • Repository counts will appear under the various repository filters
  • UDATE 4/11/14: Now gives valid counts on front page
javascript:(function(){
/* detect frontpage list */
if ($('.more-repos-link').length != 0) {
$.get('/dashboard/ajax_your_repos', function(response) {
$('#repo_listing').html(response);
$('.more-repos').remove();
repoCount();
}, 'text');
} else {
repoCount();
}
function repoCount() {
$('.js-repo-filter-tab').each(function() {
var $this = $(this);
var repolist = $('.repolist, #repo_listing').find($this.attr('data-filter'));
$this.html($this.text() + '<p style="text-align: center; margin: 0">(' + repolist.length + ')</p>');
});
$('.repo_filterer').css("margin-top", 0);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment