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 PRO | |
def self.create a, b, c | |
obj = build(a, b, c) | |
obj.save | |
obj | |
end | |
def self.build a, b, c | |
Model.new params(a, b, c) | |
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
1. We evaluate the code from the beginner's perspective. We can assume | |
mediocre Ruby and mediocre Rails knowledge but we try to look at the | |
code as if it is the first time we have seen it. This allows us to try | |
to bring fresh perspectives to the code (and, hopefully, improve the | |
code for people that are reading it for the first time). | |
2. As in a retrospective, we assume that everyone involved was doing | |
the best that they can with the knowledge that they had at the time. | |
This is not a session to assign blame or to even feel guilty. We are | |
all trying to improve. That being said, it is expected that the |
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
#!/bin/sh | |
USER=$(git config --global user.name) | |
EMAIL=$(git config --global user.email) | |
if [ -z "$USER" ]; then | |
echo "Please set your name in your git config:" | |
echo " git config --global user.name <name>" | |
exit 1 | |
fi |
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 | |
include Mongoid::Document | |
field :name | |
end | |
users = User.all.cache | |
users.each { |u| puts u } # Database hit | |
users.each { |u| puts u } # No database hit | |
class Post |
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 First | |
def hello; "FIRST"; end | |
end | |
Speak.send :include, First |
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
/* | |
* Event.j | |
* Canvas Creator | |
* | |
* Created by Ryan on May 21th, 2011. | |
* Copyright 2011, Synvox rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@import <AppKit/CPView.j> |
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
def create | |
@receipt = Receipt.new( | |
... (several params here) | |
:store => Store.find_or_create_by_name(params[:receipt][:store_name]) | |
... (more fucking parameters here)) | |
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
- (id)init | |
{ | |
... | |
loginController = [LoginController createWithDelegate:self]; | |
... | |
var controllers = [loginController, stepOneController, stepTwoController]; | |
[bodyView addSubview:[loginController view]]; | |
... | |
} |
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
DH6256s-MacBook-Pro:~ ThoughtWorks$ rvm install rbx | |
rbx-1.1.0-20100923 installing #dependencies | |
rbx-1.1.0-20100923 #downloading (rubinius-1.1.0-20100923.tar.gz), this may take a while depending on your connection... | |
rbx-1.1.0-20100923 - #extracting | |
rbx-1.1.0-20100923 - #configuring | |
rbx-1.1.0-20100923 - #compiling | |
Error running '/Users/ThoughtWorks/.rvm/wrappers/ruby-1.8.7-p302/rake install', please check /Users/ThoughtWorks/.rvm/log/rbx-1.1.0-20100923/rake.error.log | |
There has been an error while running '/Users/ThoughtWorks/.rvm/wrappers/ruby-1.8.7-p302/ruby ./configure --prefix=/Users/ThoughtWorks/.rvm/rubies/rbx-1.1.0-20100923 --skip-system'. | |
Halting the installation. | |
DH6256s-MacBook-Pro:~ ThoughtWorks$ more ~/.rvm/log/rbx-1.1.0-20100923/rake.error.log |
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
var methods = []; | |
for(var i = 0; i < 10; i++) | |
{ | |
methods.push(function() { | |
require("system").print(i); | |
}); | |
} | |
for(var k = 0; k < 10; k++) |