Skip to content

Instantly share code, notes, and snippets.

@timohausmann
timohausmann / firebase-json-export-node.js
Last active June 17, 2021 10:32
Two simple scripts to quickly export and import any collection data as JSON with node.js firebase-admin
const fs = require('fs');
const path = require('path');
const admin = require('firebase-admin');
const collectionName = 'characters';
(async () => {
/**
* How to get your serviceAccountKey:
@timohausmann
timohausmann / Readme.MD
Last active December 2, 2022 13:51
useAlphaVideoTexture Hook for React Three Fiber

Playing transparent videos with alphachannel currently requires two file formats / codecs: webm (vp9) and mov (hvc1) for Safari.

This hook makes it easy to use two files as input and pick the right one. (Variation of useVideoTexture)

Usage (Vite example):

import { Billboard } from '@react-three/drei';
@timohausmann
timohausmann / how-to-use.ts
Last active April 5, 2023 16:45
💣 Extention for theatre.js Studio to clear the local state
import studio from '@theatre/studio';
import { studioResetExtention } from './studioResetExtention';
// just extend studio
studio.extend(studioResetExtention);
studio.initialize();
@timohausmann
timohausmann / theatre.ts
Created May 25, 2023 14:38
theatre.ts isStudioHidden
import type { IStudio } from '@theatre/studio';
export const theatre = { isInit: false };
export const studioHelper = {
isStudioHidden: (): boolean => {
if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'production') {
return true;
} else if(theatre.isInit) {
const isHidden = (require('@theatre/studio').default as IStudio).ui.isHidden;