Skip to content

Instantly share code, notes, and snippets.

@Spongman
Spongman / ssp2.asm
Last active April 11, 2024 22:42
Mysterious Program in EPROM of Synertek SYM-1 Owned by Composer Richard Teitelbaum
{
via3.DDRA = 1;
via3.DDRB = 0xff; // output
via3.PCR = 1; // CA1: Independent interrupt input-negative edge
via2.DDRA = 0; // input
via2.DDRB = 0xff; // output
via2.PCR = 0x88; // CA & CB: Handshake output, negative active edge
bool moreBits = true;
@Spongman
Spongman / www.cpp
Last active February 23, 2024 05:48
simple c++ web server with multi-threading, async i/o and keep-alives.
#include <boost/beast.hpp>
#include <boost/asio.hpp>
namespace ip = boost::asio::ip;
namespace http = boost::beast::http;
int main() {
boost::asio::thread_pool ioc;
ip::tcp::acceptor acceptor{ioc, ip::tcp::endpoint{ip::address::from_string("127.0.0.1"), 9999}};
while(true) {
ip::tcp::socket socket{ioc};
acceptor.accept(socket);
/// This is an automatic generated amalgamation of:
/// continuable version 4.0.0 (735697026b72a8f415d3443834cceeda9623780d)
/*
/~` _ _ _|_. _ _ |_ | _
\_,(_)| | | || ||_|(_||_)|(/_
https://github.com/Naios/continuable
v4.2.0
/// This is an automatic generated amalgamation of:
/// continuable version 4.0.0 (735697026b72a8f415d3443834cceeda9623780d)
/*
/~` _ _ _|_. _ _ |_ | _
\_,(_)| | | || ||_|(_||_)|(/_
https://github.com/Naios/continuable
v4.1.0
/// This is an automatic generated amalgamation of:
/// continuable version 4.0.0 (735697026b72a8f415d3443834cceeda9623780d)
/*
/~` _ _ _|_. _ _ |_ | _
\_,(_)| | | || ||_|(_||_)|(/_
https://github.com/Naios/continuable
v4.2.0
@Spongman
Spongman / wsl1-reset.ps1
Created February 11, 2021 02:18
reset WSL2 NIC
# the NAME of the WSL distro: `wsl.exe -l -v`
$distro = "centos7"
# the NAME of the Windows Network Interface: `powershell.exe Get-NetAdapter`
$iface = "LAN"
# static IP address for wsl interface
$address = "192.168.1.3/24"
$gateway = "192.168.1.1"
@Spongman
Spongman / clearcrl.bat
Created June 22, 2019 00:28
clear local IIS Certificate Revocation List
iisreset /stop /timeout:0
net stop w3svc /y
net stop http /y
net stop CertPropSvc /y
certutil -setreg chain\ChainCacheResyncFiletime @now
certutil -urlcache * delete
del /q /f /s /a:h C:\Windows\System32\config\systemprofile\AppData\LocalLow\Microsoft\CryptnetUrlCache\*
@Spongman
Spongman / OpenSimplexNoise.js
Last active May 23, 2022 09:35
OpenSimplex Noise Refactored for javascript (from https://gist.github.com/digitalshadow/134a3a02b67cecd72181)
"use strict";
const STRETCH_2D = (1 / Math.sqrt(2 + 1) - 1) / 2;
const STRETCH_3D = (1 / Math.sqrt(3 + 1) - 1) / 3;
const STRETCH_4D = (1 / Math.sqrt(4 + 1) - 1) / 4;
const SQUISH_2D = (Math.sqrt(2 + 1) - 1) / 2;
const SQUISH_3D = (Math.sqrt(3 + 1) - 1) / 3;
const SQUISH_4D = (Math.sqrt(4 + 1) - 1) / 4;
const NORM_2D = 1 / 47;
const NORM_3D = 1 / 103;
@Spongman
Spongman / nature-of-code.txt
Last active October 12, 2018 19:02
nature-of-code
Welcome
Hello! By browsing the table of contents on your left, you can read the entire text of this book online for free, licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
Start reading the introduction now!
If you like this book, please consider supporting it via the links below:
window.fr = function(o) {
var m = new Map();
var rg = [{ pn: 'window', v: window, l: 0 }];
function add(pc) {
var p = pc.v;
var l = pc.l + 1;
for (var pn of Object.getOwnPropertyNames(p)) {
try {
var pd = Object.getOwnPropertyDescriptor(p, pn);
//if (pd.get) continue;