Skip to content

Instantly share code, notes, and snippets.

View mstevenson's full-sized avatar

Michael Stevenson mstevenson

View GitHub Profile
@jackoalan
jackoalan / cwfilt.py
Last active July 28, 2023 00:34
CodeWarrior C++ Symbol Demangler
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def demangleNode(node):
pointer = False
ref = False
const = False
unsigned = False
@stramit
stramit / SpecialEventClass.cs
Last active November 21, 2018 06:36
SpecialEventClass
/*
* When developing the UI system we came across a bunch of things we were not happy
* with with regards to how certain events and calls could be sent in a loosely coupled
* way. We had this requirement because with a UI you tend to implement widgets that receive
* certain events, but you don't really want to have lots of glue code to manage them
* and keep track of them. The eventing interfaces we developed helped with this. One of
* the interesting things, is that they are not justfor the UI system! You can use this as
* a type-safe, fast, and simple alternative to SendMessage (never use SendMessage!).
* So how does it all work?
@nobnak
nobnak / UVWorld.cs
Last active August 17, 2023 08:40
UV -> World Position (For Unity)
public class UVWorld : MonoBehaviour {
Mesh _mesh;
Vector3[] _vertices;
int[] _triangles;
Vector2[] _uvs;
Vector3[] _normals;
Triangle2D[] _uvTris;
void Awake() {
_mesh = GetComponent<MeshFilter>().sharedMesh;
@marrub--
marrub-- / MarathonData.md
Last active November 26, 2023 04:33
Marathon + Aleph One Format and Data Documentation (WIP)

Current Version

The current version of this document resides at https://git.greyserv.net/marrub/Maraiah/src/branch/master/doc/data, and contains public domain source code for loading Marathon formats in the Rust programming language.

LICENSING

To the extent possible under law, I, Alison Sanderson, have waived all copyright and related or neighboring rights to this Document as described by the Creative Commons Zero license linked below.

# QEmu
brew install qemu
# Home for out tests
mkdir ~/arm-emu
cd ~/arm-emu
# Download initrd and kernel
wget http://ftp.de.debian.org/debian/dists/jessie/main/installer-armel/current/images/versatile/netboot/initrd.gz
@fzwo
fzwo / LegacyDocsets.md
Last active May 15, 2024 10:16
Download and view old Apple developer documentation

How to download and view legacy documentation from Apple (no need to sign in to your dev account)

  1. Download the docset index XML.
  2. Find the docset you want (there are some with URL https://apple.com/none.dmg; ignore them - you will find them again further down the file with a working URL).
  3. Download the dmg. It's probably around a gigabyte or so.
  4. "Install" the .pkg file somewhere on your disk. If you don't trust the installer, do it manually:
    1. Find the largest file, named Payload, and extract it using The Unarchiver.
    2. This creates a new, even larger file, probably named Payload-1.
    3. Extract Payload-1 using The Unarchiver.
  5. After many minutes of extracting, we have our .docset file.
@pmeulen
pmeulen / repair-timemachine-disk-network.sh
Created September 22, 2017 17:58
Script to repair a Time Machine network volume
#!/bin/bash
set -e
###############################################################################
# This script tries to repair a Time Machine *network* backup (i.e. an APF
# share containing a sparsebundle) that is shared over a network using e.g. an
# Apple TimeCapsule, a NAS, Raspberry PI, ...
# The script must be run on the computer that created the backup
#
@Kink3d
Kink3d / UI-DitheredClip.shader
Created February 18, 2018 11:08
An alpha clip version on Unity's default UI shader with a dithered variant
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "UI/DitheredClip"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
@Kink3d
Kink3d / MainLightNode.cs
Created May 8, 2018 00:13
A custom lighting node example for Shader Graph and Lightweight Render Pipeline
using UnityEngine;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph
{
[Title("Input", "Lighting", "Main Light")]
public class MainLightNode : AbstractMaterialNode, IGeneratesBodyCode
{
public MainLightNode()
{
@openfirmware
openfirmware / instructions.md
Created November 7, 2018 06:07
QEMU with Mac OS 9 guest *and working audio*

QEMU Mac OS 9 Instructions

Here is a short guide on how to build QEMU to run Mac OS 9 with working audio. These instructions work for MacOS High Sierra as the host OS, although with some tweaking they may run under Linux/Windows. You should be comfortable compiling software from source before attempting.

Clone QEMU fork

Adapted from instructions from Cat_7

You may need to install XCode and/or the XCode command line tools. If you do not have them, then this process may prompt you to install them (MacOS will do that).