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
module.exports = { | |
"foo": process.env.FOO ? process.env.FOO : "bar" | |
}; |
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
// default behaviour is statsdClient.set | |
godot.reactor() | |
.statsd() | |
// this will emit statsdClient.timer | |
godot.reactor() | |
.tagged( 'timer' ) | |
.statsd({ type: 'timer' }) | |
// this will emit statsdClient.inc or stasdClient.decr |
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
{ | |
"$set": { | |
"$os": "Mac OS X", | |
"$browser": "Chrome", | |
"$initial_referrer": "$direct", | |
"$initial_referring_domain": "$direct", | |
"Test Values": [ | |
"foo", | |
"bar", | |
"foobar" |
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
npm --registry http://registry.oroszi.net:8008/riak/docs install debug |
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
describe(function(){ | |
afterEach(function(){ | |
removeMock( mysqlConnection, "query" ); | |
}); | |
it( "should return error because user doesnt exist", function(){ | |
mock( mysqlConnection, "query", function( sql, params, cb ){ | |
( cb||params )( null, [] ); | |
}); |
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 storage = require("./singleton-storage"); | |
app.get("/data", function( req, res ){ | |
var key = "key1"; | |
var data = storage.get(key); | |
res.json(data); // data is {"foo":"bar"} | |
}); |
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 http = require("http"); | |
var express = require("express"); | |
var app = express(); | |
var server = http.createServer(app); | |
var startServer = function(err){ | |
if( err ){ | |
console.log("wont start server due error", err ); | |
throw err; | |
} | |
server.listen(3000,function( err ){ |
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 util = require('util'); | |
var Transform = require('stream').Transform; | |
var MyTransformKlass = function(){ | |
Transform.apply(this,arguments); | |
this.pause(); | |
setTimeout(function imAsync(){ | |
this.resume(); | |
}.bind(this), 30000); | |
}; |
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
grunt.registerMultiTask("upload", function(){ | |
var async = require("async"); | |
var request = require("request"); | |
var path = require("path"); | |
var fs = require("fs"); | |
var done = this.async(); | |
var files = []; | |
var url = this.data.url; | |
var fns = []; | |
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 Backbone = require('backbone'); | |
var _ = require('underscore'); | |
// original: https://github.com/jashkenas/backbone/blob/master/backbone.js#L1037 | |
var delegateEventSplitter = /^(\S+)\s*(.*)$/; | |
var BaseView = Backbone.View.extend({ | |
// original: https://github.com/jashkenas/backbone/blob/master/backbone.js#L1112 | |
delegateEvents: function(events){ | |
if (!(events || (events = _.result(this, 'events')))) return this; |
OlderNewer