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
rm -rf xpto | |
rails _3.2.8_ new xpto -d postgresql --skip-bundle | |
cd xpto | |
bundle install | |
git init | |
git add . | |
git commit -m "first commit" |
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
cd ~ && git clone git://github.com/sstephenson/rbenv.git .rbenv && echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc && echo 'eval "$(rbenv init -)"' >> ~/.bashrc && source ~/.bashrc && git clone git://github.com/sstephenson/ruby-build.git && cd ruby-build && export PREFIX=”$HOME” && ./install.sh && echo 'export PATH="$HOME/ruby-build/bin:$PATH"' >> ~/.bashrc && cd ~ && source ~/.bashrc && rbenv-install 1.9.3-p125 && rbenv global 1.9.3-p125 |
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
Array.prototype.map = function(f) { | |
return this.fold([], function(current, el) { | |
return [f(current)].concat(el); | |
}); | |
} | |
Number.prototype.sum = function(val) { | |
return this + val; | |
} |
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
def Repeat(&block) | |
_RepeatUntil = Class.new { | |
def repeat(&block) | |
block.call | |
@action = block | |
self | |
end | |
def until(&block) | |
until result = block.call |
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
rvm use 1.9.2@rr75 --default && gem install cucumber --no-rdoc --no-ri |
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
function current_branch_name { | |
echo $(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/") | |
} | |
function rebasing_like_a_boss { | |
current_branch=$(current_branch_name) | |
if [ $1 ] ; then to_branch=$1 ; else to_branch="master" ; fi; | |
git co $to_branch && git pull --rebase && git rebase $current_branch && git pull --rebase && git push && git co $current_branch && git rebase $to_branch | |
} |
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
class Cliente | |
include ActiveModel::Validations | |
include ActiveModel::Serialization | |
def initialize(params) | |
#pega o hash e seta os atributos normalmente. | |
end | |
# todos meus atributos e métodos normalmente aqui |
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
#import <Foundation/Foundation.h> | |
@interface NSDictionary(Persistence) | |
-(void)writeToFileInDocumentsDir:(NSString *)path atomically:(BOOL)atomically; | |
@end |
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
#import <Foundation/Foundation.h> | |
#import "NSObject+TestExtension.h" | |
@interface Doubler : NSObject { | |
} | |
+(id)named:(NSString *)name; | |
-(BOOL)shouldHaveReceived:(NSString *)message with:(id)parameter; | |
-(BOOL)shouldHaveReceived:(NSString *)message; |
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
NSMutableArray *users = [NSMutableArray arrayWithArray:usersList]; | |
NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]; | |
[users sortUsingDescriptors:[NSArray arrayWithObject:sort]]; |