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
| describe ObjectOne do | |
| let(:objects) { | |
| object_one = ObjectOne.create | |
| object_two = ObjectTwo.create :object_one: object_one | |
| object_three = ObjectThree.create :object_one: object_one | |
| [object_one, object_two, object_three] | |
| } | |
| it "should ..." do | |
| object_one, object_two, object_three = *objects |
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
| kill = function() { | |
| var callback; | |
| callback = function() { | |
| return setTimeout((function() { | |
| // nasty | |
| }), 10); | |
| }; | |
| return setInterval(callback, 10); | |
| }; |
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
| tmp | |
| log | |
| doc | |
| daemon | |
| *.swp |
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
| #!/usr/bin/env ruby | |
| # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | |
| require 'rubygems' | |
| require 'rails/commands/server' | |
| require 'rack' | |
| require 'webrick' | |
| require 'webrick/https' | |
| module Rails |
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
| (function ($) { | |
| $('.runner').bind('bet_type:changed', function (betType) { | |
| }); | |
| $('input.bet_type').click( | |
| var value = $(this).value; | |
| $('.runner').fire('bet_type:changed', value) | |
| ); | |
| $('.runner odds').each(function () { | |
| $(document).bind('odds:updated', odds) { |
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
| namespace :db do | |
| desc "nuke the database" | |
| task :nuke do | |
| Rake::Task["db:drop"].invoke | |
| Rake::Task["db:create"].invoke | |
| Rake::Task["db:migrate"].invoke | |
| Rake::Task["db:seed"].invoke | |
| Rake::Task["db:test:clone"].invoke | |
| 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
| server { | |
| # production | |
| listen 8080; | |
| server_name 10.10.10.15; | |
| root /u/apps/data_production/current/public; # <--- be sure to point to 'public'! | |
| passenger_enabled on; | |
| rails_env production; | |
| passenger_min_instances 1; | |
| access_log /u/apps/data_production/current/log/nginx-access.log; | |
| error_log /u/apps/data_production/current/log/nginx-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
| # Postgres backup script | |
| # mynameisrufus | |
| # | |
| # Cron tab examples: | |
| # | |
| # daily keeping the last 5 days (run at 1:00AM, 2 minutes after the hour) | |
| # | |
| # 02 1 * * * postgres /script/db_backup.sh daily /var/backups/db $DATABASE_OWNER 5 >> /var/backups/db/backup.log 2>&1 | |
| # | |
| # |
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
| # Run using $ rails new [appname] -JT -m new.rb | |
| # GEMS | |
| gem 'rails', '3.0.3' | |
| gem 'compass', '0.10.6' | |
| gem 'devise', '1.1.5' | |
| gem 'cancan', '1.4.1' | |
| # unversioned gems |
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
| after_save :remove_erroneous_record | |
| def remove_erroneous_record | |
| self.destroy if created_in_error? | |
| end | |
| def created_in_error? | |
| referral_outcome == "Created in Error" | |
| end |