Skip to content

Instantly share code, notes, and snippets.

View pengwynn's full-sized avatar

Wynn Netherland pengwynn

View GitHub Profile
@pengwynn
pengwynn / dabblet.css
Created June 16, 2013 17:37
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@pengwynn
pengwynn / forks.sh
Created June 12, 2013 16:52
Paginate repo forks
curl -I https://api.github.com/repos/phpbb/phpbb3/forks
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 12 Jun 2013 16:50:45 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
@pengwynn
pengwynn / get_gemfile.sh
Created May 16, 2013 17:42
Getting the contents of a file with the GitHub API
curl -H "Accept: application/vnd.github.raw" https://api.github.com/repos/jamiew/omniauth-rails-app/contents/Gemfile
source 'http://rubygems.org'
gem 'rails', '~> 3.2'
gem 'sqlite3', :group => 'development'
gem 'pg', :group => 'production'
group :assets do
gem 'sass-rails', '~> 3.2'
require "net/https"
require "uri"
require "JSON"
uri = URI.parse("https://api.github.com/users/redbush")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
@pengwynn
pengwynn / first_request.sh
Created May 12, 2013 02:34
Conditional requests example
HTTP/1.1 200 OK
Server: GitHub.com
Date: Sun, 12 May 2013 02:32:58 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 53
Vary: Accept
Cache-Control: public, max-age=60, s-maxage=60
@pengwynn
pengwynn / curl-ua.shell
Created May 3, 2013 01:15
Pass a User-Agent header with curl
curl -v --user-agent "dartvoid/0.1 (https://github.com/dartvoid\) terminal/0.0" https://api.github.com/users/dartvoid
* About to connect() to api.github.com port 443 (#0)
* Trying 207.97.227.243...
* connected
* Connected to api.github.com (207.97.227.243) port 443 (#0)
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@pengwynn
pengwynn / .gitignore
Created March 20, 2013 17:50
.gitignore all the things
# a mashup of unique lines from https://github.com/github/gitignore with blank lines and comments removed
#
!/config/config.php
!Build/
!TAGS/
!cache/modules/Emails
!cache/modules/emails
!default.mode1v3
!default.mode2v3
!default.pbxuser
@pengwynn
pengwynn / joke.sh
Created March 18, 2013 23:41
Intro to CLI for 2nd grader.
#!/bin/sh
say "Why did the little cookie cry?"
sleep 2
say "Because his momma was"
say -v Hysterical "a wafer so long."
~ ⚡ 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