This file contains 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 | |
require file.dirname(__FILE__) + /../config/environment' | |
require 'aws/s3' | |
require 'progressbar' | |
#set up S3 config connect | |
config = YAML.load(File.open(File.join(RAILS_ROOT, 'config/amazon_s3.yml')))[RAILS_ENV] | |
bucket = config['bucket_name'] | |
AWS::S3::Base.establish_connection!( |
This file contains 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
## Colors | |
# colors for misc things | |
export TERM=xterm-color | |
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32' | |
export CLICOLOR=1 | |
# Set colors | |
export LS_COLORS='di=1;36:fi=0:ln=4;34:pi=5:so=4;5:bd=5:cd=5:or=4;91:mi=4;92:ex=35:*.rb=90' | |
# used in command prompt |
This file contains 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
mv /Applications/Firefox.app/Contents/MacOS/libsqlite3.dylib /Applications/Firefox.app/Contents/MacOS/libsqlite3.dylib.orig | |
cp /usr/lib/libsqlite3.dylib /Applications/Firefox.app/Contents/MacOS/libsqlite3.dylib |
This file contains 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
ApprovalStatuses = { | |
deleteApprovalStatus: function() { | |
if(confirm("Are you sure you want to delete this approval status?")) { | |
if($(this).parent("form").find("input[name='drug_record_count']").val() > 0) { | |
$("#move_drug_records_form").attr("action", $(this).parent("form").attr("action")); | |
var approvalStatusId = $(this).parent("form").find("input[name='approval_status_id']").val(); | |
$("#target_approval_status_id").customSelect.hideOption(approvalStatusId); | |
Thickbox.show({inlineId: "move_drug_records", modal: true, height: 200, width: 380}); | |
} else { | |
$(this).parent("form").submit(); |
This file contains 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 Stacker | |
include Utils | |
attr_reader :chart_to_go | |
attr_accessor :caption | |
attr_accessor :start_date | |
attr_accessor :input_records | |
attr_accessor :date_string | |
def initialize(caption, start_date, y_axis) | |
@caption = caption |
This file contains 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 GetLatLong | |
require 'open-uri' | |
attr_reader :latitude | |
attr_reader :longitude | |
attr_reader :message | |
attr_reader :valid | |
attr_writer :address | |
attr_writer :state |
This file contains 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 Float | |
def round_to(x) | |
(self * 10**x).round.to_f / 10**x | |
end | |
def ceil_to(x) | |
(self * 10**x).ceil.to_f / 10**x | |
end | |
def floor_to(x) |
This file contains 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
desc 'Scrape away.' | |
require 'config/boot' | |
require 'config/environment' | |
require 'application' | |
require 'net/ftp' | |
#include Utils | |
require 'rubygems' | |
require 'open-uri' | |
require 'hpricot' |
This file contains 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 | |
respond_to do |format| | |
format.xml { | |
install = OnInstall.new do |i| | |
i.ip_address = request.remote_ip | |
i.mac_address = params[:mac_address] | |
i.on_dvd_id = params[:on_dvd_id].to_i | |
i.on_dvd_number = params[:on_dvd_number] | |
i.on_dvd_set_id = params[:on_dvd_set_id].to_i |
This file contains 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
CREATE PROCEDURE sp_generate_forecast (IN p_run_day INT(10), IN p_month INT(10), IN p_year INT(10), IN revplanid INT(10), IN month_days INT(10)) | |
BEGIN | |
DECLARE r_units, r_day, r_partner int; | |
DECLARE done int DEFAULT 0; | |
— fields – partial_total day_ave retail_chg margin_chg | |
— retail_margin net_sales p_rev_share gross_margin | |
— clear out any previous forecast | |
DELETE FROM revplan_infos | |
WHERE revplan_id = revplanid |