Skip to content

Instantly share code, notes, and snippets.

View td0m's full-sized avatar

Dominik Tarnowski td0m

View GitHub Profile
@td0m
td0m / toggle.swift
Created February 13, 2026 12:10
mac toggle grayscale
import Foundation
// Load the private framework
guard let handle = dlopen("/System/Library/PrivateFrameworks/UniversalAccess.framework/UniversalAccess", RTLD_NOW) else {
fatalError("Unable to load UniversalAccess framework")
}
defer {
dlclose(handle)
}
@td0m
td0m / init.lua
Last active February 11, 2026 10:40
mvim - mini neovim config
-- minimal vim
--
-- it's pure vim, with plugins for things that I wish were defaults:
-- - mini.files for an editable :Ex file explorer
-- - quicker for an editable quickfixlist (bonus: prettier)
-- - mini.diff+mini.git for displaying git diff hunks
-- +----------+
-- | PACKAGES |
-- +----------+
@td0m
td0m / clustered.ts
Created April 25, 2025 15:10
NodeJS: Zero Downtime with `node:cluster`
import cluster from "node:cluster";
import { availableParallelism } from "node:os";
export async function clustered({
numWorkers = availableParallelism(),
primary,
worker,
recoverWorkers = true,
shutdownPrimary,
}: {
@td0m
td0m / ask_receiver.ino
Created April 23, 2019 11:20
ELECTRONICS
// ask_receiver.pde
// -*- mode: C++ -*-
#include <RH_ASK.h>
#ifdef RH_HAVE_HARDWARE_SPI
#include <SPI.h> // Not actually used but needed to compile
#endif
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>