Skip to content

Instantly share code, notes, and snippets.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,0E,00,3a,00,3a,00,46,00,00,00,00,00
@float3
float3 / main.rs
Created March 25, 2024 12:11
optlevel = 1 is white while optlevel = 0 works
use minifb::{Key, Scale, Window, WindowOptions};
use num_complex::Complex;
use tokio::task;
const WIDTH: usize = 640;
const HEIGHT: usize = 360;
fn mandelbrot_set(c: Complex<f64>, limit: u32) -> Option<u32> {
let mut z = Complex::new(0.0, 0.0);
for i in 0..limit {
@float3
float3 / test.cs
Created March 14, 2023 16:51
writing a compressed texture that's loaded in memory to disk
using System.IO;
using UnityEditor;
using UnityEngine;
public class test : EditorWindow
{
[MenuItem("CONTEXT/Material/Rip Texture")]
import os
import bpy
# Find the Blender output file
outfile = os.getenv("UNITY_BLENDER_EXPORTER_OUTPUT_FILE")
# Do the conversion
print("Starting blender to FBX conversion " + outfile)
@float3
float3 / Detour.cs
Last active March 6, 2023 10:08
Detour
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
public class C {
static Dictionary<MethodInfo, byte[]> PatchedData = new();
static unsafe void TryDetourFromTo(MethodInfo src, MethodInfo dst)
@float3
float3 / BoxMode.js
Last active November 10, 2022 21:59
Box mode
// ==UserScript==
// @name Box Mode
// @namespace Violentmonkey Scripts
// @grant none
// @version 1.0
// @author @float3
// @description Box Mode
// @updateURL https://gist.githubusercontent.com/float3/e6fd7ea19e3a3feb7c08d386f545b290/raw/BoxMode.js
// @downloadURL https://gist.githubusercontent.com/float3/e6fd7ea19e3a3feb7c08d386f545b290/raw/BoxMode.js
// ==/UserScript==
@float3
float3 / ShaderSwitch.cs
Created August 12, 2022 20:36
ShaderSwitch
/*
MIT License
Copyright (c) 2022 Float3
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
@float3
float3 / UnStereo.shader
Last active May 29, 2022 16:39
UnStereo
Shader "3/Unstereo"
{
Properties
{
[Enum(Left, 0, Right, 1)] _Eye ("Which Eye do you want to render", Float) = 0
}
SubShader
{
Pass
{
@float3
float3 / Commons.cginc
Last active July 29, 2022 09:58
my common include that I have in all my shaders
#ifndef COMMON_INCLUDED
#define COMMON_INCLUDED
#pragma warning (default : 3206) // implicit truncation
//this needs to match you camera_res_height in the config.json file
#define VRC_CONFIG_CAMERA_RESOLUTION 2160
//from Scruffy
bool isVR()
@float3
float3 / BakeryMaterialUtility.cs
Last active August 2, 2022 15:54
Set bakery settings on all materials in scene
#if UNITY_EDITOR
#region
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
#endregion