This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph Features { | |
subgraph cluster_0 { | |
style=filled; | |
color=lightgrey; | |
node [style=filled,color=white]; | |
invoice ->accounting; | |
accounts -> leads; | |
humanresources -> leads; | |
humanresources -> salesorder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ irb | |
>> i = 2 | |
=> 2 | |
>> i *= 2 | |
=> 4 | |
>> (_*_) # use the butt operator | |
=> 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
OlderNewer