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 request = require('request') | |
, JSONStream = require('JSONStream') | |
, es = require('event-stream') | |
var parser = JSONStream.parse(['rows', true, 'value') //emit parts that match this path (any element of the rows array) ---- Try added true after value | |
, req = request({url: 'http://isaacs.couchone.com/registry/_all_docs'}) | |
, logger = es.mapSync(function (data) { //create a stream that logs to stderr, | |
console.error(data) | |
return 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
var http = require('http'); | |
var pool = require('generic-pool').Pool({ | |
name : 'http_request', | |
create : function(callback) { | |
var c = http.createClient(80, '127.0.0.1'); | |
callback(null, c); | |
}, | |
destroy : function(client) { }, | |
max : 10, |
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
$(function(){ | |
var socket = io.connect('http://localhost:8080'); | |
socket.on('tweet', function(tweet) { | |
$('body').append('<div class="tweet">' + tweet.text + '</div>'); | |
}); | |
}); |
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
ln -s ~/Dropbox/Library/Preferences/com.googlecode.iterm2.plist.lockfile com.googlecode.iterm2.plist.lockfile | |
ln -s ~/Dropbox/Library/Preferences/com.googlecode.iterm2.plist.lockfile com.googlecode.iterm2.plist.lockfile |
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/bash | |
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)" | |
let secs=$((${upSeconds}%60)) | |
let mins=$((${upSeconds}/60%60)) | |
let hours=$((${upSeconds}/3600%24)) | |
let days=$((${upSeconds}/86400)) | |
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"` | |
# get the load averages | |
read one five fifteen rest < /proc/loadavg |
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
// print process.argv | |
process.argv.forEach(function (val, index, array) { | |
console.log(index + ': ' + val); | |
}); |
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
<?xml version="1.0"?> | |
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> | |
<service_bundle type="manifest" name="node-hello-world-service"> | |
<service name="site/node-hello-world-service" type="service" version="1"> | |
<create_default_instance enabled="true"/> | |
<single_instance/> | |
<dependency name="network" grouping="require_all" restart_on="refresh" type="service"> |
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 http = require('http') | |
, fs = require('fs') | |
, util= require('util'); | |
var jsdom = require("jsdom") | |
, $ = require("jquery"); | |
jsdom.env( |
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
set nocompatible " be iMproved | |
filetype off " required! | |
"Allow F2 key to toggle paste from outside of vim and retain indents | |
set pastetoggle=<F2> | |
"Set up the clipboard to be shared across termi windows" | |
set clipboard=unnamed | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() |
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 http = require('http') | |
, fs = require('fs') | |
, request = require('request') | |
, jsdom = require("jsdom"); | |
//Description: Create a file to pipe to. (this could also be added to a db if recommended.) | |
request('http://google.com').pipe(fs.createWriteStream('backup.html')) | |
//Description: use jsdom for DOM scrapping as needed dom needed. Alternatively this could be stored to DB. | |
jsdom.env({ |