| 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. |
You are an agent that specializes in working with Specs in Claude Code. Specs are a way to develop complex features by creating requirements, design and an implementation plan. Specs have an iterative workflow where you help transform an idea into requirements, then design, then the task list. The workflow defined below describes each phase of the spec workflow in detail.
| import { Elysia } from "elysia"; | |
| import { staticPlugin } from '@elysiajs/static'; | |
| const app = new Elysia() | |
| app.use(staticPlugin({ | |
| prefix: '', | |
| assets : "./dist", | |
| })) | |
| app.get('/', async () => { |
Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.
You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.
You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)
Don't like Next? Here's how to do the same in Gatsby.
| var jwt = require('jsonwebtoken'); | |
| const fs = require('fs'); | |
| var request = require("request"); | |
| var querystring = require('querystring'); | |
| var privateKey = fs.readFileSync('./private_key.pem'); | |
| #idcs or keycloak URL | |
| var url = "https://example.com/oauth2/v1/token" | |
| var headers = { | |
| 'Authorization': 'Basic <BASE-64 ENCODED client ID & Secret>', |
These are some photos comparing different macOS retina scaling options. All use a non-vector test pattern displayed at 100% (AAPM TG18). All photos are taken at roughly the same distance, using the same crop. Forgive the slight hand-held motion blur, and focus on these variables:
- Pixel size
- UI size
- Pixel perfection (has any interpolation taken place?)
- Real estate (how much of the image is displayed in this representative patch?)
| set devices to {} | |
| tell application "System Preferences" | |
| reveal pane id "com.apple.preference.sound" | |
| end tell | |
| tell application "System Events" | |
| tell application process "System Preferences" | |
| tell tab group 1 of window "Sound" | |
| click radio button "Output" | |
| tell table 1 of scroll area 1 |
| // First, go to https://shopee.co.th/user/purchase, and open DevTools. | |
| // Step 1 - Run this code to scroll all the way to the bottom. | |
| const timer = setInterval(() => scrollTo(0, 10000000), 800) | |
| setTimeout(() => { | |
| // Step 2 - Stop scrolling after 1 minute. | |
| clearInterval(timer) | |
| // Step 3 - Sum the total purchase price! |
| async function captchaVerification() { | |
| return await new Promise((resolve, reject) => { | |
| const captcha = document.createElement('div') | |
| captcha.setAttribute('id', 'g-recaptcha') | |
| document.getElementById('main').appendChild(captcha) | |
| const verifyCallback = async (response) => { | |
| if (response) { | |
| const data = { | |
| token: response, | |
| } |
| -- code for https://youtu.be/tp_5c6jaNQE | |
| create table users ( | |
| id serial primary key, | |
| first_name varchar(255) not null, | |
| last_name text, | |
| age int, | |
| email text unique not null | |
| ); |