Skip to content

Instantly share code, notes, and snippets.

View kode54's full-sized avatar

Christopher Snowhill kode54

View GitHub Profile
@kode54
kode54 / hapost.txt
Created September 1, 2022 05:21
Public Hydrogen Audio post
I have been told several times that "what happens on IRC, stays on IRC", and that
sort of attitude is quite annoying to deal with, because then people can be jackasses
on IRC and mostly put on a facade of acceptable behavior on web forums and web sites.
I already left the private alpha foobar2000 chat because Peter thought it was
appropriate to refer to a telemarketer who rang him up at 5:30am as the n-word.
I was contacted by an old acquaintance recently about getting up to speed on foobar2000
components and rejoining the community, and was fed a lengthy diatribe about how great
a developer I am, and how someone of lower stance as him is able to develop an app that
@kode54
kode54 / PVE_manager_nvme.patch
Last active July 21, 2022 05:25
Proxmox Qemu backend support for virtual NVMe drives
diff -u js/pvemanagerlib.js.orig js/pvemanagerlib.js
--- js/pvemanagerlib.js.orig 2022-07-20 21:34:00.523128985 -0700
+++ js/pvemanagerlib.js 2022-07-20 21:38:14.110192280 -0700
@@ -1388,7 +1388,7 @@
toolkit: undefined, // (extjs|touch), set inside Toolkit.js
- bus_match: /^(ide|sata|virtio|scsi)(\d+)$/,
+ bus_match: /^(ide|sata|virtio|scsi|nvme)(\d+)$/,
@kode54
kode54 / luci.upnp
Last active June 13, 2022 12:23
OpenWrt miniupnp rpcd handler, updated for nftables
#!/usr/bin/env lua
local json = require "luci.jsonc"
local UCI = require "luci.model.uci"
local fs = require "nixio.fs"
local sys = require "luci.sys"
local methods = {
get_status = {
call = function()
@kode54
kode54 / r8bbenchdsd.cpp
Created March 5, 2022 03:59
Bit o' R8Brain benchmarking of DSD downsampling
#include <stdint.h>
#include "r8bstate.h"
// In my quick benchmarks on Apple Silicon, this decimator makes the following code about 40% faster
#define DSD_DECIMATOR 1
#ifdef DSD_DECIMATOR
/**
import Cocoa
let encodings = String.availableStringEncodings
print("NSStringEncoding, CFStringEncoding, encodingName, IANAName")
for encoding in encodings {
let encodingName = String.localizedName(of: encoding)
let cfEncoding = CFStringConvertNSStringEncodingToEncoding(encoding.rawValue)
let ianaName = CFStringConvertEncodingToIANACharSetName(cfEncoding) as String? ?? "???"
debugPrint(encoding.rawValue, cfEncoding, encodingName, ianaName, separator: ", ")
}
@kode54
kode54 / malloctest.c
Created February 25, 2022 10:08
Simple memory allocation mess, with a little fragmentation thrown in for fun
#include <stdlib.h>
#include <string.h>
int main(void) {
void ** pointerlist = (void **)calloc(sizeof(void *), 1048576);
for(size_t i = 0; i < 1048576; ++i) {
pointerlist[i] = malloc((rand() & 255) + 1);
}
@kode54
kode54 / channelmaps.cpp
Last active July 15, 2022 06:37
FreeSurround v0.9.0, ported to Apple Accelerate framework
/*
Copyright (C) 2010 Christian Kothe
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@kode54
kode54 / mgba_ffmpeg_fix.sh
Created January 20, 2022 06:14
Fix for a screwup in Homebrew's libraries
#!/bin/sh
FFMPEG_VERSION=4.4.1_5
NETTLE_VERSION=3.7.3
for f in mGBA.app/Contents/Frameworks/*.dylib
do install_name_tool \
-change /opt/homebrew/Cellar/ffmpeg/$FFMPEG_VERSION/lib/libavcodec.58.dylib \
@executable_path/../Frameworks/libavcodec.58.dylib \
-change /opt/homebrew/Cellar/ffmpeg/$FFMPEG_VERSION/lib/libavformat.58.dylib \
@kode54
kode54 / recursive-code-sign.py
Created January 20, 2022 06:13
Recursively code sign on macOS. Useful for signing complex binaries outside of Xcode.
#!/usr/bin/env python2
'''
Code-signs all nested binaries inside an app bundle (excluding the app itself).
'''
import os, sys, re
import subprocess as sp
CODE_SIGN_OPTS = ['--verbose', '--force', '--deep', '--options=runtime', '--sign']
@kode54
kode54 / RetroArch-macOS-cpuopt.patch
Created January 6, 2022 08:55
RetroArch patches, round 1
diff --git a/pkg/apple/BaseConfig.xcconfig b/pkg/apple/BaseConfig.xcconfig
index e5b613a457..2d0890325e 100644
--- a/pkg/apple/BaseConfig.xcconfig
+++ b/pkg/apple/BaseConfig.xcconfig
@@ -5,6 +5,9 @@
//
OTHER_CFLAGS = $(inherited) -DHAVE_RUNAHEAD -DHAVE_GRIFFIN -DHAVE_FLAC -DHAVE_DR_FLAC -DHAVE_DR_MP3 -DHAVE_LROUND -DFLAC__HAS_OGG=0 -DHAVE_CHD -DHAVE_STB_VORBIS -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_ONLINE_UPDATER -DHAVE_LANGEXTRA -DRC_DISABLE_LUA -DHAVE_CHEEVOS -DHAVE_IMAGEVIEWER -DHAVE_IOHIDMANAGER -DHAVE_STB_FONT -DHAVE_RGUI -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_DSP_FILTER -DHAVE_VIDEO_FILTER -DHAVE_REWIND -DHAVE_SCREENSHOTS -DHAVE_CHEATS -DHAVE_GFX_WIDGETS -DOSX -DHAVE_CC_RESAMPLER -DHAVE_GLSL -DINLINE=inline -D__LIBRETRO__ -DHAVE_COREAUDIO -DHAVE_DYNAMIC -DHAVE_OVERLAY -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_NETWORKGAMEPAD -DHAVE_NETWORKING -DHAVE_NETPLAYDISCOVERY -DRARCH_INTERNAL -DHAVE_THREADS -DHAVE_DYLIB -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_MATERIALUI -DHAVE