nk23x
11/2/2015 - 7:25 PM

github related bash snipplets

github related bash snipplets

## get token with the scope "delete_repo"
curl -v -u [USER] -X POST https://api.github.com/authorizations -d '{"scopes":["delete_repo"], "note":"token w. delete repo scope"}'

## delete repos using the "delete_repo" token
curl -v -X DELETE -H 'Authorization: token [DELTE_OK_TOKEN]' https://api.github.com/repos/[USER]/[REPO]
## returns "HTTP/1.1 204 No Content" when done
## list gist urls
wget -q -O - https://api.github.com/users/nk23x/gists | grep raw_url|perl -pe 's/^.*https(.*)\",/https$1/g;'