I hereby claim:
- I am jperkelens on github.
- I am thepurplemonk (https://keybase.io/thepurplemonk) on keybase.
- I have a public key whose fingerprint is 70D1 0CCD 0817 9100 E014 7511 1BE9 81FF B725 8BE8
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
class Sorter | |
place = (domino) => | |
one_idx = @key_index[domino[0]] | |
sort: (dominoes) -> | |
@sorted_dominoes = [] | |
@key_index = (0 for i in [0..9]) |
function SecModel() { | |
var user = getCurrentUser() //server call to user | |
return { | |
allowEdit: function() { | |
return user == profile.user | |
} | |
} | |
} |
function addMethod(obj, name, fn) { | |
var old = obj[name] | |
obj[name] = function() { | |
if (fn.length === arguments.length) | |
return fn.apply(this, arguments) | |
else if (typeof old == 'function') | |
return old.apply(this, arguments) | |
} | |
} |
module.exports = function() { | |
var cache = {} | |
var timeouts = {} | |
function replaceTimeout(key) { | |
clearTimeout(timeouts[key]) | |
timeouts[key] = setTimeout(function() { | |
delete cache[key] | |
}, 5000) | |
} |
var Datomic = module.exports = function(server, port, alias, name) { | |
root = blah | |
this.db_uri = blah | |
this.createDatabase = function(done) {...} | |
} |
file=*.test.js | |
files=`find test/unit -name '$(file)' -type f -print0 | xargs -0 echo` | |
default: all | |
all: unit peanut | |
ci: unit-ci peanut-ci | |
unit: |
var saveUser = function(callback) { | |
User.update({_id: this._id}, this, callback); | |
} | |
User.findOne = function(selector, callback) { | |
MongoHelper.findOne(selector, collectionName, function(err, result) { | |
if (err) return callback(err); | |
result.save = saveUser; | |
return callback(null, result); |