Public Gists by carllerche

Gravatar
Fri Nov 13 11:52:05 -0800 2009
1
2
3
class Array
  def /(n)
    arr = []
Gravatar
Fri Oct 30 16:00:18 -0700 2009
1
2
3
# This is pretty evil, yeah... I know
class Module
  alias old_append_features append_features
Gravatar
Tue Oct 27 23:54:13 -0700 2009
1
2
3
def matching(prop)
  @matching ||= inject({}) do |hash, p|
    (hash[p.root] ||= []) << p
Gravatar
Tue Oct 27 22:11:13 -0700 2009
1
2
3
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
 
describe "Koios::Relationship" do
Gravatar
Tue Oct 13 12:44:17 -0700 2009
1
2
3
gem_env do
  gem "merb"
  gem "json", :namespace => "pure"
Gravatar
Mon Oct 12 20:10:15 -0700 2009
1
2
3
# This is pretty evil, yeah... I know
class Module
  alias old_append_features append_features
Gravatar
Thu Oct 08 11:28:04 -0700 2009
1
2
3
module Rails
  module Initializable
 
Gravatar
Wed Oct 07 23:36:48 -0700 2009
1
2
3
class Rails::Application
  initializer :require_frameworks do
    require "action_pack"
Gravatar
Fri Oct 02 12:23:30 -0700 2009
1
2
3
clear_sources
bundle_path "vendor/bundler_gems"
bin_path "vendor/bin"
Gravatar
Wed Sep 23 12:28:39 -0700 2009
1
2
3
class User
  include DataMapper::Resource
  
Gravatar
Thu Sep 03 11:38:00 -0700 2009
1
2
3
# heredocs can continue the code on the same line:
class SomeController
  def render opts
Gravatar
Tue Sep 01 13:29:15 -0700 2009
1
2
3
class Foo
  def initialize
    self.im_private # FAIL
Gravatar
Fri Aug 28 21:04:45 -0700 2009
1
2
3
require "rubygems"
require "rbench"
 
Gravatar
Mon Aug 24 18:31:30 -0700 2009
1
2
3
require "benchmark"
 
def do_it
Gravatar
Mon Aug 24 15:07:40 -0700 2009
1
2
3
def hello
  my_proc = do |a, b|
    a + b
Gravatar
Thu Jul 30 12:47:53 -0700 2009
1
2
3
require "rubygems"
require "spec"
 
Gravatar
Thu Jul 30 11:16:13 -0700 2009
1
2
3
def create
  @user = User.new
  respond_with(@user) do
Gravatar
Fri Jun 12 13:54:51 -0700 2009
1
2
3
<p><%= @name %> is awesome</p>
 
<p>OMG: <%= link_to "click", url(:hello) %></p>
Gravatar
Thu Jun 11 10:58:51 -0700 2009
1
2
3
module NewRelic
  class MerbBootLoader < Merb::BootLoader
    after Merb::BootLoader::ChooseAdapter
Gravatar
Thu Jun 11 10:55:37 -0700 2009
1
2
3
  class Merb::Slices::Initialize < Merb::BootLoader
  
    before AfterAppLoads