Skip to content

Instantly share code, notes, and snippets.

View birkin's full-sized avatar

Birkin James Diana birkin

View GitHub Profile
@birkin
birkin / cds_spacy_anything.py
Created November 20, 2025 13:49
cds_spacy_anything
# /// script
# requires-python = "==3.12.*"
# dependencies = [
# "spacy~=3.8.0",
# "en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl"
# ]
# ///
import argparse
from collections import Counter
@birkin
birkin / cds_spacy_example.py
Last active November 20, 2025 12:42
demoing uv remote execution
# /// script
# requires-python = "==3.12.*"
# dependencies = [
# "spacy~=3.8.0",
# "en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl"
# ]
# ///
from collections import Counter
@birkin
birkin / hello_world.py
Created November 20, 2025 11:33
temp-testing
print( 'Hello World' )
@birkin
birkin / load_boatload_via_ajax.html
Last active October 15, 2025 13:52
javascript showing two approaches to loading lots of images -- but only a few at a time
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Thumbnail Loader — Ordered Queue & Viewer-Aware Queue</title>
<style>
:root { --gap: 10px; --bg: #0b1020; --card: #11172a; --ink: #e8ecff; --muted: #a6b0d9; }
html, body { margin:0; padding:0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; }
header { position: sticky; top: 0; z-index: 5; background: linear-gradient(180deg, rgba(11,16,32,.96), rgba(11,16,32,.8)); border-bottom: 1px solid #223; }
@birkin
birkin / calc_collection_size.py
Last active September 8, 2025 02:11
calculates BDR collection size for given collection-pid. (#repository #public-repo-tools)
# /// script
# requires-python = "==3.12.*"
# dependencies = [
# "httpx"
# ]
# ///
"""
Computes total byte-size for a BDR collection and returns the size in both bytes and human-readable form.
@birkin
birkin / ruff.toml
Created September 3, 2025 16:48
ruff.toml template
## settings ##
line-length = 125
indent-width = 4
target-version = "py38"
[format]
docstring-code-format = false
indent-style = "space"
line-ending = "auto"
quote-style = "single"
@birkin
birkin / pyproject.toml
Last active September 25, 2025 12:10
pyproject.toml template (#llm_code_directives)
[project]
name = "bdr-student-uploader-hub-project"
version = "0.0.0"
description = "Allows staff to easily and quickly create and configure webapp-uploader for students."
readme = "https://github.com/Brown-University-Library/bdr_student_uploader_hub_project/blob/main/README.md"
requires-python = ">=3.12,<3.13"
dependencies = [
"beautifulsoup4~=4.13.0",
"Django~=5.2.0",
"httpx~=0.28.0",
@birkin
birkin / RH_server_specs.sh
Last active September 3, 2025 11:35
bash script to print out a bunch of server info.
#!/usr/bin/env bash
# Usage:
# bash ./RH_server_specs.sh | tee "$HOME/rh_server_specs_$(hostname -s)_$(date +%Y%m%dT%H%M%S%z).txt"
set -euo pipefail
section(){ printf '\n==== %s ====\n' "$1"; }
section "OS / KERNEL"
@birkin
birkin / aeon_file_comparison.md
Created August 28, 2025 17:11
aeon file comparison experimentation

Aeon diff: customization likelihood report

This report scores each changed file on the likelihood that differences reflect local customizations (vs vendor upgrade changes).

How to read: higher percentages suggest text that looks Brown/JHL-specific was removed/changed; lower percentages suggest generic Aeon features were added or structural changes came from upstream.


include_footer.html

  • probability_of_customization: 100.0%
@birkin
birkin / warc_gist_experimentation.json
Created August 28, 2025 15:23
warc gist experimentation for tracking downloaded warcs
{
"files": [
{
"seedId": "seed123",
"crawlJobId": "job456",
"crawlTimestamp": "20171003231334202",
"service": "ARCHIVEIT",
"collectionId": 7310,
"filePath": "/pairtree/73/10/warcs/20171003231334202-00000.warc.gz",
"serialNumber": "00000",