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').defaults({json: true}), | |
transfuse = require('transfuse'), | |
JSONStream = require('JSONStream'); | |
function transform(couchdb, funcString, headers) { | |
var down = request({url: couchdb + '/_all_docs?include_docs=true'}), | |
up = request({url: couchdb + '/_bulk_docs', method: "POST", headers: headers}), | |
tr = transfuse(['rows', /./, 'doc'], funcString, JSONStream.stringify("{\"docs\":[\n", "\n,\n", "\n]}\n")); | |
down.pipe(tr) | |
tr.pipe(up) |
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 | |
# Copyright (c) 2002-2012 "Neo Technology," | |
# Network Engine for Objects in Lund AB [http://neotechnology.com] | |
# | |
# This file is part of Neo4j. | |
# | |
# Neo4j is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
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 | |
### BEGIN INIT INFO | |
# Provides: neo4j-service | |
# Required-Start: | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
### END INIT INFO | |
# Copyright (c) 2002-2012 "Neo Technology," |
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 fs = require('fs') | |
, jade = require('jade') | |
var task = fs.readFileSync('task.jade') | |
var fn = jade.compile(fs.readFileSync('task.jade'), {pretty: true}) | |
console.log(fn({ | |
"settings" : { | |
"foo" : "low" | |
, "bar" : "high" |
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
# to autorun: curl -L http://j.mp/iusinstall | sh | |
ask4 () { | |
echo -n "$1 [Y]es/[N]o? " | |
read answer | |
finish="-1" | |
while [ "$finish" = '-1' ] | |
do | |
finish="1" | |
if [ "$answer" = '' ]; |
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
#!/usr/bin/env node | |
// this file is stored in a directory of APP_ROOT/script for me, all things are relative to that | |
var APP_ROOT = __dirname+"/../"; | |
// this assumes there is a file stored in APP_ROOT called "config.js" with the following structure: | |
// | |
// module.exports = { | |
// "development: { | |
// "postgresql": "tcp://postgres@localhost/dev-db" |
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 a=document.createElement("script");a.type="text/javascript";a.src="http://bit.ly/latestUnderscore";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)})(); |
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
cd /usr/local/src/ | |
wget http://nodejs.org/dist/v0.9.9/node-v0.9.9-linux-x64.tar.gz | |
tar zxvf node-v0.9.9-linux-x64.tar.gz | |
cd node-v0.9.9-linux-x64 | |
ln -s /usr/local/src/node-v0.9.9-linux-x64/bin/node /usr/local/bin/node | |
ln -s /usr/local/src/node-v0.9.9-linux-x64/bin/npm /usr/local/bin/npm | |
ln -s /usr/local/src/node-v0.9.9-linux-x64/bin/node /usr/bin |
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
// Creating custom :external selector | |
$.expr[':'].external = function(obj){ | |
return (obj.hostname != location.hostname); | |
}; | |
$(document).ready(function(){ | |
// Add 'external' CSS class to all external links | |
$('a:external').addClass('external'); | |
}); |