Skip to content

Instantly share code, notes, and snippets.

View rdegges's full-sized avatar

Randall Degges rdegges

View GitHub Profile
@rdegges
rdegges / index.js
Created September 23, 2015 18:11
Raw express.
var express = require('express');
var stormpath = require('express-stormpath');
var morgan = require('morgan');
var app = express();
app.use(morgan('combined'));
stormpath.init(app, {
client: {
apiKey: {
@rdegges
rdegges / test.py
Created September 11, 2015 20:30
Stormpath Python signal example.
from pydispatch import dispatcher
from stormpath.client import Client
from stormpath.resources.base import SIGNAL_RESOURCE_CREATED
def resource_created(signal, sender, data, params):
"""Prints off some signal data when a resource is created."""
print 'signal:', signal
print 'sender:', sender
print 'data:', data
@rdegges
rdegges / test.py
Last active September 10, 2015 22:15
Load test.
# This test is meant to test out Scenario 1: a lot of users are concurrently
# creating accounts and then logging into a web service with Stormpath.
#
# This script will create 1,000 users total before exiting. This script should
# be launched as many concurrent times as you want to emulate production
# traffic.
#
# INSTALL:
# To install this script, you need to have pip (for python) installed. Then run:
#
@rdegges
rdegges / scenario_2.py
Created September 1, 2015 23:42
Load testing application #2.
# This test is meant to test out Scenario 2: users logging into a group
# protected page, refreshing their custom data, and saving it.
#
# This script will run the above operations 1,000 times in a row, and should be
# launched as many concurrent times as you want to emulate production traffic.
from uuid import uuid4
from stormpath.client import Client
STORMPATH_API_KEY_ID = 'xxx'
@rdegges
rdegges / scenario_1.py
Last active September 1, 2015 23:32
Load testing application #1.
# This test is meant to test out Scenario 1: a lot of users are concurrently
# creating accounts and then logging into a web service with Stormpath.
#
# This script will create 1,000 users total before exiting. This script should
# be launched as many concurrent times as you want to emulate production
# traffic.
from uuid import uuid4
from stormpath.client import Client
@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 / The Technical Interview Cheat Sheet.md
Last active August 3, 2019 16:21 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@rdegges
rdegges / gist:dd18ce0199b6c875994c
Created June 5, 2015 22:43
things-not-to-do-in-javascript
create a template engine
@rdegges
rdegges / tmux.conf
Created September 3, 2014 16:41
tmux.conf
##### CLEANUP
# Unbind the default tmux command prefix, CTRL+b.
unbind C-b
#####
##### PREFERENCES
# Use CTRL+a as our tmux command prefix.
set -g prefix C-a
@rdegges
rdegges / app.js
Created July 11, 2014 20:20
Stormpath Express Quickstart
var express = require('express');
var stormpath = require('express-stormpath');
var app = express();
app.use(stormpath.init(app, {
apiKeyFile: process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'] + '/.stormpath/apiKey.properties',
secretKey: 'some_random_long_string_here',
application: 'https://api.stormpath.com/v1/applications/xxx',
}));