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 root = require('root'); | |
var github = require('github-auth'); | |
var app = root(); | |
var gh = github('blah', 'blehbleh', { | |
users: ['sorribas'] | |
}); | |
app.get('/login', function(req, res) { | |
res.send('<a href="'+gh.loginUrl+'">Login</a>'); |
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
/** @jsx React.DOM */ | |
var React = require('react') | |
module.exports = React.createClass({ displayName: 'SearchPopup', | |
propTypes: { | |
onSelect: React.PropTypes.func.isRequired, | |
items: React.PropTypes.arrayOf( | |
React.PropTypes.shape({ | |
columns: React.PropTypes.arrayOf(React.PropTypes.string).isRequired, | |
}) |
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
test('remove should work without callback', function(t) { | |
fixtures.load(function() { | |
var beers = sub(db.beers, 'DK', 'country'); | |
beers.remove(); | |
setTimeout(function() { | |
db.beers.count(function(err, n) { | |
t.equal(n, 2); | |
t.end(); | |
}); | |
}, 500); |
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
#!/usr/bin/env node | |
var fs = require('fs'); | |
var path = require('path'); | |
var exec = require('child_process').exec; | |
var TIMEOUT = 20000; | |
var tests = fs.readdirSync(__dirname).filter(function(file) { | |
return !fs.statSync(path.join(__dirname,file)).isDirectory(); |
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 fs = require('fs'); | |
var cp = require('child_process'); | |
var stream = require('stream'); | |
var thunky = require('thunky'); | |
var os = require('os'); | |
var path = require('path'); | |
var afterAll = require('after-all'); | |
var xtend = require('xtend'); | |
var once = require('once'); | |
var http = require('http'); |
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 transverser = function(obj) { | |
var result = []; | |
var pusher = function(str, arr) { | |
arr.forEach(function(obj) { | |
if (obj.perms) return pusher(str + obj.value, obj.perms); | |
result.push(str + obj.value); | |
}); | |
}; |
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 x = 3; | |
if (x % 2 == 0) | |
{ | |
console.log('EL número es par'); | |
console.log('...'); | |
} | |
else | |
{ | |
console.log('EL número es impar'); |
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
(defmacro timeperiod [& x] | |
(cond (= (first (rest x)) 'minutes) (list * (first x) 60000) | |
(= (first (rest x)) 'seconds) (list * (first x) 1000) | |
(= (first (rest x)) 'hours) (list * (first x) 3600000) | |
:else 0)) |
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 mmm = require('multi-master-merge'); | |
var leveljs = require('level-js'); | |
var levelup = require('levelup'); | |
var lup = levelup('invoicer', { db: leveljs }); | |
var db = mmm(lup, {encoding: 'json'}); | |
db.put('a', {}, function() { | |
db.get('a', function(err, val) { | |
console.log(val); |
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
// taken from http://visionmedia.github.io/mocha/ | |
describe('Connection', function(){ | |
var db = new Connection | |
, tobi = new User('tobi') | |
, loki = new User('loki') | |
, jane = new User('jane'); | |
beforeEach(function(done){ | |
db.clear(function(err){ |
OlderNewer