Startup a service that depends on amino
./bin/myservice --conf=/path/to/my/conf
Startup a service using the default conf path
./bin/myservice
numRead = 0 | |
numImported = 0 | |
doneReading = false | |
csv = require('csv')() | |
csv.fromPath result.filepath, {columns: true} | |
finish = () -> | |
process.stdout.write '\n' | |
log "" | |
log "Imported #{numImported} users".green |
Startup a service that depends on amino
./bin/myservice --conf=/path/to/my/conf
Startup a service using the default conf path
./bin/myservice
var path = /^\/socket\.io.+/; | |
app.router.get(path, handler); | |
console.log(app.router.routes); | |
/* CONSOLE OUTPUT | |
{ '^': { 'socket\\.io.+': { get: [Function: handler] } } } | |
*/ |
$ node http.js | |
events.js:48 | |
throw arguments[1]; // Unhandled 'error' event | |
^ | |
Error: connect EADDRNOTAVAIL | |
at errnoException (net.js:670:11) | |
at connect (net.js:548:19) | |
at Socket.connect (net.js:613:5) | |
at Object.<anonymous> (net.js:77:12) |
// relations api | |
// users | |
var carlos = 'carlos8f' | |
, brian = 'cpsubrian' | |
, sagar = 'astrosag_ngc4414' | |
// repos | |
var buffet = 'carlos8f/node-buffet' | |
, views = 'cpsubrian/node-views' |
var input = 'Hello, :name.first :name.last! :greeting'; | |
function tokenReplace(str, values) { | |
return str.replace(/:([\w.]+)/g, function (token, name) { | |
return name.split('.').reduce(function (value, part) { | |
return value[part] || null; | |
}, values) || token; | |
}); | |
} |
{ | |
"sublimelinter": "load-save", | |
// jshint: options for linting JavaScript. See http://www.jshint.com/options/ for more info. | |
// By deault, eval is allowed. | |
"jshint_options": | |
{ | |
// To fix column positions for JSHint errors you may want to add `"indent": 1` to your | |
// **User** "jshint_options". This issue affects users with tabs for indentation. | |
// This fix was reverted due to a conflict with using the `"white": true` option. |
# GIT Prompt | |
parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
WHITE="\[\033[1;37m\]" | |
GREEN="\[\033[0;32m\]" | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
B_YELLOW="\[\033[1;33m\]" | |
GREY="\[\033[0;39m\]" |
function addX (x) { | |
return function (a) { | |
return a + x; | |
} | |
} | |
var add5 = addX(5); | |
var add10 = addX(10); | |
// What is result? |