Skip to content

Instantly share code, notes, and snippets.

@betawaffle
betawaffle / pry-bench.rb
Created October 25, 2011 00:56
Pry Helpers
Pry.config.should_load_plugins = false
Pry.config.editor = proc { |file, line| "subl -w #{file}:#{line}" }
Pry.prompt = [
proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " },
proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }
]
Pry.plugins['doc'].activate!
class BasicObject
@scttnlsn
scttnlsn / README.md
Created September 1, 2011 00:25
Minimalist append-only key/value store written in Ruby.

A minimalist append-only key/value store written in Ruby.

Ruby API

c = Collection.new('example.db')

c.set('hello', 'world')
c.get('hello') # => "world"
#include <ruby.h>
extern VALUE rb_cISeq;
extern VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
static VALUE
iseq_s_load(int argc, VALUE *argv, VALUE self)
{
VALUE data, opt=Qnil;
rb_scan_args(argc, argv, "11", &data, &opt);
#!/usr/bin/env ruby
# Copyright (c) 2011 Henrik Hodne
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
@ddollar
ddollar / hax.rb
Created October 26, 2009 19:50 — forked from wycats/hax.rb
Bundler Preinitializer
require "#{File.dirname(__FILE__)}/../vendor/bundler_gems/environment"
class Rails::Boot
def run
load_initializer
extend_environment
Rails::Initializer.run(:set_load_path)
end
def extend_environment
@schacon
schacon / gist:1
Created July 15, 2008 18:17
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.