Skip to content

Instantly share code, notes, and snippets.

@morlay
morlay / AGENTS.md
Created June 19, 2026 09:44
PDCA 版本 DeepSeek 全局 AGENTS.md

行为规范

核心原则

PDCA 不可跳过。复杂任务嵌套循环垂直推进——拆解为最小步骤,每步 Plan→Do→Check→Act,验证通过再推进下一步。禁止批量修改后统一验证。

通用硬约束(H)

  • [H1] 禁止编造:所有 API、函数名、路径、包名、命令参数必须在代码库有依据。不确定先搜,搜不到问用户。
  • [H2] 工具失败必须报告:返回空/失败/非预期必须显式告知用户,不得沉默。
@morlay
morlay / Migrate to Bun from NodeJS .md
Last active November 8, 2023 03:03
Migrate to Bun from NodeJS

Package Manager (from pnpm)

清空 node_modulespnpm-lock.yaml

find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
rm pnpm-lock.yaml

bun install 即可

  • 跨平台 GUI 工具
  • 平台支持列表
    • Windows 7 +
    • Linux
      • Ubuntu 20+
    • macOS

路线选择

@morlay
morlay / AMapBaseLayer.tsx
Created November 1, 2021 05:49
AMapBaseLayer
import { must } from "@querycap/reactutils";
import * as AMap from "AMap";
import { Map } from "mapbox-gl";
import React, { createContext, ReactNode, useContext, useEffect, useState } from "react";
import { useMap, createCustomLayer } from "../mapbox";
import { AMapSDKLoader, useAMapSDK } from "./AMapSDK";
import { Styles } from "./Style";
const createFovHack = (m: Map) => {
const currentFov = 0;
@morlay
morlay / default.puml
Last active July 30, 2021 02:53
plantuml-skin
@startuml
!$turquoise = "#1ABC9C"
!$greensea = "#16A085"
!$emerald = "#2ECC71"
!$nephritis = "#27AE60"
!$peterriver = "#3498DB"
!$belizehole = "#2980B9"
!$amethyst = "#9B59B6"
!$wisteria = "#8E44AD"
@morlay
morlay / buildx_create_multi_arch_builder_in_k8s.md
Created July 21, 2021 06:06
Buildx create multi-arch builder in k8s

Buildx create multi-arch builder in k8s

With QEMU emulation

$ KUBECONFIG=${KUBECONFIG} \
    docker buildx create \
        --name=builder \
        --platform=linux/amd64,linux/arm64 \
        --driver=kubernetes \
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
name: installed-state
namespace: istio-system
spec:
hub: hub-dev.rockontrol.com/istio
tag: 1.6.5
addonComponents:
grafana:
@morlay
morlay / wsl.md
Last active April 14, 2021 03:08
# WSL 初探

WSL 1 的坑已经不修了,WSL 2 还是走向了虚拟化。 因此,WSL 是另一个系统,并且和纯 Linux 有所差异

文件

Windows in WSL

通过 /mnt/c/mnt/d 等路径,可以在 WSL 直接访问到 Windows 中的文件。 甚至是调用 Windows 的命令,添加 PATH 即可:

@morlay
morlay / MapWorld.ts
Created January 24, 2019 06:38
MapWorld.ts
import { mat4 } from "gl-matrix";
import { Map, Transform } from "mapbox-gl";
import {
Camera,
Group,
Light,
Matrix4,
Object3D,
Scene,
Vector3,
@morlay
morlay / Store.js
Created August 4, 2016 01:31
Simple Redux-like Store
class Store {
constructor(reducer, initialState) {
this.state = initialState;
this.reducer = reducer;
this.trigger = () => null;
}
subscribe(callback) {
this.trigger = callback;
}