This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make a key for matching A to B and B to A. | |
function getKey(...items) { | |
return items.sort().join('_'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to "OpenScadModels" at http://git.dusted.dk/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to "singles" under http://git.dusted.dk/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to "singles" at http://git.dusted.dk/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to "singles" at http://git.dusted.dk/ |