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
| [engine repositoriesWithSuccess:^(id response){ | |
| NSLog(@"Got an array of repos: %@", obj); | |
| } failure:^(NSError *error) { | |
| NSLog(@"Crapsticks: %@", error); | |
| }]; | |
| [engine user:@"this_guy" isCollaboratorForRepository:@"UAGithubEngine" success:^(BOOL hotOrNot) { | |
| NSLog(@"%d", hotOrNot); | |
| } failure:^(NSError *error){ | |
| NSLog(@"Monkey balls: %@", error); |
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 ActiveSupport | |
| module Inflector | |
| def titleize(word) | |
| words = word.split(' ') | |
| processed_words = [] | |
| words.each do |aWord| | |
| aWord = aWord.capitalize unless /^[A-Z]*$/.match(aWord) | |
| processed_words << aWord | |
| end | |
| processed_words.join(" ") |
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 in_place_edit_with_validation_for(object, attribute) | |
| define_method("set_#{object}_#{attribute}") do | |
| klass = object.to_s.camelize.constantize | |
| @item = klass.find(params[:id]) | |
| @item.send("#{attribute}=", params[:value]) | |
| if @item.save | |
| render :update do |page| | |
| page.replace_html("#{object}_#{attribute}_#{params[:id]}_in_place_editor", | |
| @item.send(attribute)) | |
| 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
| # http://blog.leetsoft.com/2006/5/29/easy-migration-between-databases | |
| def interesting_tables | |
| ActiveRecord::Base.connection.tables.sort.reject! do |tbl| | |
| ['schema_migrations', 'sessions', 'public_exceptions'].include?(tbl) | |
| end | |
| end | |
| def backup | |
| dir = RAILS_ROOT + '/db/backup' |
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
| ORHMatch *newMatch = [[ORHMatch alloc] init]; | |
| newMatch.battingTeamId = batting; |