Skip to content

Instantly share code, notes, and snippets.

View trinhvanminh's full-sized avatar
🎲
haha

Minh trinhvanminh

🎲
haha
View GitHub Profile
@trinhvanminh
trinhvanminh / no-use-effect.md
Created March 18, 2026 12:15 — forked from alvinsng/no-use-effect.md
Skill generated by Factory Droid
name no-use-effect
description Enforce the no-useEffect rule when writing or reviewing React code. ACTIVATE when writing React components, refactoring existing useEffect calls, reviewing PRs with useEffect, or when an agent adds useEffect "just in case." Provides the five replacement patterns and the useMountEffect escape hatch.

No useEffect

"use client";
import { animate } from "motion";
import {
motion,
MotionValue,
useMotionTemplate,
useMotionValue,
useTransform,
} from "motion/react";
@trinhvanminh
trinhvanminh / what-forces-layout.md
Created July 3, 2025 04:29 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@trinhvanminh
trinhvanminh / README.md
Created December 9, 2024 04:12 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version