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
# https://www.youtube.com/watch?v=pZ_BcEcFGj0 | |
# http://www.slideshare.net/adymo/adymo-railsconf-improveperformance | |
require "csv" | |
data = CSV.open("data.csv") | |
output = data.readlines.map do |line| #readlines array, output array | |
line.map do |col| | |
col.downcase.gsub(/\w/){ $1.capitalize } #col.downcase, gsub, capitalize | |
end.join(',') |
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
http://webservice.mdsfulfillment.com/mds.order/ReceiveXML.aspx?xml=%3C?xml%20version=%221.0%22%20encoding=%22utf-8%22?%3E%3CMDSOrder%20xml:lang=%22en-US%22%3E%3CClientCode%3E8480%3C/ClientCode%3E%3CClientSignature%3E23A7D671-0DB4-4013-9B0F-AC04B45F7878%3C/ClientSignature%3E%3COrder%3E%3COrderID%3E100000025-1%3C/OrderID%3E%3CConsumerPONum%3E100000025-1-1%3C/ConsumerPONum%3E%3COrderDate%3E06/14/2013%3C/OrderDate%3E%3CRetailerID/%3E%3CShippingMethod%3EFlat%20Rate%20-%20Fixed%3C/ShippingMethod%3E%3CShipCompany%3E%3C/ShipCompany%3E%3CShipname%3Ewfvwe%20ergqegr%3C/Shipname%3E%3CShipAddress1%3Eqerqrgqgr%3C/ShipAddress1%3E%3CShipAddress2%3E%3C/ShipAddress2%3E%3CShipCity%3Eqgrqrg%3C/ShipCity%3E%3CShipState%3EGeorgia%3C/ShipState%3E%3CShipCountry%3EUS%3C/ShipCountry%3E%3CShipZip%3E23456%3C/ShipZip%3E%3CShipEmail%3Ekurt+johnny@ecommhub.com%3C/ShipEmail%3E%3CShipEmail2/%3E%3CShipPhone%3E1234560000%3C/ShipPhone%3E%3CShipPhone2/%3E%3CBillCompany%3E%3C/BillCompany%3E%3CBillname%3Ewfvwe%20ergqegr%3C/Billname%3E%3CBillAddress |
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
{ | |
"Antarctica/South_Pole" => "Auckland", | |
"America/Fortaleza" => "Buenos Aires", | |
"Pacific/Tongatapu" => "Nuku'alofa", | |
"America/Santa_Isabel" => "Pacific Time (US & Canada)", | |
"America/Antigua" => "Atlantic Time (Canada)", | |
"Pacific/Kwajalein" => "Auckland", | |
"Africa/Malabo" => "Paris", | |
"Australia/Sydney" => "Sydney", | |
"Asia/Makassar" => "Hong Kong", |
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 'cgi' | |
require 'fileutils' | |
desc 'Generate a code review.' | |
# Uses rake git_code_review[master,staging] by default | |
# Ex: rake git_code_review[tag1,HEAD] | |
task :git_code_review, :left, :right do |cmd, args| | |
left = ( args[:left] || "master" ) | |
right = ( args[:right] || "staging" ) |
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 'cgi' | |
require 'fileutils' | |
desc 'Generate a code review.' | |
# Uses rake code_review[master,qa] by default | |
task :code_review, :left_branch, :right_branch do |cmd, args| | |
left_branch = ( args[:left_branch] || "master" ) | |
right_branch = ( args[:right_branch] || "qa" ) | |
gp = GitParser.new(left_branch, right_branch) | |
gp.fancy_full_diff |