Skip to content

Instantly share code, notes, and snippets.

View jeremedia's full-sized avatar

Jeremy Roush jeremedia

View GitHub Profile
@dpid
dpid / how-to-notarize-unity-for-macos.md
Last active May 8, 2025 16:14
How to notarize a Unity build for MacOs 10.15 Catalina

How to notarize a Unity build for macOs 10.15 Catalina

As of January 2020, all apps running on macOs 10.15 Catalina are required to be notarized. For Unity games distributed outside the Mac App Store, such as with Steam, the notarization process is done post build using a series of Xcode command line tools.

Prerequisites

  • a Mac that is compatible with macOs 10.15 Catalina :
    • MacBook (2015 or newer)
    • MacBook Air (2012 or newer)
  • MacBook Pro (2012 or newer)

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@mael
mael / tricks.md
Last active July 16, 2024 11:44
Xcode 10.2 "Unable to boot the Simulator"

Solution "Unable to boot the Simulator"

sudo mkdir /private/tmp

sudo chmod 1777 /private/tmp

Other basic command

xcrun

xcrun simctl list devices //to list all simulators

xcrun simctl delete // to delete specific device

@Biodam
Biodam / GameViewUtils.cs
Last active March 22, 2023 12:10
Bulk add game view resolutions and quick select custom resolutions with hotkeys. Download the file and add it to a Editor folder inside of your Assets.
using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using UnityEditorInternal;
/// <summary>
/// Class to manipulate the gameview sizes.
/// Based on: https://answers.unity.com/questions/956123/add-and-select-game-view-resolution.html
@karljj1
karljj1 / Unity Assembly Definition Debugger.cs
Last active April 2, 2025 23:06
Find out what assemblies are being built and how long each takes.
using System;
using System.Collections.Generic;
using System.Text;
using UnityEditor;
using UnityEditor.Compilation;
using UnityEngine;
[InitializeOnLoad]
public class AsmdefDebug
{
@ditzel
ditzel / KdTree.cs
Last active March 11, 2025 12:50
k-d Tree
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
public class KdTree<T> : IEnumerable<T>, IEnumerable where T : Component
{
protected KdNode _root;
protected KdNode _last;
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active May 6, 2025 08:56
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@masklinn
masklinn / cheatsheet.md
Last active April 17, 2025 02:20
launchctl/launchd cheat sheet

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,

@soraphis
soraphis / RectExtensions.cs
Last active October 30, 2017 08:44
Unity3D c# extension class for Rect objects. useful for developing editor addons
using UnityEngine;
namespace Assets.Soraphis.Lib {
public static class RectExtensions {
/// <summary>
/// Splits a Rect in vertical ordered, even, pieces and returns the piece at the given index
/// </summary>
public static Rect SplitRectV(this Rect rect, int many, int start, int length = 1) {
var height = rect.height/many;
@vielhuber
vielhuber / script.sh
Last active May 14, 2025 23:58
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux