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
GIT = $(which git) | |
while read oldrev newrev refname | |
do | |
echo >&2 " - $oldrev - $newrev - $refname" | |
while read line do | |
echo >&2 "-" | |
echo >&2 $line | |
# ok now do real stuff |
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
map = function(){ | |
customer = this; | |
function fresh_data(){ | |
return { | |
'order_value' : 0, | |
'order_sales' : 0, | |
'order_count' : 0, | |
'customer_count' : 1, | |
'item_count' : 0, |
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
var template = function(){ | |
var args = Array.prototype.slice.call(arguments), | |
res = ""; | |
console.log (args.length); | |
if (args.length > 1) { | |
data = args[ args.length - 1 ] | |
for ( var i = 0, l = args.length - 1; i < l; i++ ){ | |
temp = args[i]; | |
if (temp.constructor.toString().indexOf("Array") != -1) { | |
temp[temp.length] = data |
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
x_ids = taxon_x.product_ids | |
y_ids = taxon_y.product_ids | |
intersect = y_ids & x_ids | |
sorted_ids = intersect.concat(x_ids - intersect) |
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
{ | |
name : "Something", | |
things : [ | |
{foo : "148091a0719c", bar: 1}, | |
{foo : "0026080741c6", bar: 0} | |
] | |
} |
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 'net/http' | |
require 'uri' | |
require 'rubygems' | |
require 'json' | |
require 'pp' | |
url = URI.parse('http://localhost:3000/api/shipments/2145203996') | |
req = Net::HTTP::Get.new(url.path) | |
req["Content-Type"] = 'application/json' |