Skip to content

Instantly share code, notes, and snippets.

View saghen's full-sized avatar

Liam Dyer saghen

View GitHub Profile
@saghen
saghen / render_deadline_bench.py
Created October 15, 2026 05:05
Truely horrifying, but it works!
#!/usr/bin/env python3
"""Render deadline benchmark for niri: keypress -> scanout and pointer -> scanout latency, deadline off vs on.
Runs on one output (default: the focused one) at one or more refresh rates. A small Wayland probe (compiled from the
C source embedded below on first run, into ~/.cache/niri-render-deadline-bench) injects input through niri's virtual
keyboard/pointer and times when the result reaches the screen (wp_presentation):
- keys: key presses into a focused layer-shell surface that redraws on every key, throttled by frame callbacks like
a terminal. Optionally with background content: another surface on the same output committing at N Hz (+-25%
jitter per frame), not paced by frame callbacks. Reported: median key press -> scanout.
@saghen
saghen / blink-cmp.lua
Created March 31, 2025 13:29
blink.cmp vs nvim-cmp
@saghen
saghen / mongo-ops.ts
Created September 5, 2022 19:03
MongoDB FP-TS Utilities
// WARN: Please note the error types may be incorrect
// WARN: Non-null assertions are used to avoid having to deal with overload typing but lead to unsafe typing
// NOTE: Unfortunately, due to the typing of the client, you must pass the type of the document during the call
// such as `insertOne<YourDocumentType>({ foo: 'bar' })
import { UnknownError } from '@shared/errors'
import { safeTask } from '@utils/fp'
import * as M from 'mongodb'
@saghen
saghen / .zshrc
Last active March 28, 2022 19:28
.zshrc
autoload -Uz compinit
if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then
compinit;
else
compinit -C;
fi;
# User configuration
# Antibody
@saghen
saghen / cloudSettings
Last active July 13, 2020 21:25
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-13T21:21:36.894Z","extensionVersion":"v3.4.3"}
@saghen
saghen / .zshrc
Created August 10, 2019 01:09
Zshrc
autoload -Uz compinit
if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then
compinit;
else
compinit -C;
fi;
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@saghen
saghen / cloudSettings
Last active December 9, 2019 03:11
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-08-11T04:20:38.238Z","extensionVersion":"v3.4.1"}