Skip to content

Instantly share code, notes, and snippets.

@jaredhanson
jaredhanson / gist:3854950
Created October 8, 2012 21:00
Sketch RelMeAuth strategy for Passport
// mapping relmeauth provider support to local URLs for initiating
// authentication, using OAuth, OAuth 2.0, or just about anything else
passport.use(new RelmeStrategy({
'twitter.com': '/auth/twitter'
'facebook.com': '/auth/facebook'
},
function(token, profile, done) {
// relme auth is mostly a discovery mechanism, which redirects
// the the highest-priority, supported provider. The verify
// callback would likely be handled best by the configured
# compl1.rb - Redis autocomplete example
# download female-names.txt from http://antirez.com/misc/female-names.txt
require 'rubygems'
require 'redis'
r = Redis.new
# Create the completion sorted set
if !r.exists(:compl)