This is a guide to using pyjwt
to sign and validate a JWT
using
RS256.
The trickiest part of doing this is knowing what the proper OpenSSL commands are to generate the RSA keypair. I demonstrate that below.
#
import urllib3 | |
from urllib3 import HTTPSConnectionPool | |
import certifi | |
import base64 | |
import M2Crypto | |
import hashlib | |
class TestHTTPSConnectionPool(HTTPSConnectionPool): | |
def _validate_conn(self, conn): |
#! /usr/bin/env nix-shell | |
#! nix-shell -i bash -p curl -p xmlstarlet -p imagemagick -p jp2a -p lolcat | |
# | |
# showoff.sh: | |
# Demonstrate the capabilities of Nix by writing a gratuitously complex shell | |
# script that combines 5 different command line utilities together. | |
# | |
# Do the following to run this demo: | |
# If you don't have Nix yet, install it with this command: | |
# $ curl https://nixos.org/nix/install | sh |
I wrote my first literate program in November of 2015. Since then, I've been writing literate programs on an almost daily basis. It has been an experience with a sort of enlightenment that I haven't had in a long time. Not only is it a lot of fun to write literate programs, I feel like I have gained a new "super power" of sorts.
Below are my thoughts on my experiences with literate programming so far.
popHopper = function() | |
return nil | |
end | |
turretPaste = function() | |
next = popHopper() | |
if next == nil then | |
-- this will result in no action after a keypress | |
clip = hs.pasteboard.readString() | |
popHopper = string.gmatch(clip, "[^%s]+") | |
else |
After many years of writing and thinking about developer documentation, I'm convinced that the discipline is still in its infancy. The goal of this document is to summarize my current opinions on the topic of documenting software.
When you ask a software developer what their favorite documentation is, you'll get a wide range of opinions with consensus centering roughly around the Stripe and Twilio documentation, as well as the documentation for open source software like Django, Perl, Flask, etc.
In academia, the uncontested master craftsman of developer documentation is Donald Knuth, who pioneered "Literate Programming"
At the frontier of developer documentation, we find projects like Eve and other projects inspired by Bret Victor's seminal "Inventing on Principle" video.
However, as folks at Dynamicland will often point out, the medium (in the McLuhan sense of the word) of software hasn't changed much since the days when code was written on teletypes: We still write software on fancy typewriters. The
# -*- coding: utf-8 -*- | |
import logging | |
import os | |
import uuid | |
from flask import Flask | |
from flask import redirect | |
from flask import request | |
from flask import url_for | |
from flask.ext.login import LoginManager |
import os | |
from twilio.rest import TwilioRestClient | |
from flask import Flask, request, render_template | |
twilio_account_sid = '' | |
twilio_auth_token = '' | |
twilio_from_number = '' | |
filepicker_api_key = '' | |
app = Flask(__name__) |
echo '' | openssl s_client -connect www.okta.com:443 |