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
Return-Path: <[email protected]> | |
X-Original-To: [email protected] | |
Delivered-To: [email protected] | |
Received: from mx8.webfaction.com (mail8.webfaction.com [174.133.21.100]) | |
by mailbox7.webfaction.com (Postfix) with ESMTP id 5EC55137B240 | |
for <[email protected]>; Wed, 23 Nov 2011 20:13:57 -0600 (CST) | |
Received: from localhost (localhost.localdomain [127.0.0.1]) | |
by mx8.webfaction.com (Postfix) with ESMTP id 94722C40080; | |
Wed, 23 Nov 2011 20:13:56 -0600 (CST) | |
X-Spam-Flag: NO |
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
Return-Path: <[email protected]> | |
Received: from Olivier-Vaillancourts-MacBook-Pro.local (bas1-montreal48-1176433004.dsl.bell.ca. [70.30.241.108]) | |
by mx.google.com with ESMTPS id k4sm26729745vdu.2.2011.11.23.18.13.46 | |
(version=SSLv3 cipher=OTHER); | |
Wed, 23 Nov 2011 18:13:47 -0800 (PST) | |
Date: Wed, 23 Nov 2011 18:13:47 -0800 (PST) | |
message-id: <[email protected]> | |
from: Keaton Row <[email protected]> | |
to: [email protected] | |
subject: Thank you for submitting! |
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 stream = require('stream'); | |
var util = require('util'); | |
var fs = require('fs'); | |
var os = require('os'); | |
var path = require('path'); | |
var CRLF = "\r\n"; | |
var counter = 0; | |
var generate_boundary = 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
if(typeof req.header('x-forwarded-for') !== 'undefined') | |
{ | |
req.socket.remoteAddress = req.header('x-forwarded-for'); | |
console.log(req.header('x-forwarded-for')); | |
console.log(req.socket.remoteAddress); | |
} | |
----------------------- |
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
Base = function(name){ | |
this.name = name; | |
} | |
Child = function(){ | |
Base.call(this,'ImAchild'); | |
} | |
Child.prototype = new Base(); |
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 mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var dbUrl = 'DB_URL HERE'; | |
//Initialize mongoose | |
var mongoose = require('mongoose'); | |
mongoose.connect( |
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 myStatic = express.static(__dirname + '/my/static/path'); | |
app.use(function(req,res,next){ | |
//We set the custom header here. | |
res.setHeader('My-header-name','my-header-value'); | |
//We call the static middleware here, if the middleware calls "next", it means | |
//it didn't serve the file so we replace the static mw's "next" with a custom | |
//function that removes the header entry and calls the real "next" from the | |
//wrapper. This ensure we don't pollute subsequent middleware/route's response | |
//with that custom header. |
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 mongoose = require('mongoose') | |
,Schema = mongoose.Schema; | |
var BusStop = require('./BusStop.js'); | |
var BusScheduleSchema = require('./BusSchedule.js').schema; | |
var BusStopSchema = BusStop.schema; | |
var RouteRateSchema = require('./RouteRate.js').schema; | |
var StopEntrySchema = new Schema({ | |
order: {type: Number, min:0, required: true} |
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
use <databasename> | |
db.<collectionname>.getIndexKeys() |
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.createServer(); | |
someApp = express.createServer(); | |
someApp.get('/', function(req, res) { | |
res.end('Reached / in someApp'); | |
}); | |
app.use('/foobar', someApp); |
OlderNewer