Skip to content

Instantly share code, notes, and snippets.

View Sanae6's full-sized avatar
:shipit:
among us

Aubrey Sanae6

:shipit:
among us
View GitHub Profile
@metaphox
metaphox / DCPU-16Spec.txt
Created October 14, 2012 09:40
DCPU-16 Specification
DCPU-16 Specification
Copyright 1985 Mojang
Version 1.7
=== SUMMARY ====================================================================
* 16 bit words
* 0x10000 words of ram
@lukewestby
lukewestby / findMidiDevices.js
Created October 11, 2015 20:40
Get MIDI input and output devices from the Web MIDI API by name
function findMidiDevices(name) {
return navigator
.requestMIDIAccess()
.then((midiAccess) => {
let input, output;
midiAccess.inputs.forEach((currentInput) => {
if(currentInput.name === name) input = currentInput;
});
midiAccess.outputs.forEach((currentOutput) => {
if(currentOutput.name === name) output = currentOutput;
@XtraCube
XtraCube / C.cs
Last active May 13, 2021 01:17
tiny region API
/*CC0*/using System.Linq;using S=ServerManager;[HarmonyLib.HarmonyPatch(typeof(S),"LoadServers")]class C{static System.Collections.Generic.List<IRegionInfo>R=S.DefaultRegions.ToList();static void Prefix()=>S.DefaultRegions=R.ToArray();public static void A(string N,string I,ushort P)=>R.Add(new DnsRegionInfo(I, N, (StringNames)1003, I, P).Duplicate());}
{
unique_lock lock(mutex); // takes the lock
convar.wait(mutex) // wait
// do stuff with the lock
}
// the lock is no longer held