Skip to content

Instantly share code, notes, and snippets.

View td0m's full-sized avatar

Dominik Tarnowski td0m

View GitHub Profile
@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>