Skip to content

Instantly share code, notes, and snippets.

@Refsa
Refsa / GrabScreenFeature.cs
Last active February 14, 2025 10:54
Unity URP custom grab pass
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class GrabScreenFeature : ScriptableRendererFeature
{
[System.Serializable]
public class Settings
@Marsgames
Marsgames / 01_DrawableDictionaries.MD
Last active May 10, 2024 00:02
Unity scripts to show dictionaries in the inspector

Dictionaries shown in inspector

Render


  • Put DictionaryDrawer.cs into your Assets/Editor folder

  • Put SerializableDictionary.cs into your Scripts folder

  • Create a custom dictionary

[Serializable] public class CustomDictionary : SerializableDictionary { } 
@darwin
darwin / readme.md
Last active April 9, 2024 22:30
APFS Container cloning/replicating under Catalina (with a bootable system)

Today I wanted to move existing APFS-resident macOS Catalina installation to a new disk. I upgraded my late 2014 Mac Mini with a shiny new 1TB SSD. This took way too many hours of my life I will never get back. Hope this saves some time to you.

Good news:

  1. it is possible to create a DMG image from existing APFS container with macOS Catalina installation including metadata needed for complete restore (the DMG contains OS, OS Data, Preboot, Recovery and VM volumes)
  2. it is possible to restore this DMG image into empty APFS container and get a bootable copy of the original system

This information is relevant for Catalina (I'm currently running macOS 10.15.1).

@roguesleipnir
roguesleipnir / ShaderOccurence.cs
Last active August 2, 2022 11:18
Material/Shader reference searcher. Find materials that use a shader by name string. Find materials with missing shader or errors. Original snippet from https://answers.unity.com/questions/510945/find-materials-that-use-a-certain-shader.html
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
//https://answers.unity.com/questions/510945/find-materials-that-use-a-certain-shader.html
public class ShaderOccurenceWindow : EditorWindow {
[MenuItem ("Tools/Shader Occurence")]
public static void Open () {
@disulfidebond
disulfidebond / create_restore_dmg_macosx.md
Last active January 20, 2025 21:25
Create or Restore Disk Image in Mac OSX

Overview

This gist details how to create or restore a disk image in Mac OSX. There are three methods that are described: Carbon Copy Cloner, Disk Utility, and CommandLine.

  • Disclaimer:
    • I have no financial incentives to https://bombich.com or Apple.
    • Always make a backup of your data, and make 2 separate backups before trying something new.
    • The following steps have been tested and are a summary of my personal recommendations, but should be used at your own risk.
    • If there is a chance of imminent data loss, contact a professional for assistance, and do not rely on a random person from the Internet for help.

Method 1: Carbon Copy Cloner (CCC)

@qzed
qzed / Pipfile
Last active April 23, 2021 16:10
Surface Book 2 / Surface Pro (2017) / Surface Laptop UART protocol proof-of-concept script.
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
crcmod = "*"
pyserial = "*"
[dev-packages]
@distantcam
distantcam / JobHelper.cs
Last active August 17, 2023 15:54
Unity Job system with async
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Unity.Jobs;
public static class JobHelper
{
@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active April 11, 2025 11:03
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
(require 'subr-x)
(require 'projectile)
(defvar ivy--switch-buffer-name-max-length 40)
(defvar ivy--switch-buffer-mode-max-length 18)
(defvar ivy--switch-buffer-project-max-length 15)
(defvar ivy--switch-buffer-delimiter "")
(defun ivy--switch-buffer-pad (str len)
(concat str (make-string (- len (length str)) ? )))
@drewkerrigan
drewkerrigan / README.md
Last active September 21, 2024 19:19
Setting open files limit in OSX 10.11.3

Download this gist, and then run:

chmod 755 open_files_limit_mac.sh
./open_files_limit_mac.sh

Restart the system, and then run: