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
// (c) 2013 coderarity is a boss, inc | |
function Foo (id) { | |
var _this = this; | |
if (id) { | |
db.redis.get(id, function(err, res) { | |
var obj = JSON.parse(res); | |
for (property in obj) { | |
if (property === 'date_created') { | |
_this[property] = new Date(obj[property]); | |
} else { |
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 express = require('express'), | |
wine = require('./routes/wines'); | |
var app = express(); | |
app.configure(function () { | |
app.use(express.logger('dev')); /* 'default', 'short', 'tiny', 'dev' */ | |
app.use(express.bodyParser()); | |
app.use(express.static(__dirname)); | |
}); |
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
ofshard@whyink:~/346321 (master) $ curl -X POST \ -H "Content-type: application/json" \ --data "{ \"credentials\": githubUser:githubPassword }" \ https://nodejitsuUse | |
r:nodejitsuPass@webhooks.nodejitsu.com/1/auth/github | |
curl: (6) Couldn't resolve host ' -H' |
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": "nko3-intergrupo-mobile", | |
"version": "0.0.0-6", | |
"description": "Intergrupo Mobile", | |
"main": "server.js", | |
"scripts": { | |
"start": "node server.js" | |
}, | |
"repository": { | |
"type": "git", |
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 httpProxy = require('http-proxy'); | |
httpProxy.createServer(function (req, res, proxy) { | |
var buffer = httpProxy.buffer(req); | |
middleware(res, function() { | |
console.log("The request was proxied"); | |
}); | |
proxy.on('proxyError', function () { |
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 express = require('express'); | |
var app = express(); | |
var server = require('http').createServer(app); | |
var io = require('socket.io').listen(server); | |
var users = {}; | |
app.listen(80); | |
app.get('/', function handler (req, res) { |
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'), | |
https = require('https'), | |
httpProxy = require('./lib/node-http-proxy'); | |
var server = httpProxy.createServer({ | |
target: { host: 'graph.facebook.com', port: 443, https: true }, | |
changeOrigin: true }, | |
function (req, res, proxy) { | |
console.log("Received request."); | |
server.proxy.response_buffer = ''; |