Skip to content

Instantly share code, notes, and snippets.

View neuhaus's full-sized avatar

S. Neuhaus neuhaus

View GitHub Profile
# Dwarf Fortress Premium on Mac (Apple Silicon) — Full Setup Guide
**Tested on:** MacBook Pro M1 Pro, macOS Tahoe 26.3, GPTK 3.0
**Last updated:** March 2026
**Result:** Full game with audio, world generation, and gameplay working
The Steam Premium version of Dwarf Fortress has no native Mac build and the devs have cancelled macOS plans. This guide gets it running on Apple Silicon Macs using Apple's Game Porting Toolkit (GPTK) — no CrossOver, no Whisky (discontinued), no paid software needed.
---
@neuhaus
neuhaus / othello.svg
Created January 10, 2026 10:40
othello board
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@neuhaus
neuhaus / drumpf.js
Created January 3, 2026 11:37
User script for Violentmonkey / Tampermonkey / Greasemonkey to replace text
// ==UserScript==(
// @name Drumpf III
// @match *://*/*
// @grant none
// @run-at document-end
// @version 2.0
// @description Makes you feel better by replacing 'Trump' with 'Drumpf' (asynchronously for no slowdown).
// ==/UserScript==
(() => {
@neuhaus
neuhaus / lightdark.html
Last active October 7, 2025 13:34
CSS: Minimal example using different colours for a button, depending on the light / dark theme of the OS. No Javascript.
<!DOCTYPE html>
<head>
<title>Button with light/dark complementary colours</title>
<style>
html {
color-scheme: light dark;
}
:root {
--button-base-hue: 210; /* blue */
@neuhaus
neuhaus / ollama-nogpu.sh
Last active May 2, 2025 12:29
Restart ollama docker container if it no longer detects the nvidia GPU
#!/bin/sh
# restart ollama docker container if GPU is no longer recognized.
# call this script once per minute with cron.
if docker logs --since 63s ollama 2>&1 | grep -q "ggml_cuda_init: failed to initialize CUDA: no CUDA-capable device is detected"; then
docker restart ollama
fi
@neuhaus
neuhaus / ionos_bind_export.sh
Last active August 29, 2025 17:36
retrieve all domain zones from IONOS using the API and convert them into bind zone files.
#!/bin/bash
# Check if API key is provided
if [ -z "$IONOS_API_KEY" ]; then
echo "Error: IONOS_API_KEY environment variable must be set"
exit 1
fi
# Base API URL
API_BASE="https://api.hosting.ionos.com/dns/v1"
# @OneLogicalMyth
function New-cPassword($unencryptedString) {
# encrypt string to known AES key used by cPassword
$AesObject = New-Object System.Security.Cryptography.AesCryptoServiceProvider
$AesObject.Mode = [System.Security.Cryptography.CipherMode]::CBC
$AesObject.IV = New-Object Byte[]($AesObject.IV.Length)
$AesObject.KeySize = 256
$AesObject.Key = @(0x4e,0x99,0x06,0xe8,0xfc,0xb6,0x6c,0xc9,0xfa,0xf4,0x93,0x10,0x62,0x0f,0xfe,0xe8,
0xf4,0x96,0xe8,0x06,0xcc,0x05,0x79,0x90,0x20,0x9b,0x09,0xa4,0x33,0xb6,0x6c,0x1b)
$encryptor = $AesObject.CreateEncryptor()
@neuhaus
neuhaus / sign-offline.js
Last active July 15, 2024 01:49
Ethereum: Sign an offline transaction with Node and web3
#!/usr/bin/env node
'use strict';
// ethereum: generate signed transactions
const fs = require('fs-extra');
const rls = require('readline-sync');
const Accounts = require('web3-eth-accounts');
const web3utils = require('web3-utils');
const accounts = new Accounts();