Skip to content

Instantly share code, notes, and snippets.

View dkapitan's full-sized avatar
☸️

Daniel Kapitan dkapitan

☸️
View GitHub Profile
@dkapitan
dkapitan / jortt_report-2026-01-20.html
Created January 20, 2026 15:05
Agent session: jortt_report - <ide_opened_file>The user opened the file /Users/dkapitan/git/dkapitan/jortt-report/pyproject.toml i
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jortt_report - Agent Session</title>
<style>
:root {
--bg: #0d1117;
--surface: #161b22;
@dkapitan
dkapitan / settings.json
Created January 17, 2026 08:12
positron settings
{
"workbench.colorTheme": "Monokai Pro (Filter Spectrum)",
"python.defaultInterpreterPath": "python3",
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"positron.assistant.enable": true,
"claudeCode.preferredLocation": "panel",
"workbench.externalUriOpeners": {
"http://*": "positron.viewer"
}
@dkapitan
dkapitan / justfile
Last active November 23, 2025 16:35
just handy utilities
show-project-size:
uv pip list --format freeze | \
awk -F = {'print $1'} | \
xargs uv pip show | \
grep -E 'Location:|Name:' | \
cut -d ' ' -f 2 | \
paste -d ' ' - - | \
awk '{print $2 "/" tolower($1)}' | \
xargs du -sh 2> /dev/null | \
sort -hr
@dkapitan
dkapitan / get_binary.py
Created September 19, 2025 05:57
Download binary file in memory without saving to disk.
def get_binary(url):
"""Download binary file in memory without saving to disk."""
from io import BytesIO
import requests
try:
response = requests.get(url)
# Raise an exception if the request was unsuccessful (e.g., 404 Not Found)
@dkapitan
dkapitan / install-pygraphviz.sh
Created January 30, 2025 07:02
Install pygraphviz on OSX
python3 -m pip install \
--config-settings="--global-option=build_ext" \
--config-settings="--global-option=-I$(brew --prefix graphviz)/include/" \
--config-settings="--global-option=-L$(brew --prefix graphviz)/lib/" \
pygraphviz
uv_poetry_install () {
uv venv
uv pip install --no-deps -r <(POETRY_WARNINGS_EXPORT=false poetry export --without-hashes --with dev -f requirements.txt)
poetry install --only-root
}
@dkapitan
dkapitan / app.yaml
Created July 3, 2024 19:13
Deploy Shiny for Python on Google App Engine
runtime: python
env: flex
instance_class: F2
runtime_config:
operating_system: "ubuntu22"
runtime_version: "3.12"
# name of app
service: some-name
@dkapitan
dkapitan / sql-workbench.ipynb
Created June 25, 2024 14:34
notebook with duckdb + jupysql + polars
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dkapitan
dkapitan / query_pdok.py
Created June 17, 2024 11:03
Python script for Google Sheets Neptyne plugin to find lat-lon with pdok
import re
import requests
import urllib
PDOK = "https://api.pdok.nl/bzk/locatieserver/search/v3_1/free"
def query_pdok(query):
query_params = {
@dkapitan
dkapitan / redact_patient.py
Created June 14, 2024 19:00
Simple redacting of FHIR patient resource in ndjson
import ndjson
def redact(patient: dict) -> dict:
for key in ["name", "telecom"]:
patient.pop(key, None)
return patient
with open("patient.ndjson") as f: