some things that need explaining first
uri: default scheme is file://
pin: pipe in
pout: pipe out
json selector: from here http://jsonselect.org
""" | |
simple script to merge multiple har files | |
usage: python merge_har.py out.har mylogs/*.har | |
""" | |
import simplejson | |
import sys | |
def merge(out_fn, in_files): | |
merged_log = { | |
'version': '1.1', |
from spidermonkey import Runtime | |
import sys | |
rt = Runtime() | |
def jsprint(*args): | |
print " ".join(str(a) for a in args) | |
def _require(source): | |
cx = newcontext() |
module.exports = connect.createServer( | |
connect.staticProvider(__dirname), | |
connect.router(function(app) { | |
app.post('/posttest', function(req, resp, params) { | |
sys.puts('post request'); | |
req.setEncoding('utf8'); | |
var body = ''; | |
req.addListener('data', function(data) { | |
sys.puts('data'+ data); | |
body += data; |
var connect = require('connect'), | |
sys = require('sys'); | |
if( 0 ) { | |
// this works | |
module.exports = connect.createServer( | |
function(req, resp) { | |
sys.puts('json request'); | |
req.setEncoding('utf8'); | |
var body = ''; |
dunk@somehost:/tmp$ sudo npm install fatbot | |
npm it worked if it ends with ok | |
npm configfile /home/dunk/.npmrc | |
npm cli [ 'install', 'fatbot' ] | |
npm version 0.1.20 | |
npm install pkg fatbot | |
npm fetch data fatbot | |
npm GET fatbot | |
npm install pkg fatbot | |
npm install pkg [email protected] |
// Retrieving the "dashboard" object will tell you how to draw the | |
// dashboard. I've organized the things with "panes" so if we want to | |
// add a right top or bottom one later the data format already | |
// supports it. | |
var exdata = { | |
"dashboard": { | |
"name" : "mydashboard", |
// list a directory | |
{ | |
command: 'ls', | |
arguments: [ | |
{'uri': '/home/dunk/*.json'} | |
] | |
} | |
// list a directory and grep the returned files for foo | |
{ |
{ | |
"name":"kuya-player", | |
"developer": { | |
"name":"kuya", | |
"url":"http://kuya.com" | |
}, | |
"description":"music player", | |
"icons":{ | |
"128":"/icon.png" | |
}, |
// this works | |
Router = new Backbone.Router({ | |
routes: { | |
'': 'accounts', | |
'accounts/:account_id': 'accounts', | |
'accounts/:account_id/campaigns': 'accounts', | |
'accounts/:account_id/campaigns/:campaign_id': 'accounts' | |
}, | |
accounts: function() { | |
console.log('accounts', arguments); |