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
# put this method definition in your .irbrc | |
def log_to(stream = STDOUT) | |
ActiveRecord::Base.logger = Logger.new(stream) | |
ActiveRecord::Base.clear_active_connections! | |
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
# at the bottom of test_helper.rb | |
module ActiveSupport | |
class BacktraceCleaner | |
def remove_filters! | |
@filters = [] | |
end | |
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
post '/events' do | |
data = request.body.read | |
File.open(File.join(EVENTS_PATH, "#{Time.now.strftime('%Y%m%dT%H%M%S')}.xml"), "w") do |f| | |
f.write data | |
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
file '.gitignore', %q{ | |
log/*.log | |
tmp/**/* | |
doc/api | |
doc/app | |
} | |
run "touch log/.gitignore" | |
run "touch tmp/.gitignore" |
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
rec_td_stat_name = StatName.find_by_title("Reception Touchdowns") | |
rush_td_stat_name = StatName.find_by_title("Rush Touchdowns") | |
rrtd_stat_name = StatName.find_by_title("Rushing and Receiving Touchdowns") | |
GameStat.find_all_by_stat_name_id(rrtd_stat_name.id).each do |game_stat| | |
rec_td_game_stat = GameState.find_by_game_id_and_player_id_and_stat_name_id(game_stat.game_id, game_stat.player_id, rec_td_stat_name.id) | |
rush_td_game_stat = GameState.find_by_game_id_and_player_id_and_stat_name_id(game_stat.game_id, game_stat.player_id, rush_td_stat_name.id) | |
game_stat.update_attributes(:value => rec_td_game_stat.value.to_i + rush_td_game_stat.value.to_i) | |
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
# This is for voting for the budgetsketch project on http://cinciinnovates.com | |
# You can vote daily. This stupid simple mechanize script will simply submit | |
# your vote. You still have to confirm the vote from your email inbox. I | |
# figure a cron job to submit my vote keeps me from forgetting to vote daily | |
# and I (as a human) am still confirming; so not cheating. YMMV | |
require 'rubygems' | |
require 'mechanize' | |
require 'pp' |
NewerOlder