Skip to content

Instantly share code, notes, and snippets.

View nocash's full-sized avatar

Beau Dacious nocash

View GitHub Profile
@nocash
nocash / .gitconfig
Last active March 31, 2017 20:00
Easily create branch names from pasted story titles.
[alias]
br- = "!f() { git branch $(dasherize \"$@\"); }; f"
cob- = "!f() { git checkout -b $(dasherize \"$@\"); }; f"
#!/bin/bash
set -e
current=`git symbolic-ref --quiet --short HEAD`
exclude="^(master|develop)"
git fetch origin
git checkout master
git reset --hard origin/master
git branch --merged origin/master \
@nocash
nocash / README.md
Created February 26, 2016 17:08
Adjusting Open File Limits in Yosemite
@nocash
nocash / 01.rb
Last active February 18, 2016 20:55
class Basket
def initialize
# use private setter to initialize variable
set_contents(:empty)
end
def fill_basket
set_contents(:fruit)
end
@nocash
nocash / .zshrc
Last active April 11, 2016 19:45
alias mqc='git commit --no-edit; $(upsearch .mergeq)/script/mergeq --continue'
alias mqe='mergeq edge'
alias mqm='mergeq master'
alias mqp='mergeq production'
alias mqr='rm $(upsearch .mergeq)/.mergeq/merging'
function mergeq() {
local mqDir=$(upsearch script/mergeq)
[[ -z "$1" ]] && return 1
[[ -z "$mqDir" ]] && return 44
class LambdaList
include Enumerable
def initialize(*list)
@list = list
end
def each(&block)
@list.each { |item| yield item.call }
end
#!/bin/bash
max_runs=10
rspec_opts="$@"
function interrupted {
echo -en "\n*** Cooling off... *** \n"
exit $?
}
@nocash
nocash / .vimrc
Last active August 29, 2015 14:07
augroup Miscellaneous
" Remove trailing whitespace
au FileType coffee,eruby,haml,javascript,php,ruby,sass,scss,sh,xml
\ au BufWritePre <buffer>
\ let pos = getpos('.')
\ | execute '%s/\s\+$//e'
\ | call setpos('.', pos)
augroup END
<?php
function _debug() {
$args = func_get_args();
echo '<pre>';
foreach($args as $arg) { var_dump($arg); }
echo '</pre>';
}
#!/bin/bash -e
ack_args=$@
git_ref='master'
pattern='TODO|NOTE|XXX'
function committed_files {
git diff ${git_ref}..HEAD --diff-filter=ACMX -G"$pattern" --name-only
}