Skip to content

Instantly share code, notes, and snippets.

View bnoguchi's full-sized avatar

Brian Noguchi bnoguchi

View GitHub Profile
@bnoguchi
bnoguchi / conf.js
Created November 28, 2011 00:53
Everyauth GH-113
module.exports = {
fb: {
appId: 'your fb app id',
appSecret: 'your fb app secret'
}
};
@bnoguchi
bnoguchi / example.js
Created March 11, 2012 06:10
Example everyauth ajax password response
everyauth.password
.respondToLoginSucceed( function (res, user) {
if (user) { /* Then the login was successful */
res.json({ success: true }, 200);
}
})
.respondToLoginFail( function (req, res, errors, login) {
if (!errors || !errors.length) return;
return res.json({ success: false, errors: errors });
});
@bnoguchi
bnoguchi / example.coffee
Created March 11, 2012 20:42
EveryAuth issue #208 (CoffeeScript)
bootstrapAuthentication()
application = express.createServer()
application.configure ->
bootstrap(application)
application.listen(2536)
bootstrapAuthentication = () ->
everyauth.twitter
// This code doesn't accept a URL of /auth/twitter or /auth/github
var express = require('express')
, routes = require('./routes')
, util = require('util')
, everyauth = require('everyauth');
var app = module.exports = express.createServer();
@bnoguchi
bnoguchi / x.coffee
Created May 5, 2012 22:32
phishApi html destructuring
destructure = (s) -> s.split("</a>").map (x) -> title: x[x.lastIndexOf('>')+1..], url: x.match(/href="([^"]+)"/)?[1]
reduceCb = (mem, curr) -> mem[curr[0...curr.indexOf ':']] = destructure curr; mem
dataBySetNumber = json.setlistdata.split(/<span[^>]+>Set /)[1..].reduce reduceCb, {}

Keybase proof

I hereby claim:

  • I am bnoguchi on github.
  • I am bnoguchi (https://keybase.io/bnoguchi) on keybase.
  • I have a public key whose fingerprint is BB2A 8AA0 7790 946A 3382 BB62 E6F3 DD87 0D8D 89D0

To claim this, I am signing this object: