Skip to content

Instantly share code, notes, and snippets.

Nathan Witmer zerowidth

Block or report user

Report or block zerowidth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rubygems_debug.diff
--- /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb 2008-12-07 13:54:11.000000000 -0700
+++ /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb 2008-12-07 13:54:11.000000000 -0700
@@ -128,6 +128,10 @@
# Gem::Requirement and Gem::Version documentation.
def self.activate(gem, *version_requirements)
+ if ENV["GEM_DEBUG"]
+ STDERR.puts "activating #{gem} #{version_requirements.inspect}"
+ caller[2..-1].each {|c| STDERR.puts " #{c}"}
+ end
View .profile
function d() {
if [ -n "$1" ]; then
if [ -d "$1" ]; then
pushd $1 >/dev/null
mvim -c :NT
popd >/dev/null
else
echo "$1 is not a directory"
fi
else
View gist:43974
require "ostruct"
describe "wtf" do
it "fails" do
o = OpenStruct.new :foo => "lol", :bar => "what"
o.stub!(:gem)
o.gem
o.gem "foo"
end
end
View gist:80128
~ ➔ sudo easy_install simplejson
Password:
Searching for simplejson
Reading http://pypi.python.org/simple/simplejson/
Reading http://undefined.org/python/#simplejson
Best match: simplejson 2.0.9
Downloading http://pypi.python.org/packages/source/s/simplejson/simplejson-2.0.9.tar.gz#md5=af5e67a39ca3408563411d357e6d5e47
Processing simplejson-2.0.9.tar.gz
Running simplejson-2.0.9/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Irpzrr/simplejson-2.0.9/egg-dist-tmp-T_rpGb
No eggs found in /tmp/easy_install-Irpzrr/simplejson-2.0.9/egg-dist-tmp-T_rpGb (setup script problem?)
View mvim
#!/bin/sh
#
# This shell script passes all its arguments to the binary inside the
# MacVim.app application bundle. If you make links to this script as view,
# gvim, etc., then it will peek at the name used to call it and set options
# appropriately.
#
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
# Weber and Bjorn Winckler, Aug 13 2007).
View .gvimrc
" size the window so it fills the macbook screen
set columns=181
set lines=53
set gfn=Andale_Mono:h12
" colorscheme twilight2
colorscheme vibrantink
set transparency=5
@zerowidth
zerowidth / git_prompt.sh
Created Sep 22, 2009
bash promptery for git + custom colored dirty flags
View git_prompt.sh
# assuming you have the +bash_completion variant of git installed (macports)
# and are including bash completion's setup:
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
TEXT_BLACK='\[\e[0;30m\]' # Black - Regular
TEXT_RED='\[\e[0;31m\]' # Red
TEXT_GREEN='\[\e[0;32m\]' # Green
TEXT_YELLOW='\[\e[0;33m\]' # Yellow
@zerowidth
zerowidth / rack-streaming-proxy.rb
Created Nov 15, 2009
rack-streaming-proxy example code
View rack-streaming-proxy.rb
require "servolux"
require "net/http"
require "uri"
# see: http://github.com/aniero/rack-streaming-proxy for the latest code
# or: sudo gem install rack-streaming-proxy --source http://gemcutter.org
module Rack
class StreamingProxy
View module ancestry.txt
$ irb
>> module A; end
=> nil
>> module B; end
=> nil
>> module C; end
=> nil
>> module B; include A; end
=> B
>> class X; include B; end
View embedded_basic_mongo_tree.rb
class ParentDocument
include MongoMapper::Document
# parent document has ... well, whatever.
timestamps!
many :nodes do
# root documents only
def roots
You can’t perform that action at this time.