Skip to content

Instantly share code, notes, and snippets.

View iinfin's full-sized avatar

Han iinfin

View GitHub Profile

UI Agent Guidelines

Opinionated constraints for building accessible, fast, delightful interfaces. Use MUST/SHOULD/NEVER to guide decisions.

Stack

  • MUST use Tailwind CSS defaults unless custom values exist or are explicitly requested
  • MUST use cn utility (clsx + tailwind-merge) for class logic
  • MUST use motion/react when JavaScript animation is required
  • SHOULD use tw-animate-css for entrance and micro-animations
@iinfin
iinfin / clear_windows_updates.bat
Created April 29, 2022 07:25
clear windows updates
@echo off
powershell -windowstyle hidden -command "Start-Process cmd -ArgumentList '/s,/c,net stop usosvc & net stop wuauserv & del %systemroot%\SoftwareDistribution\DataStore\Logs\edb.log & del /f /q C:\ProgramData\USOPrivate\UpdateStore\* & net start usosvc & net start wuauserv & UsoClient.exe RefreshSettings' -Verb runAs"
@iinfin
iinfin / index.html
Created April 28, 2022 14:19
unity-webgl-template
<!-- https://docs.unity3d.com/Manual/webgl-templates.html -->
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{{ PRODUCT_NAME }}}</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.css/normalize.min.css" />
@iinfin
iinfin / cubic-bezier.js
Last active April 28, 2022 14:20
cubic bezier easing
// simplified version of:
// https://github.com/gre/bezier-easing/blob/master/src/index.js
// https://npmjs.com/package/bezier-easing
function slopeFromT(t, A, B, C) {
return 1.0 / (3.0 * A * t * t + 2.0 * B * t + C);
}
function xFromT(t, A, B, C, D) {
return A * (t * t * t) + B * (t * t) + C * t + D;
@iinfin
iinfin / cf-auth.js
Created February 10, 2022 19:45
cloudflare password protection per site using values from KV
const _REALM = 'Secure Area';
const _DEFAULT_USERNAME = 'username';
const _DEFAULT_PASSWORD = null;
addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const password = await getValidCredentials(request);
@iinfin
iinfin / netlify.sh
Last active January 12, 2022 09:13
netlify rust installation for web projects
#!/usr/bin/env bash
# curl https://gist_raw_url -sSLf | bash
set -e
cweb_version=0.6.26
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz
curl -Lo cargo-web.gz $cweb
gunzip cargo-web.gz
@iinfin
iinfin / .perforce.sh
Last active January 12, 2022 14:26
perforce helix server on macos
#!/bin/sh
CURRENT_DIR=$(pwd)
DOWNLOAD_URL="https://www.perforce.com/downloads/perforce/r21.2/bin.macosx1015x86_64/helix-core-server.tgz"
DOWNLOAD_DIR="${CURRENT_DIR}/tmp_perforce_download/"
sudo rm -rf "${DOWNLOAD_DIR}"
sudo mkdir "${DOWNLOAD_DIR}"
@iinfin
iinfin / houdini_octane_tile_render.py
Last active December 24, 2021 14:02
generate render tiles
import hou
import os
def fit(input, oldmin, oldmax, newmin, newmax):
return (((input - oldmin) * (newmax - newmin)) / (oldmax - oldmin)) + newmin
def tile_camera(path_cam, path_rop, tiles_x=2, tiles_y=2):
debug = False
@iinfin
iinfin / houdini_attributes.md
Last active January 18, 2026 00:07
houdini attributes cheatsheet

https://mrkunz.com/blog/08_22_2018_VEX_Wrangle_Cheat_Sheet.html

f@Frame The current floating frame number, equivalent to the $FF Hscript variable
f@Time The current time in seconds, equivalent to the $T Hscript variable
i@SimFrame The integer simulation timestep number ($SF), only present in DOP contexts
f@SimTime The simulation time in seconds ($ST), only present in DOP contexts
f@TimeInc The timestep currently being used for simulation or playback
- -