Skip to content

Instantly share code, notes, and snippets.

View r-k-b's full-sized avatar

Robert K. Bell r-k-b

View GitHub Profile
@r-k-b
r-k-b / nix-file-store-LRU-cache.nu
Created October 17, 2025 07:08
a 1-line DIY "LRU cache" GC for nix flat-file build caches
# in the same dir that `nix copy --all --to file:///mnt/foo/bar` targets:
ls -la | sort-by accessed | where accessed < ((date now) - 1wk) | each { |nar| let xz = open $nar.name | parse "{key}: {value}" | where key == "URL" | get value.0; print $"($nar.accessed) .. ($nar.name) -- ($xz) ;" rm $nar.name; try { rm $xz } catch { |e| print $">>> delete xz failed: ($e | to nuon)" } }
@r-k-b
r-k-b / azure_devops_improvements.css
Last active July 31, 2025 00:00
userstyle for making Azure Devops less unbearable
/* from https://gist.github.com/r-k-b/4475e7f0c6d3f27bebae2e3a47afab38 */
/* make checkboxes easier to see */
input[type="checkbox"]:disabled {
filter: invert(100%) hue-rotate(18deg) brightness(5);
}
/* make attachment links discoverable by Vimium */
.work-item-attachments-grid .bolt-table-row .attachment-more-button {
visibility: visible
@r-k-b
r-k-b / run-pty.hippo.json
Last active May 27, 2023 00:58
Spin up helpful dev tools for the Hippo project with `run-pty`.
[
{
"title": "elm-review",
"command": [
"elm-review",
"--watch"
],
"defaultStatus": [
"⏳",
"S"
@r-k-b
r-k-b / workaround wonky mic balance.md
Last active September 30, 2024 23:22
Change a video from unbalanced stereo to mono

in case you have a wonky mic where the left channel sounds much louder than the right; here's an ffmpeg command to keep only the left channel in a video file, converting it from stereo to mono:

ffmpeg -i in.mp4 -af "pan=mono| c0=FL" -c:v copy out.mp4

alternatively, EasyEffects makes it simple to set up the stereo→mono mix once, then have it applied on every boot: https://github.com/wwmm/easyeffects (has nifty effects, too)

@r-k-b
r-k-b / _INFO.md
Last active May 19, 2022 07:28
NixOS flakes and private repos in Azure DevOps / VSTS / visualstudio.com

Examples of working Flake urls to private AzOps repos:

nix run 'git+https://pacifichealthdynamics.visualstudio.com/PHDSys/_git/PHDSys-net?ref=integration&rev=43fb2415eac77af745ef481de769327d95c69fe5#hippoApiRT'
nix run 'git+ssh://[email protected]/v3/pacifichealthdynamics/PHDSys/PHDSys-net?ref=integration&rev=43fb2415eac77af745ef481de769327d95c69fe5#hippoApiRT'
@r-k-b
r-k-b / get-thread-dump.md
Created October 27, 2021 23:15
take a thread dump from a docker container running a mono process

take a thread dump from a docker container running a mono process

...when the container has no shell, so docker exec -it won't work.

steps

identify the Container ID of the problematic container

$ docker stats
@r-k-b
r-k-b / highlight_cypress_handle.css
Last active September 12, 2023 23:33
highlight source hints
/* https://gist.github.com/r-k-b/0879c379ae1acd0440f88cd4f9a6c2c5 */
[data-cy] {
position: relative;
z-index: 1;
}
[data-cy]::before {
/*content: attr(data-cy);*/
content: "cy";
position: absolute;
z-index: 2;
@r-k-b
r-k-b / _use nixpkgs cypress binary before npms broken copy.md
Last active September 3, 2024 10:14
how to use NixOS's Cypress instead of npm's Cypress

Should help with avoiding errors like:

No version of Cypress is installed in: /home/rkb/.cache/Cypress/6.2.1/Cypress

Please reinstall Cypress by running: cypress install

----------

Cypress executable not found at: /home/rkb/.cache/Cypress/6.2.1/Cypress/Cypress
# quick way to see if the given local branch has already been merged (or
# rebased) into the "main" branch
#
# Usage:
#    isMerged branch-i-want-to-check
#
# Defaults to the current branch if none is specified.
@r-k-b
r-k-b / robotics bench.dot
Created November 25, 2020 08:48
kenshi stuff
digraph G {
steel -> muscle [label=2]
press -> muscle [label=1]
iron -> hinge [label=0.5]
iron -> press [label=2]
iron -> motor [label=1]
elec_components -> motor [label=1]
steel -> repairkit [label=1]
robo_components -> repairkit [label=0.5]
muscle -> robo_components [label=1]