Skip to content

Instantly share code, notes, and snippets.

Avatar

Randall Degges rdegges

View GitHub Profile
View load.js
var async = require('async');
var stormpath = require('stormpath');
var uuid = require('uuid');
// Modify these values for testing.
var TOTAL_USERS = 10000;
var CONCURRENT_REQUESTS = 10;
var client = new stormpath.Client({
apiKey: {
@rdegges
rdegges / database.csv
Created Mar 11, 2014
The simplest password database: a CSV file.
View database.csv
rdegges omgmypass
rocketspaceadmin abc123
liljohn OKKAAAYYYY!
View test.py
@app.route('/register', methods=['GET', 'POST'])
def register():
"""
This view allows a user to register for the site.
"""
if request.method == 'GET':
return render_template('register.html')
try:
user = User(
View keybase.md

Keybase proof

I hereby claim:

  • I am rdegges on github.
  • I am rdegges (https://keybase.io/rdegges) on keybase.
  • I have a public key whose fingerprint is 0F3A DC05 17EE DFAD 9F24 3CE0 6B52 9541 D230 3B0C

To claim this, I am signing this object:

@rdegges
rdegges / quickstart.py
Created May 16, 2014
Stormpath Python Quickstart Code Sample
View quickstart.py
"""
quickstart.py
~~~~~~~~~~~~~
Code from the Stormpath Python Quickstart:
http://docs.stormpath.com/python/quickstart/
You can run this code by typing:
$ python quickstart.py
@rdegges
rdegges / quickstart.js
Last active Aug 29, 2015
Stormpath Node.js Quickstart
View quickstart.js
/*
* quickstart.js
* ~~~~~~~~~~~~~
*
* Code from the Stormpath Node.js Quickstart:
* http://docs.stormpath.com/nodejs/quickstart/
*
* You can run this code by typing:
*
* $ node quickstart.js
@rdegges
rdegges / app.py
Last active Aug 29, 2015
Flask-Stormpath Quickstart
View app.py
"""
app.py
~~~~~~
A simple Flask-Stormpath app.
"""
from os.path import expanduser
@rdegges
rdegges / iter.py
Created Jun 17, 2014
Iterate Through Stormpath Accounts, Printing Custom Data
View iter.py
from json import dumps
from os import environ
from stormpath.client import Client
APPLICATION_NAME = 'test'
client = Client(
@rdegges
rdegges / sample.js
Created Jun 27, 2014
stormpath node api
View sample.js
var app = require('express')();
var stormpath = require('express-stormpath');
// example 1 - auth by middleware
app.use(stormpath({
'/', true, // enforce login
}));
app.get('/', function(req, res) {
res.send('im authenticated!');
@rdegges
rdegges / example.js
Created Jun 27, 2014
express middleware rendering bug?
View example.js
var express = require('express');
app.use(function(req, res, next) {
if (req.url === '/login') {
req.app.set('views', __dirname + '/views');
req.app.set('view engine', 'jade');
res.render('login');
}
next();
});