Skip to content

Instantly share code, notes, and snippets.

View promer94's full-sized avatar
🐱
working

promer94

🐱
working
  • 11:46 (UTC +08:00)
View GitHub Profile
@promer94
promer94 / AGENTS.md
Created June 2, 2026 18:30
AGENTS.md

Global Codex Instructions

Node.js Tooling

Vite+ (vp) is the unified toolchain and entry point for web development. It manages the runtime, package manager, and frontend toolchain in one place. For Node.js and web development, prefer vp commands.

Daily command mapping:

  • Shims node, npm, npx, vpx, vpr
  • Dependencies: use vp install, vp add, vp remove, vp update, vp dedupe, vp outdated, vp list, vp why, vp info, and vp rebuild. Pass install flags through vp install, such as --frozen-lockfile, --lockfile-only, --filter <pattern>, or -w.
  • Vite+ project lifecycle: use vp dev, vp build, vp preview, vp check, vp lint, vp fmt, and vp test. Prefer vp check for static validation loops. Use vp pack for libraries, packages, and CLIs.

Problem

I simplified the reproduction

import useSWR from "swr";
import React, { useState, useEffect } from "react";

const sleep = (ms) =>
  new Promise((resolve) => {
    setTimeout(() => resolve("foo"), ms);
@promer94
promer94 / index.md
Last active June 15, 2022 17:29
TypeScript-类型编程

TS 类型编程



it('should update data when polling interval has changed', async () => {
let a = 0
function App() {
const [int, setInt] = React.useState(200)
const { data } = useSWR('/api', () => a++, {
refreshInterval: int,
dedupingInterval: 100
})
return <div onClick={() => setInt(int + 100)}>count: {data}</div>
}
import {
useEffect,
useLayoutEffect,
useRef,
useContext,
useCallback,
useReducer
} from 'react'
import deepEqual from 'fast-deep-equal'
server {
listen 80 default_server;
listen [::]:80 default_server;
proxy_redirect off;
proxy_pass "http://127.0.0.1:3000";
}
{
"editor.formatOnSave": false,
"editor.detectIndentation": false,
"workbench.iconTheme": "material-icon-theme",
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": false,
"suppressCommitNotFoundWarning": false,
"suppressFileNotUnderSourceControlWarning": false,
"suppressGitVersionWarning": false,
"suppressLineUncommittedWarning": false,
{
"parser": "babel-eslint",
"extends": ["react-app","airbnb","prettier/react","prettier"],
"rules": {
"jsx-a11y/href-no-hash": [0],
"generator-star-spacing": [0],
"consistent-return": [0],
"react/react-in-jsx-scope": [0],
"react/forbid-prop-types": [0],
"react/jsx-filename-extension": [1, { "extensions": [".js"] }],
@promer94
promer94 / package.json
Created March 19, 2018 07:13
my npm setting
{
"name": "editor_setting",
"version": "1.0.0",
"description": "vscode setting",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT",