Skip to content

Instantly share code, notes, and snippets.

@remi
Created June 1, 2012 15:38
Show Gist options
  • Save remi/2853033 to your computer and use it in GitHub Desktop.
Save remi/2853033 to your computer and use it in GitHub Desktop.
Sort GitHub user repositories based on watchers count
// Use this bookmarklet on a user page, eg. https://github.com/remiprev
$(".repo_list").children().map(function() { return $(this); }).sort(function(a,b) { a = parseInt(a.find(".watchers").text()); b = parseInt(b.find(".watchers").text()); if (a <= b) { return 1; } else { return -1 } }).each(function(i, repo) { $(".repo_list").append(repo) });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment