View gist:54f70c4079efb4693de146fe4820e70a
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
SELECT * FROM DocumentsUploadConfig WHERE DocumentType in ('Essay', 'LPN Program Classes') AND sectionid in (select id from supplementalsection where formsubsectionid in (select id from ApplicationFormSubsection where formsectionid in (select id from ApplicationFormSection where formid = @application_form_id))); | |
USE unicas_config; | |
SELECT * FROM DocumentsUploadConfig WHERE DocumentType in ('Essay', 'LPN Program Classes') AND formsubsectionid in ( | |
select id from ApplicationFormSubsection where formsectionid in ( | |
select id from ApplicationFormSection where formid = 6412)); |
View list_compare.psudo.rb
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
master_r4 = CSV.parse(File.read('/Users/grantdefayette/Documents/rails40-master-1.csv')) | |
master_r3 = CSV.parse(File.read('/Users/grantdefayette/Documents/rails31-master-1.csv')) | |
nf11481_r4 = CSV.parse(File.read('/Users/grantdefayette/Documents/general_comb_rails4.csv')) | |
nf11481_r3 = CSV.parse(File.read('/Users/grantdefayette/Documents/general_comb_rails3.csv')) | |
hash_ma4 = ma4.map { |r| h = Hash.new; h[r[2].to_i] = [r[8], r[4], r[8], r[3]]; h } | |
hash_ks4 = nf11481_r4.map { |r| h = Hash.new; h[r[0].to_i] = [r[1], r[2], r[3], r[4]]; h } | |
hhma4 = Hash.new; hma4.each { |h| hhma4[h.first.key] = h.first.value } |
View IFSQL.sql
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
SELECT | |
d.order_id AS OrderID, | |
o.ship_date AS ShipDate, | |
a.shipping_company AS ShippingCompany, | |
a.shipping_city AS ShippingCity, | |
a.shipping_state AS ShippingState, | |
a.shipping_zip AS ShippingZip, | |
d.client_reference AS ClientReference, | |
m.carrier AS Carrier, | |
IF(ISNULL(bo.bol_id), |
View keeper.rb
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
require 'time' | |
require 'date' | |
class Keeper | |
EXPIRE_TIME = 1209600 # 14 days | |
def initialize(path) | |
@root = Dir.new(path) | |
@client_folders = {} |
View missing_inventory.sql
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
select | |
o.order_id as 'NEG order', | |
d.client_reference as 'Order number', | |
o.status as 'Order status', | |
p.name as 'Product name', | |
p.sku as 'SKU', | |
p.upc as 'Barcode', | |
SUM(i.quantity) as 'Order calls for', | |
SUM(IFNULL(y.available, 0)) as 'Available', | |
SUM(IFNULL(y.allocated, 0)) as 'Allocated to other orders', |
View fix_pack.sql
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
insert into | |
order_pickpack (order_id, product_id, container_id, quantity) | |
select | |
'101813.2886', product_id, container_id, allocated | |
from | |
inventory_history | |
where | |
transaction_id = 9450767; | |
update order_inventory |
View FileReader.rb
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 FileReader | |
def self.read_file(text, file_delim, field_delim) | |
result = [] | |
lines_array = text.split([file_delim].pack('H*')) | |
lines_array.each do |line| | |
result << fields = line.split([field_delim].pack('H*')) | |
fields.each do |field| | |
puts field | |
end |
View activemapper_gist.rb
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
require 'active_record' | |
require 'yaml' | |
require 'pry' | |
dbconfig = YAML::load_file('config/database.yml') | |
ActiveRecord::Base.establish_connection(dbconfig) | |
class String | |
def camelize | |
self.split('_').map {|w| w.capitalize}.join |
View update_shipping_method.sql
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
update order_details | |
set shipment_method_id = 'i2U12R' | |
where order_id in | |
( | |
select | |
order_id | |
from | |
orders | |
where | |
client_id = 'artkohlcom' and status <> 'Shipped' and status <> 'Cancelled' |
View incursion_generator.vb
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
Imports System.Transactions | |
Class TemporalIncursionGenerator | |
Public Property ClientID As String | |
Public Property TransactionID As String | |
Public Property UserID As String | |
Private transaction_table As New DataTable | |
Private query_command As New System.Text.StringBuilder("") | |
Private command As New MySqlCommand() |
NewerOlder