Skip to content

Instantly share code, notes, and snippets.

View zph's full-sized avatar

Zander Hill zph

View GitHub Profile
@zph
zph / watch-exec
Last active August 29, 2015 14:02
#!/usr/bin/env bash
# AUTHOR: Zander : zander@xargs.io : @_ZPH
# LICENSE: MIT
# Credit for initial script: http://stackoverflow.com/a/18341108/1930671
set -o nounset
set -o pipefail
set -o errexit
# set -o xtrace
@zph
zph / post-receive
Created June 13, 2014 14:27
post-receive hook
#!/usr/bin/env bash
staging="blog.xargs.io.staging"
source $HOME/$staging/.envrc
GIT_WORK_TREE=$HOME/$staging/ git checkout -f
cd $HOME/$staging && \
bundle install && \
bundle exec rake gen_deploy
@zph
zph / -
Created June 11, 2014 00:11
autocmd BufRead,BufNewFile *.go set tabstop=4 shiftwidth=4 noexpandtab softtabstop=4
[ { "path": "../../../tmp/rubocop20140513-46031-1gesyur/pr_test.rb", "offenses": [ { "severity": "convention", "message": "Extra empty line detected at body beginning.", "cop_name": "EmptyLinesAroundBody", "corrected": null, "location": { "line": 2, "column": 1, "length": 1 } }, { "severity": "convention", "message": "Missing top-level class documentation comment.", "cop_name": "Documentation", "corrected": null, "location": { "line": 3, "column": 3, "length": 5 } }, { "severity": "convention", "message": "Extra empty line detected at body beginning.", "cop_name": "EmptyLinesAroundBody", "corrected": null, "location": { "line": 4, "column": 1, "length": 1 } }, { "severity": "convention", "message": "Space inside
@zph
zph / -
Created May 12, 2014 04:27
def has_staged_changes?
!system("git diff --quiet --cached 2>/dev/null")
end
require 'singleton' # => true
# module Kernel
# def d
# DiceBag.instance
# end
# end
module Dice
class String
---
github.com:
- protocol: https
user: zph
oauth_token:
#!/usr/bin/ruby
require 'open-uri'
require 'json'
base_link = `git remote -v | head -1`
AUTH_TOKEN = `cat ~/.config/hub | grep oauth | awk '{print $2}'`.chomp
def strip_url(link)
# TODO:
# - write function to transform jam update to jam upgrade
# Apps
# Port num + 100 reserved for puma control
export COMPANY_PREFIX='RP'
export RP_AG_CONTROL_PORT=9392
export RP_CONFUSION_CONTROL_PORT=9410
export RP_PORTAL_CONTROL_PORT=9411
export RP_RNR_UI_CONTROL_PORT=9413
export RP_SECRET_TOKEN='pumarules'
require 'minitest/autorun' # => true
require 'minitest/spec' # => false
require 'minitest/pride' # => true
require_relative 'dicebag' # ~> LoadError: cannot load such file -- /Users/zph/tmp/seeing_is_believing_temp_dir20140505-47830-1l8fiz5/dicebag
describe DiceDSL do
subject { DiceDSL }
describe '5d6' do
let(:str) { '5d6' }
it 'parses correctly' do