Skip to content

Instantly share code, notes, and snippets.

View Xaymar's full-sized avatar
🌍
I may be slow to respond.

Xaymar Xaymar

🌍
I may be slow to respond.
View GitHub Profile
@Xaymar
Xaymar / Numark Mixtrack Platinum FX.md
Last active September 18, 2025 15:23
A full description of the MIDI inputs and outputs of the Numark Mixtrack Platinum FX, because Numark hasn't provided one. This much used to be the default back when I was a child...

Numark MixTrack Platinum FX

  • Remember, MIDI channels start at 1 - Channel 16 is actually 0x?F, Channel 1 ix 0x?0.

Input Mappings

Mixer

Channel Controller / Note Note (Decimal) Value / Velocity Type Description Note
15 Control Change 35 0 - 127 Rotary Fader Master Volume
16 Control Change 0 1, 127 Encoder Browse 127 is CCW (Up), 1 is CW (Down)
@Xaymar
Xaymar / 1-Metatables.md
Last active February 24, 2025 12:55
Lua Metatables

Lua Metatables

Lua is one of the many languages that fully assumes a Basic-like structure and avoids Object Oriented Programming entirely by default for simplicity. Instead it has an optional MetaTable implementation available to any object type which can imitate the behavior. Metatables allow us to "override" certain behavior in a similar way to OOP languages, and even enable Class Inheritance and more.

The manual has a full overview of the default behavior. §2.4

Assigning & Removing Metatables

To assign a metatable to an object you must set its __metatable key using either setmetatable(table, metatable) or rawset(table, "__metatable", metatable). You can retrieve the current metatable at any point using getmetatable or rawget(table or {}, "__metatable"). The native functions should be preferred as they may do additional work unique to that implementation of Lua.

Entries

Info / Meta

@Xaymar
Xaymar / 0 Index.md
Last active February 10, 2025 01:43
A description of libOBS behavior for plugin or software authors
@Xaymar
Xaymar / README.md
Last active December 28, 2024 21:37
Windows TCP Optimization for Content Creators

Windows TCP Optimizations

As with everything Microsoft does, the Windows TCP stack is not optimized for modern systems. It is full of ancient ways designed for low bandwidth high latency connections and we need to change some values if we want to take advantage of the modern gigabit connections. Especially Content Creators with live streams using RTMP/S will benefit massively from this.

Note that once these have been applied, you need to restart your system entirely. You can either shut down your machine and cold start it, or do a full restart from window. A soft restart when Fast Boot is enabled will not work.

Registry Modifications

The TCP Service: HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

This is the real TCP-over-IP service, where we'll enable some additional features that for some reason aren't enabled by default.

Tcp1323Opts, DWORD

@Xaymar
Xaymar / 1. PWSZ Container.md
Last active November 10, 2024 21:13
Anycubic PWSZ File Format Explained

PWSZ Container

The PWSZ container is a standard sequential Zip file containing several other files describing the actual print process.

Notables

  • Zip32, all sizes are 4 byte.
  • DEFLATE compressed.
  • Date & Time is always left as 0x00 0x00
  • General Purpose flags are always 0x08 0x08.
    • Bit 3: We don't know the CRC-32 or File Sizes at this time, and they've been appended to the compressed data. Seek to the next Zip header, go back 12 bytes, and read the CRC-32, Compressed Size, and Uncompressed Size from there.
  • Unclear why Bit 11 is set, doesn't appear to be standard.
@Xaymar
Xaymar / crystaldiskmark.fio
Created August 25, 2024 11:14
fio script for CrystalDiskMark-like results
# Mimics CrystalDiskMark on Windows. Quite close, but not always identical - Linux seems to always be a tad faster.
# If used for direct device testing, add `--direct=1` to your command line. Note that Windows does not have an equivalent for this.
[global]
size=16GB
ioengine=libaio
time_based=1
runtime=5
loops=5
@Xaymar
Xaymar / gist.lua
Last active February 13, 2025 03:32
ComputerCraft: Download Gists
-- Installation:
-- pastebin get rLAZsh4n gist
-- gist
-- Updating (after installing as gist)
-- gist update
--
-- Usage:
-- gist get <id> [<path>] [<remote_file>:[<local_file>] [<remote_file>:[<local_file>]] ...]
--
-- Examples:
@Xaymar
Xaymar / cexcavate.lua
Last active July 15, 2024 20:26
Excavation script for ComputerCraft: Tweaked
-- Excavate script for ComputerCraft: Tweaked
--
-- Features:
-- - Theorethical support for Sand, Gravel and similar.
-- - Optimized mining algorithm, digs 3 layers at per cycle.
-- - Always returns to a safe spot on exceptions.
-- - Optionally provides a log file for debugging called "cexcavate.log". This can crash the script
--
-- Supports mods:
-- - TreeChop
@Xaymar
Xaymar / Game.md
Last active June 2, 2024 06:18
Dungeon & Dragons Online Protocols

Game Protocol

  • UDP-based, unlike other games of similar age.
  • UDP suggests that every zone has its own Server.
  • Game connects to an entirely different port than is listed anywhere.
  • Lack of packet size consistency suggests compression is in use.
    • Age shrinks pool of available compression methods significantly.
    • No consistent header for any packets.
  • Game opens two connections:
    • Chat Server
    • Game Server
@Xaymar
Xaymar / arrayShallowClone.mjs
Last active May 16, 2024 08:48
Benchmark any JavaScript function using any Browser or Node.JS. No need for jsperf or jsbench!
// Copyright <2024> Michael Fabian 'Xaymar' Dirks <info-at-xaymar-dot-com>
// Licensed under 3-Clause BSD License: https://opensource.org/license/bsd-3-clause
import { benchTime } from './benchTime.mjs';
// Example Usage
function spread(arr) { return [...arr]; }
function spreadNew(arr) { return new Array(...arr); }
function arraySlice(arr) { return arr.slice(); }
function arraySlice0(arr) { return arr.slice(0); }