mkdir osm
wget -O osm/planet.mbtiles https://hidrive.ionos.com/api/sharelink/download?id=SYEgScrRe
podman run -ti --rm -p 9000:9000 --name sms -v $(pwd)/osm/:/data/ registry.gitlab.com/markuman/sms:latest
firefox http://localhost:9000
import os | |
import boto3 | |
from fastapi import FastAPI | |
S3_URL = os.getenv("AWS_ENDPOINT_URL_S3") | |
svc = boto3.client('s3', endpoint_url=S3_URL) | |
app = FastAPI() | |
@app.get("/") |
#!/usr/bin/env bash | |
# shellcheck disable=SC2120 | |
# exit on signals: 2, 1, 15 | |
trap 'exit' SIGINT SIGHUP SIGTERM | |
# $USER | |
[[ -n $(logname >/dev/null 2>&1) ]] && logged_in_user=$(logname) || logged_in_user=$(whoami) |
An alternative introduction
There are lots of non-FastHTML-specific tricks and patterns involved in building web apps. The goal of this tutorial is to give an alternate introduction to FastHTML, building out example applications to show common patterns and illustrate some of the ways you can build on top of the FastHTML foundations to create your own custom web apps. A secondary goal is to have this be a useful document to add to the context of an LLM to turn it into a useful FastHTML assistant - in fact, in some of the examples we’ll see this kind of assistant in action, thanks to this custom GPT.
Let’s get started.
#!/usr/bin/env bash | |
# shellcheck disable=SC1091,SC2317 | |
# shift shim behind real binary | |
export PATH="/usr/local/bin/:${PATH}" | |
# env vars | |
git_root="$(git rev-parse --show-toplevel 2>/dev/null)" | |
script_dir=$(dirname "$(readlink -f "$0")") |
# syntax=docker/dockerfile:1.7 | |
FROM ubuntu:20.04 | |
ARG PYTHON_VERSION="3.11" | |
ENV TZ=US/Chicago | |
ARG DEBIAN_FRONTEND=noninteractive | |
RUN <<EOF | |
#!/usr/bin/env bash |
#!/usr/bin/env bash | |
# SOURCE: https://kind.sigs.k8s.io/docs/user/local-registry/ | |
set -o errexit | |
# Global variables | |
reg_name='kind-registry' | |
reg_port='5001' | |
REGISTRY_DIR="/etc/containerd/certs.d/localhost:${reg_port}" |
Bespoke askpass script for macOS.
Moved to a proper repo as gists are pretty limited for organization.
Simplest way to use Playwright sharing the "state" among tests.
The first test won't have the storage file so it will get a new empty page with no context and set it up / login.
Further tests will get a Page instance injected that has the same context as the first one, reusing the signed-in state.
Check https://playwright.dev/python/docs/auth#reusing-signed-in-state
# https://github.com/lima-vm/lima/blob/master/examples/docker-rootful.yaml | |
--- | |
images: | |
# Hint: run `limactl prune` to invalidate the "current" cache | |
- location: "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2" | |
arch: "x86_64" | |
digest: "sha256:ac58f3c35b73272d5986fa6d3bc44fd246b45df4c334e99a07b3bbd00684adee" | |
- location: "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/aarch64/images/Fedora-Cloud-Base-Generic.aarch64-40-1.14.qcow2" | |
arch: "aarch64" | |
digest: "sha256:ebdce26d861a9d15072affe1919ed753ec7015bd97b3a7d0d0df6a10834f7459" |