Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / Get a custom email address for FREE using Cloudflare + Gmail .md
Created February 23, 2026 19:06
Get a custom email address for FREE using Cloudflare + Gmail

// https://x.com/tokifyi/status/2025741929997361371

Get a custom email address for FREE using Cloudflare + Gmail Did you know you can just use Cloudflare email routing to get a custom email for free? Most people pay $6-12/month for Google Workspace or Microsoft 365 just to get a custom email. This setup costs you nothing except the domain itself. Here's what you need:

A domain name ($10-15/year from Namecheap, GoDaddy, etc. - students: free via GitHub Student Pack)
A Gmail account (free)

Cloudflare account (free)

@unitycoder
unitycoder / microgpt.py
Created February 12, 2026 07:03 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@unitycoder
unitycoder / fetch_vcdist.py
Created February 6, 2026 14:37 — forked from donno/fetch_vcdist.py
Downloads and extract the Visual C++ Redistributables.
"""Downloads and extract the Visual C++ Redistributables.
This is useful when working with minidump files as the user may be running
with a new different version of the runtime. This script aims to maintain
a copy of the various versions.
Versions are normally added once I encounter them, in November 2022, I added
a rather large back catalogue of versions.
This requires dark.exe from Wix (http://wixtoolset.org/releases/) and
@unitycoder
unitycoder / AsyncCapture.cs
Created January 13, 2026 09:04
How to take a screenshot with Unity WebGPU?
// https://discussions.unity.com/t/how-to-take-a-screenshot-with-unity-webgpu/1681498/2
using System.Runtime.InteropServices;
using Unity.Collections;
using UnityEngine;
using UnityEngine.Rendering;
public sealed class AsyncCapture : MonoBehaviour
{
// ProcessCapture is defined in ASyncCapture.jslib
@unitycoder
unitycoder / BuildAndPlay.cs
Last active January 4, 2026 14:33
Unity Editor Add Custom MainToolbar button for Build and Run and Enter Playmode
using System.Diagnostics;
using System.IO;
using System.Threading;
using UnityEditor;
using UnityEditor.Toolbars;
using UnityEngine;
using Debug = UnityEngine.Debug;
public class BuildAndPlay
{
@unitycoder
unitycoder / tgf-midi-extractor.mjs
Created January 2, 2026 11:13 — forked from nathnolt/tgf-midi-extractor.mjs
The Games Factory .gam 0C_Music.mus music file to midis converter
// The Games Factory 0C_Music.mus -> midi files
// See the following tool for actually extracting the 0C_Music.mus file from a .gam file
// https://kippykip.com/threads/cextract-the-games-factory-multimedia-fusion-game-extractor-unprotector.498/
//
import fs from 'fs'
const input = './0C_Music.mus'
const buffer = fs.readFileSync(input)
@unitycoder
unitycoder / ConsoleUtils.cs
Created December 19, 2025 20:04
unity editor, get console selection and other info
// get console stuff
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEngine;
namespace Unity.AI.Assistant.Bridge.Editor
{
internal static class ConsoleUtils
@unitycoder
unitycoder / callCoRoutineWithoutStartCoroutineFromCoroutine.cs
Last active December 11, 2025 15:16
Unity Coroutine with Callback Return Value and method parameter, or call coroutine from another coroutine without StartCoroutine
IEnumerator Parent()
{
Debug.Log("Parent: before child");
yield return ChildCoroutine();
Debug.Log("Parent: after child");
}
IEnumerator ChildCoroutine()
@unitycoder
unitycoder / getrealcanvassize.cs
Created December 3, 2025 21:35
ugui: getting canvas element size fails in build at Start() in build, but works in Editor?!?!
// this works, it waits 1 frame then forces update, BUT it doesnt work if you do those calculations directly at Start()! (works in Editor but not in build)
void Start()
{
rectTransform = GetComponent<RectTransform>();
StartCoroutine(InitializeAfterLayout());
}
IEnumerator InitializeAfterLayout()
{
// Wait for end of frame to ensure layout is calculated
@unitycoder
unitycoder / ScriptableObjectHeaderPing.cs
Last active November 28, 2025 13:10
Add ping button for scriptable object Inspector
// NOTE: this executes on all selected objects.. and compares if target is ScriptableObject
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public static class ScriptableObjectHeaderPing
{
static ScriptableObjectHeaderPing()
{
// Called after Unity draws the default header of *any* inspector