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
package main | |
import ( | |
"fmt" | |
"hash/crc32" | |
"runtime" | |
"time" | |
) | |
var buf []byte |
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
register '/home/martin/elephant-bird/pig/target/elephant-bird-pig-3.0.7-SNAPSHOT.jar'; | |
register '/home/martin/json_simple-1.1.jar'; | |
data = load '/events/2013/02/27/00h05' using com.twitter.elephantbird.pig.load.JsonLoader() as (json: map[]); | |
cleaned = foreach data generate json#'date' as date, (long)json#'clicks' as clicks, (long)json#'ais' as ais, (long)json#'pis' as pis, (long)json#'requests' as requests, (long)json#'bids' as bids,(long)json#'bid_requests' as bid_requests; | |
grouped = group cleaned by date; | |
result = foreach grouped generate group as date, SUM(cleaned.clicks), SUM(cleaned.ais), SUM(cleaned.pis), SUM(cleaned.requests), SUM(cleaned.bids), SUM(cleaned.bid_requests); | |
STORE result INTO '/tmp/martin/stats'; |
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
// variante 1 | |
Class('AdsController', { | |
isa: Controller, | |
events : function() { return { | |
click : { | |
'#ads_overview a[metadata]' : this.update_meta.only('index'), | |
'.cancel' : this.redirect.only('new','edit'), | |
}, | |
change : { | |
'select' : this.blubi.only('index'), |
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
$.query_string = function(obj) { | |
var i = 0, queryString = [], chunks = []; | |
var is = function(o, t) { | |
return o != undefined && o !== null && (!!t ? o.constructor == t : true); | |
}; | |
var addFields = function(arr, key, value) { | |
if (!is(value) || value === false) return; | |
var o = [key]; | |
if (value !== true) { | |
o.push("="); |
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
#!/bin/sh | |
# Shell script to install your public key on a remote machine | |
# Takes the remote machine name as an argument. | |
# Obviously, the remote machine must accept password authentication, | |
# or one of the other keys in your ssh-agent, for this to work. | |
ID_FILE="${HOME}/.ssh/id_rsa.pub" | |
if [ "-i" = "$1" ]; then |