Skip to content

Instantly share code, notes, and snippets.


Craig S. Cottingham CraigCottingham

View GitHub Profile
View gist:1346875
craigc@samantha:~/Projects/glitch$ gem list
*** LOCAL GEMS ***
activesupport (3.1.1)
bundler (1.0.21)
i18n (0.6.0)
multi_json (1.0.3)
nestful (0.0.7)
rake (0.9.2)
CraigCottingham / .gitattributes
Created Mar 21, 2012
.gitignore and .gitattributes for Xcode 4.3
View .gitattributes
# treats your Xcode project file as a binary; prevents Git from trying to fix newlines, show in diffs, and excludes from merges
*.pbxproj -crlf -diff -merge
CraigCottingham / gist:2152417
Created Mar 21, 2012
Script to turn Git version into plist preprocessor vars for Xcode
View gist:2152417
GIT=`which git`
touch $PLIST
VERSION=`$GIT describe --dirty | sed 's/[a-zA-Z]*//'`
SHORT_VERSION=`echo $VERSION | sed 's/\-[0-9]*\-[a-zA-Z0-9]*//'`
View gist:2230312
CraigCottingham / gist:3918748
Created Oct 19, 2012
Error trying to install ruby-1.9.3-p286 via RVM
View gist:3918748
[2012-10-19 09:58:27] make install
./miniruby -I./lib -I. -I.ext/common ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc"
installing binary commands: /Users/craigc/.rvm/rubies/ruby-1.9.3-p286/bin
installing base libraries: /Users/craigc/.rvm/rubies/ruby-1.9.3-p286/lib
installing arch files: /Users/craigc/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/x86_64-darwin12.2.0
installing pkgconfig data: /Users/craigc/.rvm/rubies/ruby-1.9.3-p286/lib/pkgconfig
installing command scripts: /Users/craigc/.rvm/rubies/ruby-1.9.3-p286/bin
installing library scripts: /Users/craigc/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1
installing common headers: /Users/craigc/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1
installing manpages: /Users/craigc/.rvm/rubies/ruby-1.9.3-p286/share/man/man1
CraigCottingham / base.rb
Last active Dec 11, 2015
Just how wrong is this? It works, but it feels dirty to call a method on the child class when it's not fully initialized yet.
View base.rb
class Base
def initialize
@var = []
def size_of_var
CraigCottingham / gist:7271927
Created Nov 1, 2013
Usage: pg_copy (source database name) (destination database name)
View gist:7271927
#!/usr/bin/env ruby -wKU
(@from_spec, @to_spec) = ARGV
if @from_spec.match(/^([^:]+):(.+)$/) { | md | @from_server = md[1]; @from_db = md[2] }
@from = "ssh #{@from_server} 'pg_dump -Fc -c -O -v -- #{@from_db}'"
@from = "pg_dump -Fc -c -O -v -- #{@from_spec}"
CraigCottingham / gist:7810070
Last active Dec 30, 2015
Output of running `rvm install jruby`
View gist:7810070
Searching for binary rubies, this might take some time.
Found remote file
Checking requirements for osx.
Requirements installation successful.
jruby-1.7.8 - #configure
jruby-1.7.8 - #download
jruby-1.7.8 - #validate archive
jruby-1.7.8 - #extract
jruby-1.7.8 - #validate binary
jruby-1.7.8 - #setup
View .git-config
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url =
fetch = +refs/heads/*:refs/remotes/origin/*

Keybase proof

I hereby claim:

  • I am CraigCottingham on github.
  • I am craigcottingham ( on keybase.
  • I have a public key whose fingerprint is 65B6 E2C1 FFFD C79A C2D7 651B 7FD2 D2D2 EE38 B33F

To claim this, I am signing this object: