Skip to content

Instantly share code, notes, and snippets.

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
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
CraigCottingham / gist:2152417
Created Mar 21, 2012
Script to turn Git version into plist preprocessor vars for Xcode
View gist:2152417
GIT=`which git`
BASE="HelloWorld/HelloWorld-Info"
PLIST="$BASE.plist"
PLIST_H="$BASE-plist.h"
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
/LookupMutualFunds.do?symbolField=symbol&nameField="><script>alert(13323542.3157)</script>
@CraigCottingham
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
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 = []
init_var
end
def size_of_var
@var.size
end
end
@CraigCottingham
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}'"
else
@from = "pg_dump -Fc -c -O -v -- #{@from_spec}"
end
@CraigCottingham
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 http://jruby.org.s3.amazonaws.com/downloads/1.7.8/jruby-bin-1.7.8.tar.gz
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
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://CraigCottingham@github.com/CraigCottingham/kitchenplan.git
fetch = +refs/heads/*:refs/remotes/origin/*
View keybase.md

Keybase proof

I hereby claim:

  • I am CraigCottingham on github.
  • I am craigcottingham (https://keybase.io/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: