Skip to content

Instantly share code, notes, and snippets.


Michael Stevenson mstevenson

View GitHub Profile
openfirmware /
Created Nov 7, 2018
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).

Kink3d / MainLightNode.cs
Created May 8, 2018
A custom lighting node example for Shader Graph and Lightweight Render Pipeline
View MainLightNode.cs
using UnityEngine;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph
[Title("Input", "Lighting", "Main Light")]
public class MainLightNode : AbstractMaterialNode, IGeneratesBodyCode
public MainLightNode()
Kink3d / UI-DitheredClip.shader
Created Feb 18, 2018
An alpha clip version on Unity's default UI shader with a dithered variant
View UI-DitheredClip.shader
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "UI/DitheredClip"
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
View gist:6237f80df9a4bccf98be298057a82cf2
# QEmu
brew install qemu
# Home for out tests
mkdir ~/arm-emu
cd ~/arm-emu
# Download initrd and kernel
nobnak / UVWorld.cs
Last active Aug 3, 2020
UV -> World Position (For Unity)
View UVWorld.cs
public class UVWorld : MonoBehaviour {
Mesh _mesh;
Vector3[] _vertices;
int[] _triangles;
Vector2[] _uvs;
Vector3[] _normals;
Triangle2D[] _uvTris;
void Awake() {
_mesh = GetComponent<MeshFilter>().sharedMesh;
stramit / SpecialEventClass.cs
Last active Nov 21, 2018
View SpecialEventClass.cs
* 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?
stramit / CustomEvents.cs
Created Sep 4, 2014
Sending Custom Events via the EvenSystem
View CustomEvents.cs
using System;
using System.Collections.Generic;
using UnityEngine.Events;
// interface you implement in your MB to receive events
public interface ICustomHandler : IEventSystemHandler
void OnCustomCode(CustomEventData eventData);
neon-izm / GameWindowMover.cs
Created Aug 13, 2014
unity editor script: UnityEditor GameView automatically move to "Rift DK2 Extend Display"
View GameWindowMover.cs
using UnityEngine;
using UnityEditor;
//Version 0.21 | twitter:@izm update for DK2
//Version 0.2 | s.b.Newsom Edition
//Source from
//Modified by seieibob for use at the Virtual Environment and Multimodal Interaction Lab at the University of Maine.
//Use however you'd like!
lexrus /
Created Aug 1, 2014
Disable all animations of OS X.
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
defaults write -g NSWindowResizeTime -float 0.001
View DataBuffer.swift
class DataBuffer {
var internalData: NSData;
init(fromData: NSData) {
self.internalData = NSData.dataWithData(fromData) as NSData;
init(fromFilePath: String) {
self.internalData = NSData.dataWithContentsOfFile(fromFilePath, options: .DataReadingMappedIfSafe, error: nil) as NSData;