Skip to content

Instantly share code, notes, and snippets.

View rdegges's full-sized avatar

Randall Degges rdegges

View GitHub Profile
@rdegges
rdegges / load.js
Created August 28, 2015 22:28
Load test.
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 March 11, 2014 15:53
The simplest password database: a CSV file.
rdegges omgmypass
rocketspaceadmin abc123
liljohn OKKAAAYYYY!
@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(

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 22:33
Stormpath Python Quickstart Code Sample
"""
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 August 29, 2015 14:01
Stormpath Node.js Quickstart
/*
* 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 August 29, 2015 14:01
Flask-Stormpath Quickstart
"""
app.py
~~~~~~
A simple Flask-Stormpath app.
"""
from os.path import expanduser
@rdegges
rdegges / iter.py
Created June 17, 2014 20:00
Iterate Through Stormpath Accounts, Printing Custom Data
from json import dumps
from os import environ
from stormpath.client import Client
APPLICATION_NAME = 'test'
client = Client(
@rdegges
rdegges / sample.js
Created June 27, 2014 17:07
stormpath node api
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 June 27, 2014 22:45
express middleware rendering bug?
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();
});