Skip to content

Instantly share code, notes, and snippets.

View weilueluo's full-sized avatar
code ^ sleep

Weilue Luo weilueluo

code ^ sleep
View GitHub Profile
@weilueluo
weilueluo / simple-react-themes.md
Last active April 12, 2023 00:45
Simple Theme Management for React

Simple React Theme Management

  • Single themes.tsx file, ~200 lines.
  • Flashless (with ssr).
  • Typescript.

themes.tsx

import React, { useContext, useState } from "react";

// utils
@rtpHarry
rtpHarry / animation.js
Last active October 4, 2023 06:20
Three.js - play an AnimationAction in reverse. There are a bunch of threads saying this isn't possible but I found a way so I wanted to post it online in a place that people will hopefully stumble upon it.
// The class itself is based on the animation helper class in
// https://github.com/paulmg/ThreeJS-Webpack-ES6-Boilerplate
// but I have changed almost everything except for the class name and the update function.
import * as THREE from 'three';
export default class Animation {
constructor(scene, animations) {
this.scene = scene;
this.animations = animations;
@simonista
simonista / .vimrc
Last active July 21, 2024 14:41
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on