Skip to content

Instantly share code, notes, and snippets.

Avatar

pjstein pjstein

View GitHub Profile
@pjstein
pjstein / mfa-commands.sh
Last active Apr 29, 2020 — forked from anniejw6/alias.sh
MFA for the AWS cli
View mfa-commands.sh
#!/usr/bin/env bash
aws-mfa-print-info()
{
echo "We've set your credentials in this shell"
echo "Generated at: '${EPHEMERAL_TOKEN_GENERATED_AT}'"
echo "These credentials are valid for *12 hours*"
unset EPHEMERAL_TOKEN_GENERATED_AT
}
View keybase.md

Keybase proof

I hereby claim:

  • I am pjstein on github.
  • I am pjstein (https://keybase.io/pjstein) on keybase.
  • I have a public key ASB5qGvrz1Y35qNvbLd0FNpYzdO9qs-DZ-syLy3n4vc4Wgo

To claim this, I am signing this object:

@pjstein
pjstein / ad-manifesto.md
Created Oct 30, 2018 — forked from rxwei/ad-manifesto.md
First-Class Automatic Differentiation in Swift: A Manifesto
View ad-manifesto.md

First-Class Automatic Differentiation in Swift: A Manifesto

This document is written for both the machine learning community and the Swift programming language design community, with a strong focus on language design.

Table of Contents

@pjstein
pjstein / umap_sparse.py
Created Aug 22, 2018 — forked from johnhw/umap_sparse.py
1 million prime UMAP layout
View umap_sparse.py
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@pjstein
pjstein / easing.js
Created Feb 21, 2018 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
View easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
View swift-on-nix.bash
#!/bin/bash
set -ev
SWIFT_SNAPSHOT="swift-2.2-SNAPSHOT-2016-01-06-a"
echo "Installing ${SWIFT_SNAPSHOT}..."
curl -s -L -O "https://swift.org/builds/ubuntu1404/${SWIFT_SNAPSHOT}/${SWIFT_SNAPSHOT}-ubuntu14.04.tar.gz"
tar -zxvf "${SWIFT_SNAPSHOT}-ubuntu14.04.tar.gz"
sudo mv "${SWIFT_SNAPSHOT}-ubuntu14.04" /swift
echo "Installing XCTest..."
@pjstein
pjstein / gist:8192813
Last active Jan 1, 2016
The Arguably Definitive History of Pong. This was recovered from some cache somewhere in the digital ether. I need to look over it and dig into the history presented here someday.
View gist:8192813
NB. This was recovered from some cache somewhere in the digital ether. I 
need to look over it and dig into the history presented here someday. -PJ$, 12.30.2013

ORIGINALLY APPEARED IN : The Dartmouth Independent
TITLE                  : The Arguably Definitive History of Pong
AUTHOR                 : Anoop Rathod
PUBLISHED              : Sep 19, 2005

Founded in 1769, Dartmouth College has withstood the travails of history to remain one of this country's finest academic institutions with a strong set of time-honored

@pjstein
pjstein / .gitignore
Last active Jan 1, 2016
my fave .gitignore
View .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
View gist:dae80608e7a732cd63b2

All in all, Jonathan Delano Salinger’s “The Catcher in the Rye” is a volume of enormous import to American literature. Merriam Webster’s Dictionary of English Words defines “catcher” as, “someone or something that catches something,” while it defines “rye” as, “a hardy annual grass that is widely grown for grain and as a cover crop.” But that is not the novel’s only point of contrast! Indeed, “The Catcher and the Rye” is a puzzle — a pile of amorphous cardboard pieces that through determined study you may put together (assuming, of course, there is a way to fit all of the pieces together). But puzzles — like people, like life — are not meant to be solved. They intrigue. They inspire. They are meaningless diversions. “Life is a game, boy,” Spencer says — for games are more fun than puzzles. And were he honest he would add, “Welcome to the games! Be merry, be miserable, take heart or lose it. Get drunk, make mistakes. Work hard, race the rats. Everything and nothing is here for your enjoyment. Everything and no

View comment.py
# NB. This affront to reason mocks our beliefs in everything save chaos and death.
# May whatever you call Holy forgive you, the damned, who read further
# than this point. You have been warned. But if you scorn this warning, if
# your contempt for these my dying words is so complete that you read on,
# if you still believe that there is something good or right or just in this world,
# then I will meet you, smiling, with hot tears in my eyes, when you join me in the
# black and brackish pit, the Hell below Hell, where I now go.