Skip to content

Instantly share code, notes, and snippets.

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
map = function(){
customer = this;
function fresh_data(){
return {
'order_value' : 0,
'order_sales' : 0,
'order_count' : 0,
'customer_count' : 1,
'item_count' : 0,
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
@nwb
nwb / gist:700810
Created November 15, 2010 19:22
Sorting taxons
x_ids = taxon_x.product_ids
y_ids = taxon_y.product_ids
intersect = y_ids & x_ids
sorted_ids = intersect.concat(x_ids - intersect)
{
name : "Something",
things : [
{foo : "148091a0719c", bar: 1},
{foo : "0026080741c6", bar: 0}
]
}
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'