Skip to content

Instantly share code, notes, and snippets.

/*
A class Keeper keeps a collection of numbers
The collection can be replaced by calling the update method with new numbers.
The method ends by detailing the changes made to the collection. (what remained the same, what was added, what was removed).
Output:
$ g++ --std=c++2a -fconcepts main.cpp && ./a.out
New: 1 2 3 4.2 0
Remaining:
Deleted:
Current: 0 1 2 3 4.2
// This is a firmware for making an arduino pro micro into a switchless rom controller for selecting address pins on
// a 64 kib rom for kernals and a 16 kib rom for charsets in a c64.
// It also does a simple RGB thingy, adjust the ledMin to adjust brightness, depends on your led, resistors and preference for eye-burning.
// I used 5k3 resisters on my RGB led, it's pretty sensitive
const int ledMin=128;
int r=ledMin;
int g=ledMin+21;
// Make a key for matching A to B and B to A.
function getKey(...items) {
return items.sort().join('_');
}
@DusteDdk
DusteDdk / ArduinoProMicroPaddle.ino
Last active March 30, 2021 15:58
Paddle for stella
// For a 1 axis joystick, suitable for use with the Stella Atari 2600 emulator
// Uses the Joystick lib https://github.com/MHeironimus/ArduinoJoystickLibrary/tree/version-2.0
// And the box https://www.thingiverse.com/thing:4223937
// It's a USB modem the first 10 seconds after poweer-up, so you can connect and calibrate it.
// Note: you must set sensitivity and calibrate it after first programming
// Schematic:
// Pin 21 (A3) goes to potmeter center
// VCC goes to other side of potmeter
// GND goes to one side of potmeter
#!/bin/bash
if [ -z "$2" ]
then
echo "Generate script that cuts longvideos into shorter clips."
echo "- Useful for converting old recordings into video-clips."
echo
echo "Usage: $0 CUTS OUTSCRIPT"
echo "CUTS - File describing what to do."
echo "OUTSCRIPT - Name of the script to generate."
# Toy example, ha-proxy reversing traffic to two backend servers based on path
# Has url rewriting and header modification
global
debug # uncomment to enable debug mode for HAProxy
defaults
mode http # enable http mode which gives us layer 7 filtering
timeout connect 5000ms # max time to wait for a connection attempt to a server to succeed
timeout client 50000ms # max inactivity time on the client side
Moved to "OpenScadModels" at http://git.dusted.dk/
Moved to "singles" under http://git.dusted.dk/
@DusteDdk
DusteDdk / sketch.c
Last active June 16, 2018 13:53
Arduino temp/humidity/light logger to sd-card
Moved to "singles" at http://git.dusted.dk/
@DusteDdk
DusteDdk / suboset.js
Last active June 16, 2018 13:54
Node utility for regenerating srts that are cut in parts.
Moved to "singles" at http://git.dusted.dk/