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 partStamper = function(id) { | |
return function(part) { | |
part.stamp(id); | |
} | |
}; | |
var stamper1 = partStamper('car1'); | |
car1.parts.forEach(stamper1); | |
var stamper2 = partStamper('car2'); |
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
function check(id) { | |
return function(article, callback) { | |
// scope with id | |
// and the article itself | |
}; | |
} | |
exports.checkAll = function (d, callback) { | |
async.each(d.articles, | |
check(d.id), |
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
{ | |
'targets': [ | |
{ | |
'target_name': 'chimera', | |
'sources': [ | |
'src/top.cc', | |
'src/cookiejar.cc', | |
'src/chimera.cc', | |
'src/browser.cc' | |
], |
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
Show hidden characters
{ "keys": ["ctrl+k", "ctrl+["], "command": "insert_gist_list" }, | |
{ "keys": ["ctrl+k", "ctrl+]"], "command": "gist_add_file" } |
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
{ "keys": ["ctrl+k", "ctrl+["], "command": "insert_gist_list" }, | |
{ "keys": ["ctrl+k", "ctrl+]"], "command": "gist_add_file" } |
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
{ | |
"name": "wanderfoot", | |
"version": "0.0.1", | |
"contributors" : [ | |
{ | |
"name": "jarrod parkes", | |
"email": "parkesfjarrod@gmail.com" | |
} | |
], | |
"description": "wanderfoot application", |
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 sockjs = require('sockjs'); | |
var node_static = require('node-static'); | |
// 1. Echo sockjs server | |
var sockjs_opts = {sockjs_url: "http://cdn.sockjs.org/sockjs-0.3.min.js"}; | |
var sockjs_echo = sockjs.createServer(sockjs_opts); | |
sockjs_echo.on('connection', function(conn) { | |
conn.on('data', function(message) { |
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 RTII = function(req, res, next){ | |
types.list(function(types_){ | |
req.types = types_; | |
return next(); | |
}); | |
}; | |
app.get('/some/handler/that/needs/types', RTII, function(req, res){ | |
// req.types available here | |
}); |
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
// mw.getUserAndAgency | |
var middleware = function(req, res, next) { | |
req.statsdName = 'user_middleware'; | |
var get = cabinet | |
.read('users', req.token.user_id) | |
.with('agencies'); | |
get.execute(function(err, empty, result) { |
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
SELECT subscriptions.id, subscriptions.agency_id, subscriptions.expiry, | |
CASE | |
WHEN subscriptions.expiry > date_part('epoch'::text, now())::bigint THEN 'current'::text | |
ELSE 'expired'::text | |
END AS status | |
FROM subscriptions | |
ORDER BY subscriptions.expiry DESC; | |
-- This returns: | |
-- 25;1;1394321699;"current" |