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 AddUsersRolesTable < ActiveRecord::Migration | |
| def self.up | |
| create_table :users_roles do |t| | |
| t.integer :user_id | |
| t.integer :role_id | |
| end | |
| end | |
| def self.down | |
| drop_table :users_roles |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.github.mxcl.homebrew.daemontools</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/local/bin/svscanboot</string> | |
| </array> |
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://unicorn.bogomips.org/SIGNALS.html | |
| rails_env = ENV['RAILS_ENV'] || 'production' | |
| rails_root = ENV['RAILS_ROOT'] || "/data/github/current" | |
| God.watch do |w| | |
| w.name = "unicorn" | |
| w.interval = 30.seconds # default | |
| # unicorn needs to be run from the rails root |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style> | |
| table {background:#ccc; color: white;} | |
| .odd {background:#777;} | |
| </style> | |
| <script src="http://code.jquery.com/jquery-1.5.min.js"></script> | |
| </head> | |
| <body> |
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
| ruby-1.9.2-p136@proman [git javascript] rake jasmine | |
| (in /Users/developer/Development/Workspace/ProMan) | |
| rake aborted! | |
| no such file to load -- spec/javascripts/support/jasmine_config.rb | |
| (See full trace by running task with --trace) | |
| ruby-1.9.2-p136@proman [git javascript] ls -alh spec/javascripts/support/jasmine_config.rb | |
| -rw-r--r--+ 1 developer staff 422B Jan 12 19:19 spec/javascripts/support/jasmine_config.rb |
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 | |
| @custom_errors = Array.new | |
| @chain = current_user.chain | |
| @chain.advertisers.each { |advertiser| | |
| @deal = Deal.new(params[:deal]) | |
| @deal.advertiser_id = advertiser.id | |
| @deal.advertiser.ripper = false | |
| @deal.advertiser.category_id = advertiser.category.parent_id | |
| @deal.advertiser.category_parent_id = advertiser.category.parent_id | |
| if @deal.save |
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
| development: | |
| adapter: sqlite3 | |
| database: db/development.sqlite3 | |
| timeout: 5000 | |
| test: | |
| adapter: sqlite3 | |
| database: db/test.sqlite3 | |
| timeout: 5000 |
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 html_safe_ajax_partial(name, partial, div) | |
| link_to_remote name, :url => new_session_url(:partial => partial, :format => 'js'), :update => div, :method => :get, :html => { :href => new_session_url(:partial => partial) } | |
| end | |
| #html_safe_ajax_partial('Hello', 'hi', 'coolstuff') | |
| #The above properly generates http://domain/session/new?partial=hi in the coolstuff div with text 'Hello' | |
| #<a onclick="new Ajax.Updater('page_contents', 'http://localhost:3001/session/new.js?partial=hi', {asynchronous:true, evalScripts:true, method:'get', parameters:'authenticity_token=' + encodeURIComponent('U44dXFOJa2g4cpjYTL+SwSySN3lh0jo9dD8joocNEgo=')}); return false;" href="http://localhost:3001/session/new?partial=about">Hello</a> | |
| #I want one to generate: | |
| #<a onclick="new Ajax.Updater('page_contents', 'http://localhost:3001/session/new.js?partial=hi', {asynchronous:true, evalScripts:true, method:'get', parameters:'authenticity_token=' + encodeURIComponent('U44dXFOJa2g4cpjYTL+SwSySN3lh0jo9dD8joocNEgo=')}); return false;" |
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
| DateTime::DAYNAMES[DateTime::ABBR_DAYNAMES.index("Sun")].downcase |
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 route_to_poly_controller(polymorphic_type, polymorphic_id, action = :show) | |
| return {:controller => polymorphic_type.tableize, :action => action, :id => polymorphic_id} | |
| end |