Skip to content

Instantly share code, notes, and snippets.

View zph's full-sized avatar

Zander Hill zph

View GitHub Profile
@zph
zph / gco
Created November 5, 2015 06:06
#!/usr/bin/env bash
# Requires git and fzf
# Usage gco -> type fuzzily <ENTER> -> VOILA, on branch
SELECTED_BRANCH="$(\git branch --list | tr -d '^[* ]*' | fzf)"
git checkout "${SELECTED_BRANCH}"
#!/usr/bin/env ruby
#
# Example usage:
# $ ruby ~/bin/keychain USER@gmail.com imap.gmail.com
# => S3KRETZ
#
# ARGV[0] = 'Account' in Keychain.app
# ARGV[1] = 'Name' in Keychain.app
# On first use for any password, it will prompt for 'Always Allow', 'Deny', 'Allow [Once]'.
# If you want to use it without human interaction, you need to select Always Allow
@zph
zph / zist
Created November 4, 2015 05:26
#!/usr/bin/env bash
source ~/.zsh.d/chruby.zsh
set -eo pipefail
readonly FILE=$1
readonly STARTING_DIR=$(pwd)
cd ~/src/zist && \
source .envrc && \
#!/usr/bin/env ruby
#########################################################
## Generated Code: do not submit patches.
## Submit patches against non-generated version of code.
#########################################################
#
# Colorize String class extension.
#
@zph
zph / sack.ml
Created October 22, 2015 00:08
open Core.Std
open Core_extended.Std
module Sack = struct
let shortcuts_file = ".sack_shortcuts"
module Samples = struct
let tuple_line =
("/Users/zph/src/ocaml/sack/pt.log", "59",
"sack/sack.go:7:var debug = Debug(\"sack\")")
source "https://rubygems.org"
gem 'faraday'
gem 'faraday_middleware'
gem 'hashie'
source "https://rubygems.org"
gem 'faraday'
gem 'faraday_middleware'
gem 'hashie'
require 'faraday'
require 'faraday_middleware'
require 'faraday_middleware/response/mashify'
require 'hashie'
require 'nokogiri'
CONN = Faraday.new(:url => 'https://api.tumblr.com/v2/blog/gif-database.tumblr.com/') do |faraday|
faraday.params['api_key'] = ENV['TUMBLR_TOKEN']
faraday.request :url_encoded # form-encode POST params
faraday.response :json
{
"images": [
{
"url": "https:\/\/media.tumblr.com\/tumblr_mbieocOC6A1rn95k2o1_500.gif",
"keywords": "jack-sparrow pirates-of-the-caribbean captain-jack-sparrow you're-welcome shrug shrugging"
},
{
"url": "https:\/\/media.tumblr.com\/tumblr_mc2ui62SVt1rn95k2o1_500.gif",
"keywords": "aristocats the-aristocats marie sigh sighing disappointed disappointment meh lethargic lethargy sad bored"
},
{
"images" : [
{
"url" : "https:\/\/media.giphy.com\/media\/p3ZV46zdstXxu\/giphy.gif",
"keywords" : "mindblown"
},
{
"url" : "https:\/\/media.giphy.com\/media\/cPxRDvlSj9QKA\/giphy.gif",
"keywords" : "shaq cat wiggle buttwiggle"
},