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
| iostat -xtm 3 /dev/sdc | |
| Linux 2.6.18-164.11.1.el5 (tm26-s00225) 03/24/11 | |
| Time: 11:30:31 | |
| avg-cpu: %user %nice %system %iowait %steal %idle | |
| 0.36 0.00 0.09 0.15 0.00 99.40 | |
| Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util | |
| sdc 0.00 0.02 1.37 2.91 0.06 0.04 49.58 0.01 3.37 1.33 0.57 |
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
| # Be sure to restart your server when you modify this file. | |
| # These settings change the behavior of Rails 2 apps and will be defaults | |
| # for Rails 3. You can remove this initializer when Rails 3 is released. | |
| if defined?(ActiveRecord) | |
| # Include Active Record class name as root for JSON serialized output. | |
| ActiveRecord::Base.include_root_in_json = true | |
| # Store the full class name (including module namespace) in STI type column. | |
| ActiveRecord::Base.store_full_sti_class = true | |
| 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
| def self.extended(controller) | |
| controller.extend(ControllerMethods) | |
| controller._helpers.module_eval { include HelperMethods } | |
| existing_actions = controller.action_methods + ControllerMethods.public_instance_methods(true) | |
| controller.class.class_eval do | |
| cattr_accessor :actions_to_use | |
| def self.override_action_methods(actions=[]) | |
| self.actions_to_use = actions |
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
| my_big_array = (0..10000000000000).to_a | |
| object= some_object.new do | |
| #Do some stuff | |
| #Save block for later use | |
| end | |
| #Block holds a reference to my_big_array until it goes away |
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
| Inheritance | |
| app/models/page.rb L 89 def clone... | |
| (lib | lib/patches)/productize.rb L 62 def clone_with_nil_timestamps.... | |
| Composition | |
| app/controllers/balances.rb L 209 def balances_by_industry...... | |
| vendor/plugins/to_csv.rb | |
| DIP (Dependency Injection Principle) | |
| lib/patches/extend_client_actions_and_helpers.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
| Started GET "/" for 127.0.0.1 at Tue May 17 10:52:57 -0700 2011 | |
| SQL (2.0ms) describe `areas_stores` | |
| SQL (1.4ms) describe `comarketing_pages_stores` | |
| SQL (2.0ms) describe `pages_stores` | |
| SQL (1.9ms) describe `areas_stores` | |
| HERE OPTIONS={} | |
| SQL (2.6ms) SHOW TABLES | |
| HERE OPTIONS={:relationship_name=>:unit_attributes, :class_name=>"SelfStorageUnitAttributes"} | |
| SQL (2.5ms) SHOW TABLES | |
| Processing by ContentController#index as HTML |
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
| g5search@sancho:/data/cruisecontrolrb/current$ ./cruise start | |
| => Booting WEBrick | |
| => Rails 2.3.2 application starting on http://0.0.0.0:3333 | |
| cruise data root = '/home/g5search/.cruise' | |
| ./lib/cruise_control/../../script/../config/../vendor/rails/railties/lib/rails/gem_dependency.rb:99:in `requirement': undefined local variable or method `version_requirements' for #<Rails::GemDependency:0xb6f7e8b8> (NameError) | |
| from /home/g5search/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/site_ruby/1.8/rubygems.rb:254:in `activate' | |
| from /home/g5search/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/site_ruby/1.8/rubygems.rb:1204:in `gem' | |
| from ./lib/cruise_control/../../script/../config/../vendor/rails/railties/lib/rails/gem_dependency.rb:57:in `add_load_paths' | |
| from ./lib/cruise_control/../../script/../config/../vendor/rails/railties/lib/initializer.rb:299:in `add_gem_load_paths' | |
| from ./lib/cruise_control/../../script/../config/../vendor/rails/railties/lib/initializer.rb:299:in `each' |
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 jQueryLoaded(){ | |
| return (typeof(jQuery) != 'undefined'); | |
| } | |
| if(jQueryLoaded()){ | |
| console.log('WTF jQuery?'); | |
| $('document').ready(function(){ | |
| jquery_link_to(); | |
| }); |
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 :gts do | |
| desc "get source of lead for client" | |
| task(:source_for_client_lead => :environment) do | |
| start_date = ENV['start_date'] || Date.parse('2011-01-01') | |
| client_id = ENV['client_id'] || 1003 | |
| lead_types = LeadType.all(:select=>'id, name') | |
| lead_types_by_id = {} | |
| lead_types.each{|lead| lead_types_by_id[lead.id] = lead_types_by_id.name } |