Skip to content

Instantly share code, notes, and snippets.

View aaaristo's full-sized avatar

Andrea Gariboldi aaaristo

View GitHub Profile
@aaaristo
aaaristo / sync-dev
Last active March 23, 2017 14:44
Synchronize a local development server with fswatch and rsync but transmitting multiple files at once instead of one-by-one
#!/bin/sh
ssh dev -t "bash -i -l -c '. ~/.nvm/nvm.sh; . ~/.bash_profile; cd $(pwd); git clean -f; git checkout .'"
fswatch -e .git/ . | node ${0}.js dev:$PWD
@aaaristo
aaaristo / newer.js
Last active October 10, 2018 14:09
a "ThreadLocal"-like context for asynchronous callback domains
function isIterator(obj)
{
return obj&&obj.next&&obj.throw;
}
function isRunWithContext(obj)
{
return obj&&typeof obj=='function'&&obj.ctx;
}