Skip to content

Instantly share code, notes, and snippets.

View robertjd's full-sized avatar

robertjd

View GitHub Profile
@robertjd
robertjd / post to organization accounts.js
Created November 5, 2015 00:42
post to organization accounts
var stormpath = require('stormpath');
var Account = require('stormpath/lib/resource/Account');
var client = new stormpath.Client();
var url = 'https://api.stormpath.com/v1/organizations/5ewOyyJOcQNCcLgS0AWUMa/accounts';
var data = {
providerData: {
providerId: 'facebook',
accessToken: 'foo'
@robertjd
robertjd / hsb 2015.md
Last active September 30, 2015 00:12
  • ALO - [ ]
  • [ ] Acres Of Space
  • [ ] Alison Brown & The Song Of The Banjo
  • [ ] Anderson East
  • [ ] Andy Reiss
  • [ ] Angel Olsen
  • [ ] Asleep At The Wheel
  • [ ] Audley Freed
  • [ ] Ben Miller Band
  • [ ] Beth Hart
@robertjd
robertjd / directives.md
Created March 17, 2015 19:31
missing password reset directives

We want to modify the two views that we created in the last steps.

Open client/app/passwordReset/passwordReset.html and replace it's contents with this:

<div ng-include="'components/navbar/navbar.html'"></div>

<div class="container">
  <div class="row">
TypeError: Cannot call method 'getAccount' of undefined
at onAuthcResult (d:\xampp\htdocs\sites\varsity-b-p1-microsite\node_modules\
passport-stormpath\lib\strategy.js:82:34)
at Application.authenticateApplicationAccount [as authenticateAccount] (d:\x
ampp\htdocs\sites\varsity-b-p1-microsite\node_modules\passport-stormpath\node_mo
dules\stormpath\lib\resource\Application.js:134:3)
at Strategy.authenticate (d:\xampp\htdocs\sites\varsity-b-p1-microsite\node_
modules\passport-stormpath\lib\strategy.js:77:16)
at attempt (d:\xampp\htdocs\sites\varsity-b-p1-microsite\node_modules\passpo
rt\lib\middleware\authenticate.js:341:16)
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var passport = require('passport');
var StormpathStrategy = require('passport-stormpath');
var session = require('express-session');
var express = require('express');
var router = express.Router();
var config = require('config');
var passport = require('passport');
var stormpath = require('stormpath');
// Register a new user to Stormpath.
router.post('/register', function(req, res, next) {
// var username = req.body.username;
@robertjd
robertjd / profile.jade
Created October 21, 2014 21:57
profile.jade
html
head
title=title
link(href='//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css', rel='stylesheet')
body
div.container
div.page-header
h1 My Profile
@robertjd
robertjd / profile.js
Last active August 29, 2015 14:07
Profile route handler for Stormpath
var express = require('express');
var forms = require('forms');
var csurf = require('csurf');
var collectFormErrors = require('express-stormpath/lib/helpers').collectFormErrors;
var stormpath = require('express-stormpath');
var extend = require('xtend');
// Declare the schema of our form:
var profileForm = forms.create({
@robertjd
robertjd / gist:6691388
Created September 24, 2013 21:17
javascript compute months passed
function monthsPassed(fromDate,toDate){
return toDate.getMonth() - fromDate.getMonth() + (12 * ( toDate.getFullYear() - fromDate.getFullYear() ))
}
@robertjd
robertjd / faq-en.md
Last active December 16, 2015 17:09 — forked from juemura/faq-en.md

General

  • How can I improve my English?

    Sign up at colingo.com and join our daily classes.

  • How do I get started?

    Follow the instructions step-by-step available at http://www.colingo.com/gettingstarted