Skip to content

Instantly share code, notes, and snippets.

View jaredhanson's full-sized avatar

Jared Hanson jaredhanson

View GitHub Profile
@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 || {};
@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')
@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
@PatrickHeneise
PatrickHeneise / gist:2132062
Created March 20, 2012 06:38
passport.js with flatiron.js, union and director
var flatiron = require('flatiron')
, connect = require('connect')
, path = require('path')
, fs = require('fs')
, plates = require('plates')
, director = require('director')
, util = require('util')
, keys = require('./auth_keys')
, passport = require('passport')
, TwitterStrategy = require('passport-twitter').Strategy
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@drinchev
drinchev / gist:2266544
Created March 31, 2012 16:26
Integrate NowJS with Express and Passport
var express = require('express')
, passport = require('passport')
, sessionStore = new express.session.MemoryStore()
, app = module.exports = express.createServer()
, nowjs = require('now');
app.configure( function () {
app.use(express.bodyParser());
@distracteddev
distracteddev / request.js
Created May 10, 2012 23:31
A Modification to the Node.js Passport module that looks for flatiron/union and binds the request functions onto the appropriate object.
/**
* Module dependencies.
*/
// If flatiron/union is being used, then bind the following
// functions to the RoutingStream Prototype
try {
var union = require('union')
, req = union.RoutingStream.prototype;
}
node_modules/A/node_modules/B/node_modules/C/all.js
for i in $HOME/local/*; do
[ -d $i/bin ] && PATH="${i}/bin:${PATH}"
[ -d $i/sbin ] && PATH="${i}/sbin:${PATH}"
[ -d $i/include ] && CPATH="${i}/include:${CPATH}"
[ -d $i/lib ] && LD_LIBRARY_PATH="${i}/lib:${LD_LIBRARY_PATH}"
[ -d $i/lib ] && LD_RUN_PATH="${i}/lib:${LD_RUN_PATH}"
# uncomment the following if you use macintosh
# [ -d $i/lib ] && DYLD_LIBRARY_PATH="${i}/lib:${DYLD_LIBRARY_PATH}"
[ -d $i/lib/pkgconfig ] && PKG_CONFIG_PATH="${i}/lib/pkgconfig:${PKG_CONFIG_PATH}"
[ -d $i/share/man ] && MANPATH="${i}/share/man:${MANPATH}"
@josephwecker
josephwecker / new_bashrc.sh
Created August 11, 2012 04:36
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# -- DEPRICATED --
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch
# (Thanks gioele)
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?