Skip to content

Instantly share code, notes, and snippets.

@heidekrueger
heidekrueger / gist:2307b94e434febc97c101df91bad6320
Created August 12, 2026 11:04
sfw wrapper for uv run -- send dependency resolution through the sfw firewall, but not the actual command (child process)
# uv() — sfw wrapper. Goal: dependency resolution (sync/add/pip/tool/...)
# runs inside sfw; the program launched by `uv run` runs OUTSIDE sfw.
# (aliasing `uv` to `sfw uv` breaks networking of inner command in `uv run inner_command`)
# sfw filters the whole process tree, so we split `uv run X` into:
# sfw uv sync <env-flags> (network, filtered)
# uv run --no-sync ... X (exec, unfiltered)
# Debug: `type uv`, `command uv ...` to bypass, UV_SFW_TRACE=1 to print cmds.
uv() {
_uv_exec() {
[[ -n "$UV_SFW_TRACE" ]] && printf 'uv-wrapper> %q ' "$@" >&2 && echo >&2
@heidekrueger
heidekrueger / script.R
Last active November 6, 2020 11:32
R Code to generate plot for uncalled races (as of 4pm EST on Thursday)
# Based on snippet by @charlie7whiskey https://gist.github.com/cgrilson7/86737d3b07c2a0806f8aaeaaedf2fd7c
# Via unofficial NYT api at https://github.com/alex/nyt-2020-election-scraper
#updated 11/6 after api change
library(tidyverse)
library(rvest)
library(lubridate)
url <- "https://alex.github.io/nyt-2020-election-scraper/battleground-state-changes.html"
0x1bFf4fFC1817afB746A5526F1482A53bb5081a51