Skip to content

Instantly share code, notes, and snippets.

import jwt
jwt_data = jwt.decode(some_data, secret)
form = Form(.... hidden=dict(mydata=jwt_data))
if form.accepted:
some_data = jwt.decode(request.forms['mydata'], secret)
...
@mdipierro
mdipierro / example.py
Created January 23, 2024 06:54
Python script that makes its own nix-shell
#! /usr/bin/bash
"""":
# if Nix not installed, install it, then rerun this script with nix-shell
[ -f /etc/nix/nix.conf ] || curl -L https://nixos.org/nix/install | sh -s -- --daemon
exec nix-shell --command "python $0 $@" \
-p python311 \
-p python3Packages.numpy
# add any package you want above and they will be added to the shell
exit 1
""" #"