Skip to content

Instantly share code, notes, and snippets.

@bcomnes
Last active March 28, 2016 18:17
Show Gist options
  • Select an option

  • Save bcomnes/e7d30edee5a530b5e997 to your computer and use it in GitHub Desktop.

Select an option

Save bcomnes/e7d30edee5a530b5e997 to your computer and use it in GitHub Desktop.
mafintosh patterns
// Optional options followed by callback
Hyperlog.prototype.get = function (key, opts, cb) {
if (!opts) opts = {}
if (typeof opts === 'function') {
cb = opts
opts = {}
}
var self = this
}
// Optional options
// `new` keyword safetey
var Hyperlog = function (db, opts) {
if (!(this instanceof Hyperlog)) return new Hyperlog(db, opts)
if (!opts) opts = {}
}
@mafintosh │ JSON_voorhees: i put in env.USERPROFILE + .conf.rc on win
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment