Skip to content

Instantly share code, notes, and snippets.

View simonhildebrandt's full-sized avatar
🏠
Working from home

Simon Hildebrandt simonhildebrandt

🏠
Working from home
View GitHub Profile
666
*damn
*dyke
*fuck*
*shit*
@$$
2 girls 1 cup
2g1c
4r5e
5h1t

Developing on an M1 Mac

Lots of our commonly-used OSX development tools have been updated to support Apple's new bespoke silicon, but a few remain incompatible, and it's challenging to work around them individually. In my recent experience several approaches were attempted to work around this - below is the approach we found most consistently successful.

The terminal-based, full emulation approach

Apple provides a tool called Rosetta2 which provides a full emulation layer for any Intel code you might want to run on their new architecture. It's awkward to run each tool we use under emulation individually, though - our approach here is to start our top level process (a terminal app) under emulation, and run all our tools and processes subordinate to that.

  1. Install Rosetta2. softwareupdate --install-rosetta.
  2. Choose / Install a suitable terminal program. OSX comes with the Terminal application - but consider using the much more fully featured `
@simonhildebrandt
simonhildebrandt / gist:a386609dd97209cf7cb019ffc389ae7e
Created August 2, 2016 05:58
Use HammerSpoon to capture screenshots, then ImageMagick to compile
require 'mini_magick'
# HammerSpoon config
# function takeScreenshot(window)
# window:snapshot():saveToFile(os.getenv("HOME") .. "/Desktop/chrome-images/" .. os.time() .. ".png")
# end
#
# local wf=hs.window.filter
# wf_chrome = wf.new{'Google Chrome'}
# wf_chrome:subscribe(wf.windowFocused,takeScreenshot)
@simonhildebrandt
simonhildebrandt / gist:43047fd62efc0f8898fc8fec9d2f18b4
Created August 2, 2016 05:54
Unity - extract plane intersections from mesh polygons
using UnityEngine;
using System.Collections;
public class interspect : MonoBehaviour {
ArrayList edges = new ArrayList();
ArrayList points = new ArrayList();
Plane plane = new Plane(Vector3.up, 0f);
// Use this for initialization