Skip to content

Instantly share code, notes, and snippets.

@steph-ben
steph-ben / git-revgraph
Last active October 12, 2026 10:13
git revgraph: TortoiseGit-like revision graph (git-big-picture + Graphviz)
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = ["git-big-picture==1.3.0", "pygraphviz==2.0.3"]
# ///
"""Revision graph styled like TortoiseGit, drawn by git-big-picture + Graphviz.
Colors and node style are TortoiseGit's defaults, taken from its source
(src/TortoiseProc/Colors.cpp and src/Utils/Graphviz.cpp).
Graphviz comes bundled in the pygraphviz wheel, so it does not need to be
@steph-ben
steph-ben / xgrib.md
Last active December 5, 2023 11:56
Xarray & GRIBs > Performances improvements
@steph-ben
steph-ben / expose_wms.py
Created January 24, 2023 22:36
Expose dataset as WMS
import fsspec
import xarray as xr
import xpublish
from xpublish.routers import base_router, zarr_router
from xpublish_wms import cf_wms_router
fp = "arpege.json"
fs = fsspec.filesystem("reference", fo=str(fp))
m = fs.get_mapper("")
@steph-ben
steph-ben / kerchunker.py
Created January 24, 2023 22:36
Kerchunk remote http url
import shutil
from pathlib import Path
import xarray as xr
import fsspec
import ujson
from kerchunk.grib2 import scan_grib
from kerchunk.combine import MultiZarrToZarr
@steph-ben
steph-ben / sync_m3u.py
Last active September 25, 2018 14:30
Put relative path in mp3u music playlists
#!/usr/bin/env python
"""
Put relative path in mp3u music playlists
"""
import os
import shutil
PLAYLIST_BASE_DIR = '/home/cloud/steph/files/Musique/'
SOURCE_BASEPATH = 'C:\\Bench\\cloud\\Musique\\'