Skip to content

Instantly share code, notes, and snippets.

View GitaiQAQ's full-sized avatar
🏠
Working for home

Gitai GitaiQAQ

🏠
Working for home
  • China
  • 12:38 (UTC -12:00)
View GitHub Profile
@GitaiQAQ
GitaiQAQ / prompt-ssh-git-multi-project-sync.md
Created November 7, 2026 08:08
多项目 SSH Git 完整同步提示词

请通过 SSH 将源主机上的多个 Git 项目完整、可验证地同步到目标主机,并使用启发式探索自动识别项目。

源根目录:<例如 /workspace> 目标 SSH 主机:<例如 user@host 或 SSH config Host 别名> 目标根目录:<例如 /workspace/backup> 项目选择规则:优先同步源根目录下一级目录中的 Git 仓库;如存在嵌套仓库,列出后按仓库根目录分别处理。 排除规则:忽略 .git、node_modules、dist、build、缓存目录和符号链接指向的仓库,除非我明确指定。

工作方式:

/**
* Feature Flags Panel (single-file)
* - Renders a list of feature flags
* - Stores values in globals.featureFlags
* - Supports: search, groups, bulk ops, import/export JSON, reset-to-default
* LICENSE: MIT
*
*
* ```typescript
* import { addons, types } from "storybook/manager-api";
nvm use
npm install --location=global pnpm@${$(cat package.json | jq -r '.engines.pnpm // "latest"'):-latest}
npm install --location=global yarn@${$(cat package.json | jq -r '.engines.yarn // "latest"'):-latest}
npm install --location=global npm@${$(cat package.json | jq -r '.engines.npm // "latest"'):-latest}
// ==UserScript==
// @name urlbox-example
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=bing.com
// @grant none
// ==/UserScript==
export function createPendingValue<T, Ref = any, S = never>(ref: Ref, key: keyof Ref) {
let resolve!: (v: T) => void;
let reject!: (reason?: any) => void;
const p = new Promise<T>((_resolve, _reject) => {
resolve = value => {
ref[key] = value as Ref[keyof Ref];
_resolve(value);
};
@tailwind base;
@tailwind components;
@tailwind utilities;
#aside-controller:checked+aside {
transform: translateX(0);
}
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Version 2, December 2004
// Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
// Everyone is permitted to copy and distribute verbatim or modified
// copies of this license document, and changing it is allowed as long
// as the name is changed.
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
function payload<D, E>() {
const arr: { data?: D, error?: E } & ((_: any) => void)[] = [(data) => { arr.data = data }, (error) => { arr.error = error }];
return arr;
}
const useForceUpdate = () => Object.assign.apply(null, useReducer(({ current }) => ({ current: current + 1 }), { current: 0 }).reverse());
function useFetch<D, E, R = { data?: D, error?: E }>(fetcher, deps = []) {
const forceUpdate = useForceUpdate();
const ref = useRef<R>(payload());
@GitaiQAQ
GitaiQAQ / useForceUpdate.js
Created June 1, 2022 15:44
useForceUpdate
const useForceUpdate = () => Object.assign.apply(null, useReducer(({ current }) => ({ current: current + 1 }), { current: 0 }).reverse());
functioin Test() {
const forceUpdate = useForceUpdate();
const dataMap = useMemo(() => new WeakMap(), [forceUpdate.current]);
}
@GitaiQAQ
GitaiQAQ / InvertedPromise.js
Created June 1, 2022 15:34
InvertedPromise.js
function InvertedPromise() {
let _ = undefined;
return Object.assign(new Promise((resolve, reject) => { _ = { 0: resolve, 1: reject, resolve, reject } }), _);
}
function InvertedPromise() {
let _ = undefined;
return _ = new Promise((resolve, reject) =>
Promise.resolve()
.then(() => Object.assign(_, { resolve, reject })));