Skip to content

Instantly share code, notes, and snippets.

View pengwynn's full-sized avatar

Wynn Netherland pengwynn

View GitHub Profile
~ ⚡ curl https://api.github.com/repos/pengwynn/octokit/collaborators | jq -r '.[].login'
pengwynn
sferik
ctshryock
joeyw
~ ⚡ curl -n https://api.github.com/repos/pengwynn/octokit/collaborators | jq -r '.[].login'
pengwynn
sferik
ctshryock
joeyw
@pengwynn
pengwynn / gist:4435627
Created January 2, 2013 16:06
Get README in HTML from API
curl -H 'Accept: application/vnd.github.html' https://api.github.com/repos/pengwynn/octokit/readme
<div class="announce instapaper_body md" data-path="README.md" id="readme"><article class="markdown-body entry-content" itemprop="mainContentOfPage"><h1>
<a name="octokit---" class="anchor" href="#octokit---"><span class="mini-icon mini-icon-link"></span></a>Octokit <a href="http://travis-ci.org/pengwynn/octokit"><img src="https://secure.travis-ci.org/pengwynn/octokit.png?branch=master" alt="Build Status" style="max-width:100%;"></a> <a href="https://gemnasium.com/pengwynn/octokit"><img src="https://gemnasium.com/pengwynn/octokit.png?travis" alt="Dependency Status" style="max-width:100%;"></a> <a href="https://codeclimate.com/github/pengwynn/octokit"><img src="https://codeclimate.com/badge.png" alt="Code Climate" style="max-width:100%;"></a>
</h1>
<p>Simple Ruby wrapper for the GitHub v3 API.</p>
<h2>
<a name="installation" class="anchor" href="#installation"><span class="mini-icon mini-icon-link"></span></a>
@pengwynn
pengwynn / gist:4435605
Created January 2, 2013 16:04
List annotated tags
curl https://api.github.com/repos/clojure/clojure/git/refs/tags
[
{
"object": {
"type": "commit",
"url": "https://api.github.com/repos/clojure/clojure/git/commits/f85444e6f890eb585e598efefdbd84727427e0a4",
"sha": "f85444e6f890eb585e598efefdbd84727427e0a4"
},
"url": "https://api.github.com/repos/clojure/clojure/git/refs/tags/1.0",
"ref": "refs/tags/1.0"
octokit [ master: ✔ ] 5d ⚡ curl -n https://api.github.com/repos/pengwynn/octokit/git/refs/tags | jq -r '.[].object.sha'
0d7a03f2035ecd74e4d6eb9be58865c2a688ee55
841be65ccaaad2f01db2eeff7171a0bcde3e059e
b116920ce893e62c5b78dd25e34d11c0f2939fb7
469365fa47b660fed2ad94970d527b0390bfc711
5b129b15611342fa69b135e1bf2753bedcec7fbc
03ee3f302f99162d5c08f256dbdeef3c96fce25e
41d0ac1e34b8b62a69d6e3edb6981feecce3b2ef
3b02fc367fb7db1f9c8a24a7e8a89ad0459e319b
4c1b9fcbe1f812c49c26f973f4b059df63df8f6c
curl -I https://api.github.com/repos/rails/rails/commits
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 17 Dec 2012 17:28:16 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Status: 200 OK
Link: <https://api.github.com/repos/rails/rails/commits?last_sha=fa3457dc3b30e3dde5bc4b041f59c037c76e1f8b&top=master>; rel="next", <https://api.github.com/repos/rails/rails/commits?sha=master>; rel="first"
ETag: "518d4b8d1ae2efd452377a915e9679f7"
@pengwynn
pengwynn / jq.sh
Created November 20, 2012 15:59
The Real j-query™
# http://stedolan.github.com/jq/
$ brew install jq
$ curl https://api.github.com/repos/rails/rails/commits | jq '.[].sha'
"abb38feac84da59f6686d9abcce61d2a9a64efa9"
"61425f2c6d14fe7151b09ffe5a5353924582e5b0"
"03ef833b804fe17ff834ac957a300d45bbb24fab"
"ce60672342f8da447d24d25f8c0f2049fc81c0c8"
"e492c446d520e8941624564b157b297cfd0aeaa9"
"bba8fc4294ca7f7d90c3e64e7fea059b17caef5c"
machine api.github.com login <username> password <password>
@pengwynn
pengwynn / octocat_zen.sh
Created November 14, 2012 02:42
GitHub Zen
$ curl https://api.github.com/zen | octocatsay
MMM. .MMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMM ____________________________
MMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMM | Practicality beats purity. |
MMMMMMMMMMMMMMMMMMMMMMMM |_ ________________________|
MMMM::- -:::::::- -::MMMM |/
MM~:~ ~:::::~ ~:~MM
Does this work?
Who knows
@pengwynn
pengwynn / auth.sh
Created August 30, 2012 13:35
Create GitHub Authorization token with curl
curl -i -u username \
-d '{"scopes": ["repo", "user"], "note": "Your note here"}' \
https://api.github.com/authorizations