This file contains hidden or 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 Post | |
include FigLeaf | |
include ActiveModel::Validations | |
# ... | |
end |
This file contains hidden or 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 Something | |
module Another | |
def self.great | |
puts "great was called" | |
end | |
end | |
end | |
include Something |
This file contains hidden or 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
Faststep -- Standard Benchmark | |
21-Mar-2011 | |
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0] | |
Latest Commit: | |
commit 9c7c1b7b882d984fbc2840ae6d434af4e5e71cd6 | |
Author: Joshua Clayton <[email protected]> | |
Date: Sun Mar 20 21:02:55 2011 -0400 | |
5000 documents or queries per trial. Batches of 100 on batch inserts. |
This file contains hidden or 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
require 'formula' | |
class Vim <Formula | |
# Get stable versions from hg repo instead of downloading an increasing | |
# number of separate patches. | |
url 'https://vim.googlecode.com/hg/', :revision => '538cd32208' | |
version '7.3.011' | |
homepage 'http://www.vim.org/' | |
head 'https://vim.googlecode.com/hg/' |
This file contains hidden or 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 FakeResque | |
cattr_accessor :queue | |
self.queue = [] | |
def self.enqueue(klass, *args) | |
self.queue << [klass, args.to_json] | |
end | |
def self.run_jobs | |
while !self.queue.empty? |
This file contains hidden or 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 Archives | |
module Callbacks | |
def self.included(base) | |
base.send :include, Archives::Callbacks::InstanceMethods | |
base.before_create :do_something_awesome | |
end | |
module InstanceMethods | |
private |
This file contains hidden or 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
I use Homebrew and wanted to install pip for mercurial. Pip requires a homebrew-installed version of Python, which is fine and dandy; however, I noticed that webkit2png was broken after I installed Python with Homebrew (it was missing pyobjc libs, which comes with the OS X Python install by default). | |
This assumes that the current homebrewed version of Python is 2.7.1 and that homebrew is set up for /usr/local. If that's not the case, you may have to change the minor version of setuptools (e.g. from 2.7 to 2.8) and change the PATH accordingly. | |
$ brew install python | |
Modify your PATH to include the path to Python's bin directory: | |
export PATH="/usr/local/Cellar/python/2.7.1/bin:/usr/local/bin:$PATH" |
This file contains hidden or 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
vim_colors "totallybogus" do | |
author "Josh Clayton <[email protected]>" | |
notes "This is something kinda crazy" | |
reset true | |
background :light | |
warn_on_column_count 80 | |
normal "000", "F8F8FF" |
This file contains hidden or 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
vim_colors "totallybogus" do | |
author "Josh Clayton" | |
note "This is something kinda crazy" | |
reset true | |
background :light | |
normal :fg => "#000", | |
:bg => "#F8F8FF" | |
cursor :bg => "#445", :fg => "#F8F8FF" do | |
line :bg => "#D8D8DD" |
This file contains hidden or 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 ApplicationHelper | |
def placeholdit(geometry, options = {}) | |
base = "http://placehold.it/" | |
additional_options = [] | |
if geometry =~ /\A\d+(x\d+)?\z/ | |
additional_options << geometry | |
else | |
additional_options << 200 |