Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Usage: git-thanks <since>..<until>
#
# All commits on master, ever:
# git-thanks master
#
# All commits on master since the 0.9.0 tag:
# git-thanks 0.9.0..master
git log "$1" |
module Enumerable
class Evaluator
instance_methods.each { |s| undef_method(s) unless s.to_s =~ /__/ }
def initialize(enum, invoke=nil, *args)
@enum = enum
@invoke = invoke
@args = args
end
digraph Features {
subgraph cluster_0 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
invoice ->accounting;
accounts -> leads;
humanresources -> leads;
humanresources -> salesorder;
EASY MARSHMALLOWS
-----------------
Marshmallows are perhaps one of the simplest confections you can make. They only require
a handful of ingredients, a batch can be thrown together in 10-15 minutes (plus *cough*
3 hours for them to set), and you can flavor them however you like. (You haven't LIVED
until you've had coconut marshmallows!)
Hardware needed:
@rkh
rkh / gist:290216
Created January 29, 2010 22:24 — forked from nakajima/gist:290151
$ irb
>> i = 2
=> 2
>> i *= 2
=> 4
>> (_*_) # use the butt operator
=> 16
@rkh
rkh / snippet.rb
Created March 25, 2010 14:02 — forked from lsegal/snippet.rb
class Object
def self.method_added(name)
const_set :InstanceMethods, Module.new unless const_defined? :InstanceMethods
meth = instance_method(name).bind(self.allocate)
self::InstanceMethods.send(:define_method, name, &meth)
remove_method(name)
include self::InstanceMethods unless ancestors.include? self::InstanceMethods
end
end
(gdb) ref 0x105488720
1 total references:
#<Buffer:0x10140ed18>
$18 = void
(gdb) ref 0x10140ed18
1 total references:
#<TCPSocket:0x101407ff8>
$19 = void
(gdb) ref 0x101407ff8
3 total references:
#!/bin/bash
# run with: curl -s http://gist.github.com/265272.txt | bash
set -e
localdir=$HOME/.mongodb
datadir=$localdir/data
conf=$localdir/mongod.conf
agentdir=$HOME/Library/LaunchAgents
agent=$agentdir/org.mongodb.mongod.plist
# Simple rack app
require 'rubygems'
require 'thin'
app = Proc.new{ [200, { "Content-Type" => "text/html"}, ["Hello World"]]}
with_middleware = MyMiddleware.new app
Rack::Handler::Thin.run(with_middleware, :Port => 4000)
# rubygems DNS is temporarily down, put this into your /etc/hosts to install gems,
# but don't forget to remove the entries once their DNS is back up again
72.4.120.124 rubygems.org
207.171.181.231 production.s3.rubygems.org
216.137.45.24 production.cf.rubygems.org