Skip to content

Instantly share code, notes, and snippets.

View jeremedia's full-sized avatar

Jeremy Roush jeremedia

View GitHub Profile
@yasirkula
yasirkula / SnapRectTransformAnchorsToCorners.cs
Created May 28, 2024 18:20
Snap a RectTransform's anchors to its corner points in Unity
using UnityEditor;
using UnityEngine;
public class SnapRectTransformAnchorsToCorners : MonoBehaviour
{
[MenuItem("CONTEXT/RectTransform/Snap Anchors To Corners", priority = 50)]
private static void Execute(MenuCommand command)
{
RectTransform rectTransform = command.context as RectTransform;
RectTransform parent = rectTransform.parent as RectTransform;
@n-studio
n-studio / DEPLOY_WITH_KAMAL_ON_DEDICATED_SERVER.md
Last active June 12, 2024 14:10
Deploy a web app on a dedicated server with Kamal

Warning

This gist is still a draft. At the moment it is not functional: see basecamp/kamal#257

Motivation

Kamal was designed with 1 service = 1 droplet/VPS in mind.
But I'm cheap and I want to be able to deploy multiple demo/poc apps apps on my $20/month dedicated server.
What the hell, I'll even host my private container registry on it.

@rain-1
rain-1 / LLM.md
Last active July 18, 2024 22:37
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@vpfrimmer
vpfrimmer / CustomGradleProcessor.cs
Last active January 12, 2024 01:30
IPostGenerateGradleAndroidProject to replace the instal location to "auto" in the generated AndroidManifest - Unity 2022.x
using System.IO;
using UnityEditor;
using UnityEditor.Android;
using UnityEngine;
/// <summary>
/// Used as a workaround for Unity 2022.x who isn't able to set the installlocation value to "auto" in the AndroidManifest.xml file.
/// Should be put in the Assets/Editor folder, otherwise you'll get errors on build.
/// The issue can be followed here : https://issuetracker.unity3d.com/issues/android-install-location-changes-when-exporting-project
/// </summary>
@khskekec
khskekec / libre-link-up-http-dump.md
Last active July 21, 2024 02:11
HTTP dump of Libre Link Up used in combination with FreeStyle Libre 3
@StagPoint
StagPoint / CameraMath.cs
Created December 2, 2020 23:20
Small collection of utility functions for calculating screen size of objects, size of camera frustum at a distance, etc.
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using Unity.Burst;
using Unity.Mathematics;
public static class CameraMath
{
/// <summary>
@dpid
dpid / how-to-notarize-unity-for-macos.md
Last active December 6, 2023 20:42
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