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
App.mydb.changes({ | |
since: 'now', | |
live: true | |
}).on('change', function(docChanges) { | |
console.log('changed', docChanges) | |
if (docChanges.deleted) { | |
var underscore = docChanges.id.indexOf('_'), | |
docType = docChanges.id.substring(0, underscore), | |
docId = docChanges.id.substring(docChanges.id.indexOf('_', underscore + 1) + 1); |
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 restify = require('restify'); | |
function respond(req, res, next) { | |
res.send(req.params); | |
next(); | |
} | |
var server = restify.createServer(); | |
server.use(restify.bodyParser()); |
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/zsh | |
# Explanation | |
# I've my mac setup so pressing F13-F19 will touch a file like ~/scripts/global-f13.watch. | |
# If I now run a command, say "make", and afterwards I run ". f-bind 13", then upon | |
# pressing F-13, the shell with automatically queue a "make" + <ENTER>. | |
# This preserves history, allows me to use a single shell, and doesn't interrupt | |
# other processes (say "man ls" for example). | |
if [[ $ZSH_EVAL_CONTEXT == 'toplevel' ]]; then |