This file contains hidden or 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 hidden or 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 hidden or 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": "[email protected]" | |
| } | |
| ], | |
| "description": "wanderfoot application", |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Vagrant.configure("2") do |config| | |
| config.vm.box = "precise64" | |
| config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
| config.vm.network :private_network, ip: "192.168.100.1" | |
| config.vm.provision :shell, :path => "vagrant/bootstrap.sh" | |
| end |
This file contains hidden or 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 export_connect_csv(user_id, res){ | |
| ConnectModel.mysqlPool.getConnection(function(err, connection){ | |
| res.header('Content-Type', 'text/csv'); | |
| var csv_header_row = "Email,First Name,Last Name,Status,Created\n"; | |
| res.write(csv_header_row); | |
| var query = connection.query('SELECT * FROM connects where user_id = ? AND deleted = 0', [user_id]); | |
| query | |
| .on('error', function(err) { |