Skip to content

Instantly share code, notes, and snippets.

@busterc
Forked from JoelBesada/README.md
Last active January 12, 2018 15:34
Show Gist options
  • Save busterc/8189676 to your computer and use it in GitHub Desktop.
Save busterc/8189676 to your computer and use it in GitHub Desktop.
This is a Backtick (http://backtick.io) command to sort the list of GitHub repos, by number of stargazers, descending. #js #backtick

This is a Backtick command to sort the list of GitHub repos, by number of stargazers, descending.

$('.repolist').html($('.repolist>li').sort(function(a,b){return parseInt($(b).find('a').text().replace(',',''))-parseInt($(a).find('a').text().replace(',',''))}));
{
"name": "GitHub Sort Repos by Stars",
"description": "Sort GitHub repo list by descending number of stargazers.",
"icon": "https://backtickio.s3.amazonaws.com/icons/backtick.png"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment