Skip to content

Instantly share code, notes, and snippets.

View plskz's full-sized avatar
🦝
Learning

Zai Santillan plskz

🦝
Learning
View GitHub Profile
@plskz
plskz / r3f.code-snippets
Created February 18, 2025 01:02
r3f code snippets
{
"R3F - Mesh Component": {
"prefix": "r3fc",
"body": [
"const ${1:BoxMesh} = ({ ...props }) => {",
" return (",
" <mesh {...props}>",
" <boxBufferGeometry args={[1, 1, 1]} />",
" <meshPhysicalMaterial color={'blue'} />",
" </mesh>",
@plskz
plskz / DOM3D.js
Created March 27, 2024 14:42 — forked from OrionReed/dom3d.js
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@plskz
plskz / alias.txt
Created March 19, 2024 00:13
aliases
-='cd -'
...=../..
....=../../..
.....=../../../..
......=../../../../..
1='cd -1'
2='cd -2'
3='cd -3'
4='cd -4'
5='cd -5'
@plskz
plskz / rename.sh
Created March 13, 2024 07:13
update folder name for my-threejs-journey repo
#!/bin/bash
# Target starting number for renaming (start at 64)
start_number=64
# Iterate through folders in reverse, starting with folder number 51
for i in {51..32}; do
old_name="${i}-" # Build the old folder name pattern
# Check if the folder exists
@plskz
plskz / different-favicons-in-development-and-production.md
Last active February 24, 2024 12:50
different favicons in development and production (next.js app router)

root layout.tsx

export const metadata: Metadata = {
  // ...
  icons: [{
    rel: 'icon',
    url: process.env.NODE_ENV === 'production' ? '/favicon.ico' : '/favicon-dev.ico',
  }]
}
@plskz
plskz / update-deps.sh
Last active March 13, 2024 07:11
update all deps for my-threejs-journey repo
#!/bin/bash
# Loop through folders from 01 to 33
for folder_number in {1..33}; do
folder=$(printf "%02d-" "$folder_number") # Format folder number with leading zero
# Find folders with the given prefix
folders_with_prefix=$(find . -maxdepth 1 -type d -name "$folder*")
# Loop through folders with the given prefix
@plskz
plskz / utils.ts
Last active June 16, 2024 13:46
Use cn() util
import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
@plskz
plskz / oreo.txt
Last active February 17, 2025 03:30
5oqq2216
Ah-GMMJiP-MDEHWD-VXGQG-VJDRM-FFjJk-jlAXF
A ≠ a

--- dump ---

  • Activities
    • Reading
    • Watching
    • Completed
    • Paused
    • Dropped
    • Planning
⢀⡀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣏⠓⠒⠤⣰⠋⠹⡄⠀⣠⠞⣿⠀⠀
⠀⠀⠀⢀⠄⠂⠙⢦⡀⠐⠨⣆⠁⣷⣮⠖⠋⠉⠁⠀
⠀⠀⡰⠁⠀⠮⠇⠀⣩⠶⠒⠾⣿⡯⡋⠩⡓⢦⣀⡀
⠀⡰⢰⡹⠀⠀⠲⣾⣁⣀⣤⠞⢧⡈⢊⢲⠶⠶⠛⠁
⢀⠃⠀⠀⠀⣌⡅⠀⢀⡀⠀⠀⣈⠻⠦⣤⣿⡀⠀⠀
⠸⣎⠇⠀⠀⡠⡄⠀⠷⠎⠀⠐⡶⠁⠀⠀⣟⡇⠀⠀
⡇⠀⡠⣄⠀⠷⠃⠀⠀⡤⠄⠀⠀⣔⡰⠀⢩⠇⠀⠀
⡇⠀⠻⠋⠀⢀⠤⠀⠈⠛⠁⠀⢀⠉⠁⣠⠏⠀⠀⠀
⣷⢰⢢⠀⠀⠘⠚⠀⢰⣂⠆⠰⢥⡡⠞⠁⠀⠀⠀⠀