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)
+ 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
echo "$1 is not a directory"
View gist:43974
require "ostruct"
describe "wtf" do
it "fails" do
o = :foo => "lol", :bar => "what"
o.gem "foo"
View gist:80128
~ ➔ sudo easy_install simplejson
Searching for simplejson
Best match: simplejson 2.0.9
Processing simplejson-2.0.9.tar.gz
Running simplejson-2.0.9/ -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
# This shell script passes all its arguments to the binary inside the
# 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 /
Created Sep 22, 2009
bash promptery for git + custom colored dirty flags
# 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
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 / 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: for the latest code
# or: sudo gem install rack-streaming-proxy --source
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.
many :nodes do
# root documents only
def roots
You can’t perform that action at this time.