Skip to content

Instantly share code, notes, and snippets.

@ekollof
ekollof / screen-record.ksh
Last active March 22, 2025 20:11
Record your multihead OpenBSD desktop (probably some assembly required)
#!/bin/ksh
# Help message
usage() {
echo "Usage: $0 [-s screen] [-l] [-h]"
echo " -s screen Select screen number (0, 1, 2, etc.)"
echo " -l List available screens"
echo " -h Show this help message"
exit 1
}
@onehundredfeet
onehundredfeet / HaxeHashlinkM1.md
Last active January 19, 2026 22:09
Developing for Haxe / Hashlink on an M1

Challenge

Getting Haxe, and especially Hashlink, up and running on an Apple M1 is not easy. We'll try to put our heads together and come up with any recipes for success that people have found.

Intel vs Arm with Hashlink

The first thing to note, is that the Hashlink JIT does not work with the M1 (arm) instruction set. To develop with the Hashlink, we end up using a combination of arm64 compiled tools and x86/64 tools libraries.

The M1 Mac's can run x64 (Intel) applications using a technology called 'Rosetta' that translates the x86 code into arm64 code at runtime. We can use this to run Hashlink, with the JIT, effectively. At the moment, there is no known way to run the Hashlink debugger on an M1 Mac.

Using the Command Line

Developing on the M1 will require understanding what architecture your current terminal is set up for.

@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active January 23, 2026 08:14
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
diff --git a/src/Color.cs b/src/Color.cs
index 2499edc..817b67e 100644
--- a/src/Color.cs
+++ b/src/Color.cs
@@ -1392,6 +1392,24 @@ namespace Microsoft.Xna.Framework
private set;
}
+ public static Color CustomRed
+ {
@flibitijibibo
flibitijibibo / wmpcvt.sh
Created April 14, 2019 23:24
Convert WMA/WMV to Vorbis/Theora, useful for XNA Windows games
#!/bin/bash
set -e
find -name "*.wma" -exec bash -c 'ffmpeg -i "{}" -q:a 10 "${0/.wma}.ogg"' {} \;
find -name "*.wmv" -exec bash -c 'ffmpeg -i "{}" -q:v 10 -q:a 10 "${0/.wmv}.ogv"' {} \;
@abcdefg30
abcdefg30 / installation.md
Last active January 20, 2026 18:17
Unofficial, manual content installation for OpenRA

Manual (unrecommended) installation of the required content files for OpenRA

⚠️ This method is not recommended and should only be applied if automatic installation fails. Success of manually installing the files can not be guaranteed. ⚠️

⚠️ The automatic installation may fail for non-english content. OpenRA does not support other languages at the current stage of development and no such content should be installed. ⚠️

⚠️ Manually installing files can corrupt your game and lead to crashes. ⚠️

If you have trouble with automatic installation, please contact the developers (via IRC, our forum, the webpage comments or our issue tracker) before attempting a manual install.

@anpage
anpage / mmlc_extract.py
Last active December 23, 2023 13:31
Mega Man Legacy Collection ROM Extractor
#!/usr/bin/env python
# Program for extracting the NES roms of each game in the Mega Man Legacy
# Collection for PC
# iNES Headers for Mega Man 1-6
HEADERS = [b'\x4E\x45\x53\x1A\x08\x00\x21\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x4E\x45\x53\x1A\x10\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x4E\x45\x53\x1A\x10\x10\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x4E\x45\x53\x1A\x20\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00',
@flibitijibibo
flibitijibibo / stardewFNA.sh
Last active February 27, 2024 04:35
Script for converting Stardew Valley for Windows (XNA) to Linux/macOS-compatible (FNA)
#!/bin/bash
# Stardew Valley XnaToFna Automation Script
# Written by Ethan "flibitijibibo" Lee
#
# Usage: Place in Stardew Valley folder, run from terminal.
# NOTE: Be sure you have Mono 4.4 or newer! Stardew's XML structures need it!
# Be smart. Be safe.
set -e
@jstanley0
jstanley0 / extract_tentacle.rb
Last active June 26, 2025 19:59
Thing that extracts files from Day of the Tentacle: Remastered (`tenta.cle`) and probably similar things
require 'bindata'
require 'pathname'
require 'fileutils'
require 'optparse'
class Header < BinData::Record
endian :little
uint32 :magic
float :version
//gcc osvrexample.c -losvrClientKit
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <osvr/ClientKit/ContextC.h>
#include <osvr/ClientKit/InterfaceC.h>
#include <osvr/ClientKit/InterfaceStateC.h>