Skip to content

Instantly share code, notes, and snippets.

import Scene from 'Scene';
import FaceTracking from 'FaceTracking';
import Animation from 'Animation';
/*
Model structure:
- Model
- skeleton (null)
- Armatures (null objs)
- Petal & pollen (meshes)
@tomaspietravallo
tomaspietravallo / ReactiveToVanilla.ts
Created July 5, 2021 21:35
Type for objects composed of Scalar/String/Boolean signals, that get snapshot'ed to their vanilla counterparts
type ReactiveToVanilla<Obj> = {
[Property in keyof Obj]:
Obj[Property] extends ScalarSignal ? number :
Obj[Property] extends StringSignal ? string :
Obj[Property] extends BoolSignal ? boolean
: any
};
public static class FileComparer
{
public static bool CompareEquals(string filePath1, string filePath2, int bufferSize = 65536)
{
if (filePath1 == filePath2) return true;
var buffer1 = ArrayPool<byte>.Shared.Rent(bufferSize);
var buffer2 = ArrayPool<byte>.Shared.Rent(bufferSize);
try
{
@Temzasse
Temzasse / use-parsed-search-params.ts
Last active June 6, 2025 10:17
A utility hook to parse and type URL search params based on a configuration object. This hook is useful when you want to access URL search params in a typesafe way and with proper casting.
import { useMemo } from "react";
import { useSearchParams } from "react-router-dom";
type ParseConfig = Record<
string,
| { type: "string"; defaultValue?: string }
| { type: "number"; defaultValue?: number }
| { parse: (value: URLSearchParams) => unknown }
>;