Skip to content

Instantly share code, notes, and snippets.

@mwegner
mwegner / AppleSiliconCompileFix.cs
Last active January 12, 2022 14:30
Potential fix for Intel Unity Editor crashes on Apple Silicon hardware
/*
If you see Intel Unity Editor crashes on Apple Silicon hardware that look like this:
Thread 0 Crashed:: tid_103 Dispatch queue: com.apple.main-thread
0 ??? 0x7ff894e4a940 ???
1 libsystem_kernel.dylib 0x7ff804893506 __psynch_cvwait + 10
2 libmonobdwgc-2.0.dylib 0x15dbb2aff mono_os_event_wait_multiple + 556
3 libmonobdwgc-2.0.dylib 0x15dbb28cd mono_os_event_wait_one + 38
4 libmonobdwgc-2.0.dylib 0x15dbc35a4 mono_thread_info_wait_one_handle + 13
5 libmonobdwgc-2.0.dylib 0x15dae3298 mono_domain_try_unload + 576
@mwegner
mwegner / presence.php
Last active August 29, 2015 14:20
Ping-Based Device Presence (with Slack webhook)
<?php
// timeout in minutes for phone being considered away
// (iphones only check in sporadically to wifi when running on battery)
// can probably lower this and still avoid false positives...
$minutesAway = 21;
date_default_timezone_set("America/Phoenix");
// store everything in an associative array (hacky and simple)
@mwegner
mwegner / StripGeneratedSolutionSettings.cs
Last active May 9, 2019 23:37
Strip Settings From Unity's Generated .sln Files
/*
v2: Matt Rix pointed out there's an undocumented ONGeneratedCSProjectFiles() callback
https://gist.github.com/MattRix/0bf8de88e16e8b494dbb
v1: Still available in the gist history if you want a FileSystemWatcher solution!
THE PROBLEM:
- Unity constantly rewrites its .sln files whenever you rename/add/remove scripts
@mwegner
mwegner / EditorSceneHelpers.cs
Created October 30, 2014 05:15
Unity Re-Save All Scenes
using System;
using System.IO;
using UnityEngine;
using UnityEditor;
using System.Collections;
public class EditorSceneHelpers
{
[MenuItem("Aztez/Resave All Scenes")]
public static void ResaveScenes()