POC decorator for flask fiew functions to inject Cache-Control
headers in a response.
Set up env, for example:
python -m venv venv
. venv/bin/activate
pip install flask
#!/bin/bash | |
# Build tmux session name from current directory | |
SESSION_NAME=$(pwd) | |
# Strip non-alphanumeric characters | |
SESSION_NAME=${SESSION_NAME//[^a-zA-Z0-9]/} | |
# Only keep trailing part | |
SESSION_NAME=Jupyter-${SESSION_NAME: -20} | |
# Command to run inside tmux session |
$ sdiff -t tile0000-remake.tiff.txt tile0000-remake-stitch.tiff.txt | |
Driver: GTiff/GeoTIFF Driver: GTiff/GeoTIFF | |
Files: tile0000-remake.tiff | Files: tile0000-remake-stitch.tiff | |
Size is 1827, 1024 | Size is 1827, 880 | |
Coordinate System is: Coordinate System is: | |
PROJCRS["WGS 84 / UTM zone 31N", PROJCRS["WGS 84 / UTM zone 31N", | |
BASEGEOGCRS["WGS 84", BASEGEOGCRS["WGS 84", | |
DATUM["World Geodetic System 1984", DATUM["World Geodetic System 1984", | |
ELLIPSOID["WGS 84",6378137,298.257223563, ELLIPSOID["WGS 84",6378137,298.257223563, | |
LENGTHUNIT["metre",1]]], LENGTHUNIT["metre",1]]], |
import functools | |
import logging | |
import pyspark | |
from typing import Callable | |
LOG_FORMAT = "[P%(process)s/%(name)s] %(levelname)s: %(message)s" | |
def ensure_executor_logging( | |
f=None, *, |
# Code licensed MIT 2023 Stefaan Lippens | |
import difflib | |
import itertools | |
from typing import List, Tuple, Iterator | |
class Sdiffer: | |
def __init__(self, max_width:int = 80): | |
# Two columns with a gutter |