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
| $('#cartypes, #ratecodes').live 'change', -> | |
| $('#rates_grid').trigger 'reloadGrid' | |
| #set values of hidden inputs in form | |
| location = $('#loc_select').val() | |
| cartype = $('#cartypes').val() | |
| ratecode = $('#ratecodes').val() | |
| $('#location').val(location) | |
| $('#cartype').val(cartype) | |
| $('#ratecode').val(ratecode) | |
| $("#loc_select").live 'change', -> |
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
| set_location_cartype_ratecode_in_form = -> | |
| location = $('#loc_select').val() | |
| cartype = $('#cartypes').val() | |
| ratecode = $('#ratecodes').val() | |
| $('#location').val(location) | |
| $('#cartype').val(cartype) | |
| $('#ratecode').val(ratecode) |
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.valid_time?(time) | |
| time.length == 4 && time =~ /[0-2][0-9][0-5][0-9]/ && time.to_i <= 2359 | |
| 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
| $redis.multi do | |
| for pickup in (start_pickup .. end_pickup) | |
| rate_key = key(params[:location], @ratecode.code, params[:cartype], date) | |
| $redis.hmset rate_key, "base_rate", params[:base_rate], "rate_plan", @ratecode.rate_plan.code, "xday_rate", xday_rate, "xhr_rate", xhr_rate | |
| 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
| require 'bigdecimal' | |
| #define rates | |
| tax_rate = 0.07 | |
| tip_rate = 0.18 | |
| answer = {:total => 190} #initialize known round total | |
| for subtotal in (1 .. 150).map(&:to_s) | |
| subtotal = BigDecimal.new(subtotal) | |
| total = (subtotal*(1+BigDecimal.new(tax_rate.to_s)+BigDecimal.new(tip_rate.to_s))*100.0).round/100.0 | |
| if subtotal == subtotal.round && total == total.round && total < answer[:total] |
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
| require 'csv' | |
| desc "Imports Vendors" | |
| task :import_vendors => :environment do | |
| CSV.foreach("#{Rails.root}/public/system/vendors.csv") do |row| | |
| vendor = Vendor.create( | |
| :name => row[0], | |
| :iata => row[1].to_i, | |
| :address => row[2], | |
| :address2 => row[3], | |
| :city => row[4], |
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
| javax.servlet.ServletException: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- rack | |
| org.torquebox.web.servlet.RackFilter.doRack(RackFilter.java:116) | |
| org.torquebox.web.servlet.RackFilter.doFilter(RackFilter.java:100) | |
| org.torquebox.web.servlet.RackFilter.doFilter(RackFilter.java:72) |
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
| source 'http://rubygems.org' | |
| gem 'rails', '3.2.2' | |
| # Bundle edge Rails instead: | |
| # gem 'rails', :git => 'git://github.com/rails/rails.git' | |
| gem 'haml' | |
| gem 'acts_as_list' |
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
| /bin/sh bin/standalone.sh -Djruby.home=/home/deployer/.rvm/rubies/jruby-1.6.7 -b 10.10.123.46 | |
| ========================================================================= | |
| JBoss Bootstrap Environment | |
| JBOSS_HOME: /home/deployer/.rvm/gems/jruby-1.6.7/gems/torquebox-server-2.0.0.cr1-java/jboss | |
| JAVA: java | |
| JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml |
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
| /bin/sh bin/standalone.sh -Djruby.home=/home/deployer/.rvm/rubies/jruby-1.6.7 -b 10.10.123.46 | |
| ========================================================================= | |
| JBoss Bootstrap Environment | |
| JBOSS_HOME: /home/deployer/.rvm/gems/jruby-1.6.7/gems/torquebox-server-2.0.0.cr1-java/jboss | |
| JAVA: java | |
| JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml |