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
Person.published | |
#<Mongoid::Scope:0x18e5a70 | |
@conditions= | |
{:where=>{:published_at=>{"$lt"=>Mon Jul 26 11:25:19 -0500 2010}}}, | |
@parent=Person> | |
Person.published.published_on(3.days.ago, 1.days.ago) | |
#<Mongoid::Scope:0x18e2ec4 | |
@conditions= | |
{:where=> | |
{:published_at=> |
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 'mongoid' | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new.db('testing') | |
end | |
class User | |
include Mongoid::Document | |
has_many_related :memberships | |
collection.remove |
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 User | |
def doctors=(doctors) | |
write_attribute(:cached_doctors, doctors.map(&:attributes)) | |
@doctors = doctors | |
end | |
def doctors | |
@doctors ||= read_attribute(:cached_doctors).map do |doctor| | |
Mongoid::Factory.build(Doctor, doctor) | |
end | |
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
Feature "User creates new pitch" do | |
Background do | |
Given "I am a normal user" do | |
sign_in | |
end | |
And "I visit the home page" do | |
visit home_path | |
end | |
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
# Store 10,000 history entries | |
export HISTSIZE=10000 | |
# Don't store duplicates | |
export HISTCONTROL=erasedups | |
# Append to history file | |
shopt -s histappend | |
# Conveniently download external resources: | |
# fetch http://example.com/library.tar.gz | |
# fetch ftp://example.com/file.zip |
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
{ | |
:x => 1, | |
:y => 2 | |
} | |
# Macro: | |
# /:x^M | |
# ^ | |
# f= |
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
[exec] g++ -o /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//lib/native//Darwin/libjruby-cext.jnilib -arch i386 -arch x86_64 -dynamiclib -framework JavaVM -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//build/st.o /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//build/Handle.o /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//build/JLocalEnv.o /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//build/JString.o /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//build/JUtil.o /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//build/JavaException.o /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//build/Type.o /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//build/array.o /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//build/bignum.o /Users/bernerdschaefer/.rvm/repos/jruby-head/cext/src/../..//build/class.o /Us |
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
# Set up pathogen.vim | |
cd ~/.vim/autoload | |
curl -O http://github.com/tpope/vim-pathogen/raw/master/autoload/pathogen.vim | |
vim ~/.vimrc | |
# add this to the top: | |
# runtime! autoload/pathogen.vim | |
# if exists('g:loaded_pathogen') | |
# call pathogen#runtime_prepend_subdirectories(expand('~/.vimbundles')) | |
# endif | |
mkdir ~/.vimbundles |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'jruby-jars' | |
jruby = JRubyJars.core_jar_path | |
# => "gems/jruby-jars-1.5.3/lib/jruby-core-1.5.3.jar" | |
jruby_stdlib = JRubyJars.stdlib_jar_path | |
# => "gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar" |