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
var httpProxy = require('http-proxy'); | |
var pem = require('pem'); | |
pem.createCertificate({ days: 1, selfSigned: true }, function (err, keys) { | |
var httpsOptions = { | |
key: keys.serviceKey, | |
cert: keys.certificate | |
}; | |
httpProxy.createServer({ |
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
//PARAMETERS TO BE CHANGED | |
var PGCONN='tcp://postgres:password@localhost/database', | |
TABLE='testtable', | |
KEYNAME='id', | |
KEYTYPE='integer'; | |
pg=require('pg'), | |
cli=new pg.Client(PGCONN), | |
dbmon=require('dbmon'); |
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
var Crawler = require("crawler").Crawler; | |
//console.argv=['node', 'app.js', url, ext] | |
if (process.argv.length < 4) { | |
console.log('Usage: ' + process.argv[0] + ' ' + process.argv[1] + ' URL EXT'); | |
console.log('Example: ' + process.argv[0] + ' ' + process.argv[1] + ' http://www.omgubuntu.co.uk/ jpg,png'); | |
process.exit(1); | |
} | |
var url = process.argv[2], |
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
!!{ | |
chart:{zoomType: 'x', type:'area'}, | |
navigator:{ | |
xAxis:{ | |
labels:{ | |
formatter:function(){return this.value*2;} | |
}, | |
ordinal:false | |
} | |
}, |
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
var dataset1=[0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,10.408963,4.894694,1 |
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
/** Use Step to interact with a MongoDB database avoiding too many confusing callbacks, | |
requires: npm install mongodb step | |
*/ | |
var mongo = require('mongodb'), | |
db=new mongo.Db('test', new mongo.Server('localhost', 27017, {}), {}), | |
step=require('step'), | |
col; | |
step( | |
function open(){ |
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
#!/bin/bash | |
#Usage: nodebug app.js | |
node-inspector & | |
google-chrome http://127.0.0.1:8080/debug?port=5858 | |
node --debug-brk $1 |
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
<?php | |
class SimplestWidget_Widget extends Strx_Widget { | |
function w_id(){ return 'simplest-widget'; } | |
function w_name(){ return 'My Simplest Widget'; } | |
/** Return the dashboard admin form */ | |
function w_form($instance){ | |
return '<p>'.$this->w_form_input($instance, 'title').'</p>'; | |
} |
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
var debounce = function (func, threshold, execAsap) { | |
var timeout; | |
return function debounced () { | |
var obj = this, args = arguments; | |
function delayed () { | |
if (!execAsap) | |
func.apply(obj, args); | |
timeout = null; |
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
//Monitor bidders and bid for you; use jQuery ajax events capabilities | |
console.clear(); | |
(function($){ | |
$('#header_container') | |
.add('div.auction_related_list') | |
.add('div#footer_container') | |
.remove(); | |
var id=parseInt($('div.auction_top_cont td:last').text().match(/[0-9]+/)[0],10), |