Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
"Top 1000 values of registry.path",Count
"HKLM\SYSTEM\ControlSet001\Services\WinDefend\Start","1,483"
"HKLM\SYSTEM\ControlSet001\Services\UsoSvc\Start","1,477"
"HKLM\SYSTEM\ControlSet001\Services\WaaSMedicSvc\Start","1,477"
"HKLM\SYSTEM\ControlSet001\Services\wuauserv\Start","1,477"
"HKLM\SYSTEM\ControlSet001\Services\SecurityHealthService\Start",6
"HKLM\SYSTEM\ControlSet001\Services\Sense\Start",6
"HKLM\SYSTEM\ControlSet001\Services\WdBoot\Start",6
"HKLM\SYSTEM\ControlSet001\Services\WdFilter\Start",6
"HKLM\SYSTEM\ControlSet001\Services\WdNisDrv\Start",6
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Rendering;
using UnityEngine;
using UnityEngine.Rendering;
class ShaderBuildProcessor : IPreprocessShaders
{
ShaderVariantCollection whitelist;
@alexanderameye
alexanderameye / CircularMenu.cs
Last active April 28, 2025 08:27
Circular menu for the Unity Editor
/*
MIT License
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@VictorTaelin
VictorTaelin / gpt4_abbreviations.md
Last active April 29, 2025 09:24
Notes on the GPT-4 abbreviations tweet

Notes on this tweet.

  • The screenshots were taken on different sessions.

  • The entire sessions are included on the screenshots.

  • I lost the original prompts, so I had to reconstruct them, and still managed to reproduce.

  • The "compressed" version is actually longer! Emojis and abbreviations use more tokens than common words.

@forestrf
forestrf / Selectable.cs
Last active May 12, 2025 04:28
Improved UI navigation on Selectable.cs
// Improved navigation code
using System;
using System.Collections.Generic;
using UnityEngine.Serialization;
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
[AddComponentMenu("UI/Selectable", 35)]
[ExecuteAlways]
@adammyhre
adammyhre / InspectorLock.cs
Last active May 12, 2025 04:28
Lock Inspector Icon and Transform Constrain Proportion Icon in Unity
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Toggles the Inspector lock state and the Constrain Proportions lock state.
/// </summary>
public static class LockInspector {
static readonly MethodInfo flipLocked;
static readonly PropertyInfo constrainProportions;
@nmwsharp
nmwsharp / printarr
Last active August 15, 2024 01:43
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc. --- now on pip: `pip install arrgh`
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc.
Now on pip! `pip install arrgh` https://github.com/nmwsharp/arrgh
@Birch-san
Birch-san / separated_matmul.py
Created January 19, 2023 23:07
Matrix multiplication, by computing mantissae and exponents separately
# suppose we want to matmul some matrix against some column vector..
# the usual way is this:
mat = np.array([[1.3e2, 8.e2], [1.6e1, 5.e-1]])
vec = np.array([2.1e2, 3.6e-4])
mat @ vec
array([27300.288 , 3360.00018])
# but what if we wanted to exploit some efficiencies..
# - addition can use less cycles / energy / silicon / time than multiplication
# - for machine learning training: we want to represent a wide range of exponents, but don't need such range on the mantissa
@sketchpunk
sketchpunk / FetchBatch.js
Last active April 4, 2024 02:16
Various Fetch / Downloading functions or Objects
function nanoID( t=21 ){
const r = crypto.getRandomValues( new Uint8Array( t ) );
let n, e = '';
for( ;t--; ){
n = 63 & r[ t ];
e += ( n < 36 )? n.toString( 36 ) :
( n < 62 )? ( n - 26 ).toString( 36 ).toUpperCase() :
( n < 63 )? '_' : '-';
}
return e;
@kurtdekker
kurtdekker / HeadNodYesSensor.cs
Last active July 16, 2024 15:25
Head shake no and nod yes gesture detector
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// @kurtdekker - head nod yes sensor
//
// To use:
// Put this on a mouse-controlled FPS camera and it can detect:
// - up/down "head nods yes."
// Optionally give it an audio to play