Skip to content

Instantly share code, notes, and snippets.

View jaredhanson's full-sized avatar

Jared Hanson jaredhanson

View GitHub Profile
@neojp
neojp / Node.js: Using "supervisor" with "Locomotive"
Created February 16, 2012 19:59
Runs a Locomotive app, listens and auto-reloads server if code changes are found.
# node-supervisor: https://github.com/isaacs/node-supervisor
# locomotive: http://locomotivejs.org/
supervisor --watch app/controllers,config,config/environments,config/initializers -- node_modules/locomotive/bin/lcm.js server
@joshbirk
joshbirk / samplerest.js
Created February 3, 2012 19:57
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')
@joshbirk
joshbirk / strategy.js
Created February 1, 2012 22:33
ForceDotCom Strategy for Passport
/**
* Module dependencies.
*/
var querystring = require('querystring'),
util = require('util'),
OAuth2Strategy = require('passport-oauth').OAuth2Strategy;
function Strategy(options, verify) {
options = options || {};