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
# More "proper" than a miniskirt (http://gist.github.com/273579). | |
class Minidress | |
@@factories = {} | |
class << self | |
def define(name, &block) | |
@@factories[name.to_s] = block | |
end | |
def build(name, attrs = {}) | |
new(name.to_s.classify.constantize.new, &@@factories[name.to_s]).record |
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
# Factory girl, relaxed. | |
# | |
# Factory.define :user do |f| | |
# f.login 'johndoe%d' # Sequence. | |
# f.email '%{login}@example.com' # Interpolate. | |
# f.password f.password_confirmation('foobar') # Chain. | |
# end | |
# | |
# Factory.define :post do |f| | |
# f.user { Factory :user } # Blocks, if you must. |
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 | |
#Filename: .git/hooks/post-checkout | |
#Note: make sure to chmod +x post-checkout | |
CURRENT=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\\ \1/'` | |
if [ $CURRENT = "upgrade" ]; then | |
rvm use r19 | |
else |
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
/* Let's say your element '#example' has already been bound | |
* with $('#example').example(). | |
*/ | |
/* This will get rid of the example immediately. | |
* Note that this will not return the original jQuery object so | |
* we can't chain anything onto this call. | |
*/ | |
$('#example').triggerHandler('focus'); |
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
1) | |
'NewRelicSso#initialize timestamp should == 1385054736' FAILED | |
expected: 1385054736, | |
got: 1357027200 (using ==) | |
/Users/nu_numina/dev/boxpanel/spec/lib/new_relic_sso_spec.rb:15:in `block (3 levels) in <top (required)>' | |
/Users/nu_numina/.rvm/gems/ruby-1.9.3-p385@boxpanel/bin/ruby_noexec_wrapper:14:in `eval' | |
/Users/nu_numina/.rvm/gems/ruby-1.9.3-p385@boxpanel/bin/ruby_noexec_wrapper:14:in `<main>' | |
2) | |
'UserHelper User Helper#login_person sets the authed_customer_id session variable to the first active_customers id' FAILED |
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
# Creates Lkmake/Simplenote import-compatible json given plaintext file of notes separated by two blank lines | |
# Author: Christopher Galtenberg | |
# License: Use it for good, however you like | |
# Input file: | |
# example note 1 | |
# | |
# example note 2 |
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
$ git checkout master | |
Switched to branch 'master' | |
Your branch is up-to-date with 'upstream/master'. | |
$ git pull -r | |
remote: Counting objects: 167, done. | |
remote: Compressing objects: 100% (114/114), done. | |
remote: Total 167 (delta 74), reused 12 (delta 12), pack-reused 41 | |
Receiving objects: 100% (167/167), 58.66 KiB | 0 bytes/s, done. | |
Resolving deltas: 100% (81/81), completed with 11 local objects. |