Skip to content

Instantly share code, notes, and snippets.

@marianogappa
Created May 22, 2016 08:02
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 marianogappa/2a3169a75859240a6c9ff9e0b237bf5a to your computer and use it in GitHub Desktop.
Save marianogappa/2a3169a75859240a6c9ff9e0b237bf5a to your computer and use it in GitHub Desktop.
Byte count per programming language on your github account
USER=my_github_username
ACCESS_TOKEN=my_github_access_token
curl -u $USER:$ACCESS_TOKEN -s "https://api.github.com/user/repos" | jq -r 'map(.languages_url) | .[]' | xargs curl -s -u $USER:$ACCESS_TOKEN | jq -r '. as $in| keys[] | [.+ " "]+[$in[.] | tostring] | add' | awk '{arr[$1]+=$2} END {for (i in arr) {print i,arr[i]}}' | awk '{print $2, $1}' | sort -nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment