Skip to content

Instantly share code, notes, and snippets.

@shauns
shauns / index.html
Created November 22, 2016 15:49
Bad login page (uses GET)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Insecure Login</title>
</head>
@shauns
shauns / webtask.js
Created November 29, 2016 16:21
Webtask to swap auth0 ID token for stream.io one
"use latest";
import jwt from 'jsonwebtoken';
export default function(ctx, cb) {
const authSecret = ctx.data.AUTH0_CLIENT_SECRET;
const streamSecret = ctx.data.STREAM_CLIENT_SECRET;
const token = ctx.data.token;
const userId = jwt.verify(token, new Buffer(authSecret, 'base64')).sub;
const slug = ctx.data.feed;
@shauns
shauns / gist:453b076ec53e51ce518a0e374172a4ea
Created November 7, 2018 11:41
Setting up Apache Superset on EC2 Ubuntu 18
sudo apt-get update
sudo apt-get install build-essential libssl-dev libffi-dev python-dev python-pip libsasl2-dev libldap2-dev
sudo apt-get install build-essential libssl-dev libffi-dev python3.6-dev python-pip libsasl2-dev libldap2-dev
pip install virtualenv
sudo apt install python3-venv
pyvenv venv
source venv/bin/activate
pip install --upgrade setuptools pip
pip install superset
pip install psycopg2
@shauns
shauns / damm_check.gs
Created September 11, 2020 08:00
Damm Algorithm check digit for Google Sheets
// See https://en.wikipedia.org/wiki/Damm_algorithm
// =DAMM(5724) == true
const cols = {
"0": {
"0": "0",
"1": "7",
"2": "4",
"3": "1",
"4": "6",