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
# ss is the list of sizes to analyze | |
csv_file = CSV.generate do |csv| | |
csv << ["SKU", "ITEM NO", "PRODUCT", "STYLE", "SIZE", "UPC", "STARTING QTY", "ADDED QTY", "PO RECEIVED QTY", "PO WAITING QY", "MERCEDES QTY", "SENT QTY", "TO SEND QTY", "SOLD QTY", "UPC SIZE QTY", "UPC SIZE EXPECTED QTY", "GLITCHED QTY", "RECEIVED POS #", "AWAITING POS #"] | |
ss.each do |s| | |
auc = s.associated_upc_size | |
a = [] | |
a << s.retail_pro_id | |
a << s.product.item_no |
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 Time | |
attr_accessor :test | |
end | |
t = Time.now | |
mt = Marshal.dump [t,t] | |
Marshal.load(mt) == [t,t] #=> true | |
t.test = t - 31557600 | |
mt = Marshal.dump [t,t] |
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
module Sass::Script | |
module Functions | |
# substitue text in a string | |
# @params | |
# str the string to substitute text from | |
# reg the regexp given to sub | |
# rep the replacement text | |
def sub(str, reg, rep = '') | |
Sass::Script::String.new(str.to_s.sub(/#{reg.to_s}/, rep.to_s)) | |
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
# NB: I just wrote this to see how one would go about writing a mint store in rack cache and | |
# how hard it would be. I haven't tested it or even runned it so it most probably doesn't work (I'll | |
# play with it when I have more time) | |
module Rack::Cache | |
class MetaStore | |
# Stores request/response pairs in memcached. Keys are not stored | |
# directly since memcached has a 250-byte limit on key names. Instead, | |
# the SHA1 hexdigest of the key is used. | |
# Uses the mint store algorithm |