Skip to content

Instantly share code, notes, and snippets.

@tmslnz
tmslnz / basic-promise.js
Last active August 29, 2015 14:24 — forked from rc1/gist:b556844e290997b447e4
A most simple promise system, to explain promises
// A most simple promise system, to explain promises
var p = promise( function ( resolve, reject ) {
// do async stuff here
fs.readFile( function ( err, file ) {
if ( err ) {
reject( new Error( 'it mucked up' ) );
} else {
resolve( file );
}
@tmslnz
tmslnz / git-serve.md
Last active August 29, 2015 14:07 — forked from datagrok/git-serve.md

Launch a one-off git server from any local repository.

I [tweeted this already][1] but I thought it could use some expansion:

Enable decentralized git workflow:

git config alias.serve "daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/"

Say you use a git workflow that involves working with a core "official" repository that you pull and push your changes from and into. I'm sure many companies do this, as do many users of git hosting services like Github.