From f5e9e237374a3698c72893d9cbbe9fb132d880df Mon Sep 17 00:00:00 2001 From: wener Date: Thu, 14 Mar 2024 18:45:03 +0800 Subject: [PATCH] update --- notes/ai/ai-awesome.md | 2 +- notes/ai/service/README.md | 4 + notes/algorithm/monte-carlo.md | 9 + notes/db/relational/mssql/README.md | 10 + .../relational/postgresql/postgresql-faq.md | 4 + notes/dev/design/design-auth-api.md | 183 ++++++++++++++++++ notes/dev/design/design-erp.md | 68 +++++++ notes/dev/design/design-iam.md | 31 +++ notes/dev/dev-faq.md | 66 +++++++ notes/dev/dict.md | 30 ++- notes/dev/format/tar.md | 12 ++ notes/dev/timezone.md | 41 ++++ notes/economics/economics-glossary.md | 15 ++ notes/os/linux/libc/README.md | 19 +- notes/os/linux/linux-awesome.md | 3 + notes/os/linux/shell/ssh/ssh-faq.md | 5 + notes/os/linux/sys/syscall.md | 74 ++++++- notes/os/mobile.md | 8 +- notes/os/virt/virt-glossary.md | 10 + notes/os/virt/virt-nested.md | 25 ++- notes/platform/README.md | 3 + notes/platform/apple/apple-faq.md | 5 + notes/platform/netflix.md | 4 +- notes/platform/platform-awesome.md | 60 +----- notes/platform/platform-pricing.md | 77 ++++++++ notes/queue/nats/README.md | 7 +- notes/service/analytics/utm.md | 8 +- notes/service/api/api-awesome.md | 50 +++-- notes/service/api/api-design.md | 5 + notes/service/api/graphql/graphql-awesome.md | 55 +++++- notes/service/api/graphql/graphql-faq.md | 5 + notes/service/api/graphql/graphql-schema.md | 17 ++ notes/service/api/graphql/type-graphql.md | 10 + notes/service/cms/astro.md | 2 + notes/service/cms/docusaurus.mdx | 8 + notes/service/cms/strapi/README.md | 2 + notes/service/cn/business/README.md | 16 ++ notes/service/cn/cn-glossary.md | 1 + notes/service/cn/isp.md | 18 +- notes/service/dns/gfwlist.txt | 2 + notes/service/forge/forge-awesome.md | 16 +- notes/service/forge/gitea/gitea-conf.md | 36 ++++ notes/service/media/media-awesome.md | 49 +++-- notes/service/network/spec/mdns/mdns-sd.md | 37 +++- notes/service/network/spec/mdns/mdns.md | 24 --- notes/service/office/docxjs.md | 9 + notes/service/office/office-awesome.md | 13 +- notes/service/service-awesome.md | 9 - notes/service/storage/s3.md | 1 + notes/service/storage/storage-awesome.md | 4 +- notes/service/storage/storage-faq.md | 25 ++- notes/service/workflow/workflow-faq.md | 15 ++ notes/service/workflow/xstate.md | 1 + notes/web/app.md | 8 + notes/web/browser/chrome/chrome-faq.md | 23 +++ notes/web/browser/chrome/chromium.md | 14 +- notes/web/dev/turbopack.md | 1 + notes/web/framework/nextjs/nextjs-app.md | 10 + notes/web/framework/nextjs/nextjs-conf.md | 99 +++++++++- notes/web/framework/prisma.md | 49 ++--- notes/web/framework/prisma1.md | 4 + notes/web/framework/remix/README.md | 11 +- notes/web/framework/taro.md | 3 +- notes/web/nodejs/mikro-orm.md | 14 ++ notes/web/nodejs/nodejs-awesome.md | 3 + notes/web/nodejs/package.json.md | 12 +- notes/web/react/antd.md | 6 +- notes/web/react/blueprint.md | 2 + notes/web/react/formik.md | 2 + notes/web/react/hermes.md | 2 + notes/web/react/react-awesome.md | 16 +- notes/web/react/react-hook-form.md | 30 ++- notes/web/react/react-spectrum.md | 15 ++ notes/web/script/js/js-awesome.md | 14 +- notes/web/script/typescript/typescript-faq.md | 30 ++- notes/web/spec/js-faq.md | 23 --- notes/web/web-faq.md | 10 + story/2022/2022-08-17-crm-trials.md | 34 +++- story/2023/2023-05-29-recover-synology.md | 2 + 79 files changed, 1397 insertions(+), 253 deletions(-) create mode 100644 notes/algorithm/monte-carlo.md create mode 100644 notes/dev/design/design-auth-api.md create mode 100644 notes/dev/design/design-erp.md create mode 100644 notes/dev/design/design-iam.md create mode 100644 notes/dev/format/tar.md create mode 100644 notes/os/virt/virt-glossary.md create mode 100644 notes/platform/platform-pricing.md create mode 100644 notes/service/api/graphql/graphql-schema.md create mode 100644 notes/service/api/graphql/type-graphql.md delete mode 100644 notes/service/network/spec/mdns/mdns.md create mode 100644 notes/service/office/docxjs.md create mode 100644 notes/web/app.md create mode 100644 notes/web/react/react-spectrum.md diff --git a/notes/ai/ai-awesome.md b/notes/ai/ai-awesome.md index 8740e5cd5f8..fee21656e1a 100644 --- a/notes/ai/ai-awesome.md +++ b/notes/ai/ai-awesome.md @@ -214,6 +214,7 @@ tags: - [janhq/jan](https://github.com/janhq/jan) - AGPLv3, Typescript - source alternative to ChatGPT that runs 100% offline +- [Hannibal046/Awesome-LLM](https://github.com/Hannibal046/Awesome-LLM) ## LLaMA @@ -308,7 +309,6 @@ tags: ## Awesome - - [webpilot-ai/Webpilot](https://github.com/webpilot-ai/Webpilot) - GPLv3 - [outlines-dev/outlines](https://github.com/outlines-dev/outlines) diff --git a/notes/ai/service/README.md b/notes/ai/service/README.md index c1ec01e41b4..735e1610829 100644 --- a/notes/ai/service/README.md +++ b/notes/ai/service/README.md @@ -4,3 +4,7 @@ tags: --- # AI Service + +- [OpenAI](./openai/README.md) +- anthropic + - claude diff --git a/notes/algorithm/monte-carlo.md b/notes/algorithm/monte-carlo.md new file mode 100644 index 00000000000..377158eb317 --- /dev/null +++ b/notes/algorithm/monte-carlo.md @@ -0,0 +1,9 @@ +--- +title: Monte-Carlo +--- + +# Monte-Carlo + +- 参考 + - [Monte-Carlo graph search from first principles](https://github.com/lightvector/KataGo/blob/master/docs/GraphSearch.md) + - [HN](https://news.ycombinator.com/item?id=39662698) diff --git a/notes/db/relational/mssql/README.md b/notes/db/relational/mssql/README.md index 9a6b197f888..d8514c63564 100644 --- a/notes/db/relational/mssql/README.md +++ b/notes/db/relational/mssql/README.md @@ -9,3 +9,13 @@ title: MSSQL | 1433 | default | | 1434 | browser service | +## 备份 + +- .bkf +- ntbackup 工具 +- [geocar/mtftar](https://github.com/geocar/mtftar) + - .bkf -> tar + +``` +Windows NTbackup archive NT, with file catalog, soft size 1*512, software (0x1200): Microsoft SQL Server +``` diff --git a/notes/db/relational/postgresql/postgresql-faq.md b/notes/db/relational/postgresql/postgresql-faq.md index 6e8f6654980..1f9be474224 100644 --- a/notes/db/relational/postgresql/postgresql-faq.md +++ b/notes/db/relational/postgresql/postgresql-faq.md @@ -890,3 +890,7 @@ on conflict(value) do update set (label)= (excluded.label); ``` on conflict(value) do update set (label,extensions)= (excluded.label,excluded.extensions); ``` + +## for update nowait - FOR UPDATE cannot be applied to the nullable side of an outer join + +- mikroorm LockMode.PESSIMISTIC_WRITE_OR_FAIL diff --git a/notes/dev/design/design-auth-api.md b/notes/dev/design/design-auth-api.md new file mode 100644 index 00000000000..b283d8f0946 --- /dev/null +++ b/notes/dev/design/design-auth-api.md @@ -0,0 +1,183 @@ +--- +tags: + - API +--- + +# Auth API + +- API Keys +- Basic Auth +- OAuth 2.0 +- HMAC +- 参考 + - [simov/grant](https://github.com/simov/grant) + - JS + - OAuth Proxy + - [simov/purest](https://github.com/simov/purest) + - REST API Client Library + - https://docs.strapi.io/dev-docs/plugins/users-permissions + - https://docs.directus.io/reference/authentication.html + +## strapi + +- Login /api/auth/local +- /connect/github/redirect +- `/api/connect/${provider}` +- `/api/auth/${provider}/callback` +- `/api/auth/forgot-password` +- `/api/auth/reset-password` +- `/api/auth/send-email-confirmation` +- `/api/auth/email-confirmation?confirmation=TOKEN` + +``` +POST /api/auth/local/register +``` + +```json +{ + "username": "Strapi user", + "email": "user@strapi.io", + "password": "strapiPassword" +} +``` + +**修改密码** + +``` +POST /api/auth/change-password +``` + +```json +{ + "currentPassword": "currentPassword", + "password": "userNewPassword", + "passwordConfirmation": "userNewPassword" +} +``` + +## directus + +### access token + +- by header +- by cookie +- by query + +``` +Authorization: Bearer +Cookie: directus_session_token= +``` + +``` +?access_token= +``` + +### login + +``` +POST /auth/login +POST /auth/login/provider +``` + +```json +{ + "email": "example@wener.com", + "password": "password", + "otp": "123456", + "mode": "jsoncookie|session" +} +``` + +```json +{ + "access_token": "", + "expires": 7200, + "refresh_token": "" +} +``` + +### refresh + +``` +POST /auth/refresh +``` + +```json +{ + "refresh_token": "refresh_token_string", + "mode": "json|cookie|session" +} +``` + +```json +{ + "access_token": "", + "expires": 7200, + "refresh_token": "" +} +``` + +### logout + +``` +POST /auth/logout +``` + +```json +{ + "refresh_token": "refresh_token", + "mode": "json" +} +``` + +### password reset + +``` +POST /auth/password/request +``` + +```json +{ + "email": "user_email", + "reset_url": "" +} +``` + +``` +POST /auth/password/reset +``` + +```json +{ + "token": "password_reset_token", + "password": "password" +} +``` + +### providers + +``` +GET /auth +``` + +```json +{ + "data": [ + { + "name": "GitHub", + "driver": "oauth2", + "icon": "github" + }, + { + "name": "Google", + "driver": "openid", + "icon": "google" + }, + { + "name": "Okta", + "driver": "openid" + } + ], + "disableDefault": false +} +``` diff --git a/notes/dev/design/design-erp.md b/notes/dev/design/design-erp.md new file mode 100644 index 00000000000..b017a6ced2e --- /dev/null +++ b/notes/dev/design/design-erp.md @@ -0,0 +1,68 @@ +--- +tags: + - ERP +--- + +# Design ERP + +## Resource + +- Resource - 资源 +- 通用概念 +- 主要实体都是资源 - 非主要实体例如: 中间表,中间实体 +- 基本操作 + - 增删改查 + - Owner - 管理者 分配、认领 - 个人 释放、转移 + - 导入导出 +- 扩展关联 + - label - 标签 - 预定义 + - tags - 标记 - 自定义 - 任意字符串 + - task - 任务 - 资源可能被关联到任务 + - activity - 活动 + - comment - 评论 +- 视图 + - 列表 - List + - 详情 - View/Detail + - Resource Overview + 多 Tab 视图 + - Summary + - 基本信息加活动跟进 + - Detail + - Activity + - File + - 创建表单 + - 编辑表单 - 如果是 inline 编辑可能会不太一样 + - Mention - 提及 - 显示被关联引用 + - Select/Picker - 选择关联引用 + - Popup/Overview/Profile - 弹出层预览 + +## CRM + +- 面向销售 +- 核心实体 + - Account - 客户 + - Contact - 联系人 + - Lead - 潜在客户 + - Opportunity - 商机 + - Activity - 活动 +- 辅助 + - Order - 销售订单 + - Product - 产品 +- 公共 + - Task - 任务 + - Event - 事件 + - Note - 备注 + - Attachment - 附件 + - Comment - 评论 + +## UI 状态 + +- Nothing/Before - An empty element + - https://emptystat.es/ +- Loading - A fetch is happening +- None - No items returned +- One - A single item comes back +- Some - A few items comes back +- Too Many - Too many items, need pagination (or similar) +- Incorrect - An error occurred +- Correct - A success happened +- Done - The operation finished diff --git a/notes/dev/design/design-iam.md b/notes/dev/design/design-iam.md new file mode 100644 index 00000000000..3f1663e392d --- /dev/null +++ b/notes/dev/design/design-iam.md @@ -0,0 +1,31 @@ +--- +title: IAM +--- + +# IAM + +- IAM -> Identity and Access Management + +## Google Cloud Platform IAM + +- 角色 + - 名称 + - 说明 + - ID + - 角色发布阶段 + - 权限 + - 类型 + - 自定义 + - 预定义 + - 状态 + - 已启用 + - 已停用 + - 待删除 +- 权限 + - 名称 + - 服务 + - 类型 +- appengine.applications.create + - 服务: appengine + - 资源: applications + - 操作: create diff --git a/notes/dev/dev-faq.md b/notes/dev/dev-faq.md index d907dc7f6e9..ca792149fe4 100644 --- a/notes/dev/dev-faq.md +++ b/notes/dev/dev-faq.md @@ -463,3 +463,69 @@ pip cache purge - Monorepo: please do - https://news.ycombinator.com/item?id=18820258 + + +## 链接超时 {#idle-connections} + +- 云平台会主动切断 idle 的链接,这个和局域网的链接不同 - 云平台 nat 资源 +- 应用需要主动 ping/keepalive 保持链接,否则从链接池里拿出来链接可能已经 timeout +- 操作系统层面可以配置 tcp keepalive 进行保活 +- 大多链接池都支持 + - IdleTimeout + - 建议小于 10 分钟 + - idle 时长,如果配置的比 平台/系统 层 idle 短,也能避免取到无效链接的问题 + - TestOnBorrow - 有一定性能影响 + - TestOnReturn + - TestWhileIdle - 影响小,但会浪费一定链接数量 + - 需要慎重考虑配置的 idle 数量 +- 链接池 + - apache commons-pool [GenericObjectPool](https://commons.apache.org/proper/commons-pool/apidocs/org/apache/commons/pool2/impl/GenericObjectPool.html) + - 支持 IdleTime, TestWhileIdle, TestOnCreate, TestOnBorrow, TestOnReturn + - HikariCP [HikariConfig](https://javadoc.io/doc/com.zaxxer/HikariCP/latest/com/zaxxer/hikari/HikariConfig.html) + - IdleTimeout, KeepaliveTime + - KeepaliveTime 检测 idle 的周期 + +**系统 TCP KeepAlive** + +- tcp_keepalive_time + - 上次数据包发送后,多久开始发送 keepalive + - 开始发送 keepalive 后,该值不在重要 + - TCP_KEEPIDLE +- tcp_keepalive_intvl + - 发送 keepalive 的间隔 + - TCP_KEEPINTVL +- tcp_keepalive_probes + - 多少次 unack 后认为链接已经断开,通知应用层 + - TCP_KEEPCNT + +```bash +# Linux +# 默认 7200,75,9 +# 2小时, 75s, 9次 +sysctl net.ipv4.tcp_keepalive_time net.ipv4.tcp_keepalive_intvl net.ipv4.tcp_keepalive_probes + +# 1分钟, 1分钟, 5次 +sysctl -w \ + net.ipv4.tcp_keepalive_time=60 \ + net.ipv4.tcp_keepalive_intvl=60 \ + net.ipv4.tcp_keepalive_probes=5 + +cat < Media Press / Media Platform - 媒体平台 + - https://mp.weixin.qq.com/s/Rg8NnCXGosouAm3NjkXu5Q + ## 服务系统 | 英文 | 含义 | 释义 | @@ -1084,6 +1094,17 @@ tags: - https://answers.sap.com/questions/8738184/specification-symbols-and-descriptor-symbols.html +## spec vs schema + +- schema - 模式、架构 + - 数据结构 + - 数据组织方式 + - 包含字段、数据类型、约束 +- spec - 规范 + - 执行标准 + - 细节规范 + - 包含 步骤、顺序、条件、操作细节 + ## tag vs label - label @@ -1315,6 +1336,13 @@ tags: - ZipCode - 特别是在美国使用的术语,是“Zone Improvement Plan Code”的缩写。 +## expiry vs expire_at vs end_at + +- expiry - 名词 + - 到期的时间点或期限 +- expire_at + - 动作的完成状态 + ## 参考 - primary diff --git a/notes/dev/format/tar.md b/notes/dev/format/tar.md new file mode 100644 index 00000000000..b66710808ef --- /dev/null +++ b/notes/dev/format/tar.md @@ -0,0 +1,12 @@ +--- +tags: + - tar +--- + +# tar + +- 没有统一的 table +- 顺序读取写入 - 适合 archive +- 参考 + - wikipedia [tar]() + - https://www.gnu.org/software/tar/manual/html_node/Standard.html diff --git a/notes/dev/timezone.md b/notes/dev/timezone.md index f51364b1ee1..6c401625c47 100644 --- a/notes/dev/timezone.md +++ b/notes/dev/timezone.md @@ -4,6 +4,24 @@ title: timezone # timezone +``` +2024-03-15T06:00:00.000+08:00 +``` + +| abbr. | for | offset | cn | +| ----- | -------------------------- | ------ | ---------------- | +| CST | China Standard Time | +08:00 | 中国标准时间 | +| UTC | Coordinated Universal Time | +00:00 | 世界协调时间 | +| GMT | Greenwich Mean Time | +00:00 | 格林尼治标准时间 | +| EST | Eastern Standard Time | -05:00 | 东部标准时间 | +| PST | Pacific Standard Time | -08:00 | 太平洋标准时间 | +| EDT | Eastern Daylight Time | -04:00 | 东部夏令时间 | +| PDT | Pacific Daylight Time | -07:00 | 太平洋夏令时间 | + +- [Time zone](https://en.wikipedia.org/wiki/Time_zone) + +## shell + ```bash adjtimex # 确认时间同步 date +%z # +0800 @@ -13,6 +31,29 @@ TZ=UTC date TZ=Asia/Shanghai date ``` +## JS Date.prototype.toJSON + +```js +// 默认 toJSON 为 UTC +const now = new Date(2021, 12, 12, 0, 0, 0); +// now.getTimezoneOffset() // local timezone offset +console.assert(now.toJSON() === now.toISOString()); +JSON.stringify({ now }); + +Date.prototype.toJSON = function () { + // return moment(this).format(); + // return format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx") // date-fns + return dayjs(this).format(); +}; +``` + +| method | format | +| ---------------------------------------------------- | ----------------------------- | +| now.toJSON() | 2022-01-11T16:00:00.000Z | +| moment(now).format() | 2022-01-12T00:00:00+08:00 | +| dayjs(now).format() | 2022-01-12T00:00:00+08:00 | +| date-fns format(now, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx") | 2022-01-12T00:00:00.000+08:00 | + ## Java - JVM `-Duser.timezone=Asia/Shanghai` diff --git a/notes/economics/economics-glossary.md b/notes/economics/economics-glossary.md index f8aebc2a2e3..473d2143d9a 100644 --- a/notes/economics/economics-glossary.md +++ b/notes/economics/economics-glossary.md @@ -26,6 +26,21 @@ tags: 常见的股票指数主要反映特定股票市场或股票市场部分的表现,以下是一些全球知名的股票指数: +## Bank + +- SwiftCode/BIC + - 国际银行账号识别码,用于国际交易。 + - [SWIFT](https://www.swift.com/) + - [BIC](https://en.wikipedia.org/wiki/ISO_9362) +- RoutingNumber/SortCode + - 用于美国和英国的银行账号识别码。 +- IBAN - International Bank Account Number + - [IBAN](https://en.wikipedia.org/wiki/International_Bank_Account_Number) + - [IBAN](https://www.iban.com/) +- Account Type + - 储蓄账户、支票账户、商业账户 +- ABA - American Bankers Association + ## 股票指数 - 美国 diff --git a/notes/os/linux/libc/README.md b/notes/os/linux/libc/README.md index 4b5d43677b1..6c58e8577af 100644 --- a/notes/os/linux/libc/README.md +++ b/notes/os/linux/libc/README.md @@ -4,12 +4,29 @@ title: libc # libc +- 大部分功能是桥接系统和用户空间 + - [syscall](../sys/syscall.md) +- [musl](./musl/README.md) +- glibc - [jart/cosmopolitan](https://github.com/jart/cosmopolitan) - ISC, C - build-once run-anywhere c library -- 大部分功能是桥接系统和用户空间 - [Comparison of C/POSIX standard library implementations for Linux](http://www.etalabs.net/compare_libcs.html) - Linux nolibc - https://github.com/torvalds/linux/blob/master/tools/include/nolibc/nolibc.h - https://lwn.net/Articles/920158/ - https://news.ycombinator.com/item?id=34479284 + +## ld.so + +- dynamic linker/loader +- ldd 可用于查看共享库依赖 +- 主要功能 + - 加载共享库 + - 符号解析 + - 重定位 + - 处理依赖 + - 运行初始化代码 +- LD_LIBRARY_PATH - 搜索路径 +- LD_PRELOAD - 预加载共享库 +- /etc/ld.so.conf diff --git a/notes/os/linux/linux-awesome.md b/notes/os/linux/linux-awesome.md index 98386807609..71ed8c98838 100644 --- a/notes/os/linux/linux-awesome.md +++ b/notes/os/linux/linux-awesome.md @@ -68,6 +68,9 @@ tags: - [google/nsjail](https://github.com/google/nsjail) - Apache-2.0, C++ - light-weight process isolation tool +- [containers/bubblewrap](https://github.com/containers/bubblewrap) + - GPLv2, C + - Low-level unprivileged sandboxing tool used by Flatpak ## 有趣 diff --git a/notes/os/linux/shell/ssh/ssh-faq.md b/notes/os/linux/shell/ssh/ssh-faq.md index d8ffa4d4779..824c526d478 100644 --- a/notes/os/linux/shell/ssh/ssh-faq.md +++ b/notes/os/linux/shell/ssh/ssh-faq.md @@ -43,6 +43,11 @@ from="192.168.1.10",command="/usr/bin/ls" ssh-rsa XXX 不允许 PortForward,需要开启 +``` +Match User admin + AllowTcpForwarding yes +``` + ## 端口转发 - -L/LocalForward 本地转发 diff --git a/notes/os/linux/sys/syscall.md b/notes/os/linux/sys/syscall.md index 5a349ccbaa2..68eadb3d93a 100644 --- a/notes/os/linux/sys/syscall.md +++ b/notes/os/linux/sys/syscall.md @@ -4,13 +4,59 @@ title: syscall # syscall +- Ring 0 - 内核态 + - 初始化中断或异常处理机制 + - 代码可以直接访问硬件、管理内存和执行CPU的所有指令集 + - 内核和驱动程序 +- Ring 1 & Ring 2 - 很少使用 - 例如 驱动程序 +- Ring 3 - 用户态 + - 不能直接访问硬件或执行某些敏感的CPU指令 + - 通过 系统调用/syscall 访问内核态 + +--- + +- 汇编指令 + - x86 `int 0x80` + - IDT - Interrupt Descriptor Table - 中断描述符表 + - 0x80 - 0x85 + - `lidt` - load IDT + - x86-64 `syscall` + - MSR - Model Specific Register - 模型特定寄存器 + - `rdmsr` - read MSR + - `wrmsr` - write MSR + - arm `swi 0` - software interrupt + - aaarch64 `svc #0` - supervisor call +- 当 linux 完成 init 之后 syscall 就是唯一的用户态和内核态交互方式 + - 设置系统调用表 + - `arch/x86/include/generated/uapi/asm/unistd_64.h` - 调用号 + - `arch/x86/entry/syscalls/syscall_64.tbl` + - 初始化中断或异常处理机制 + - 配置用户空间到内核空间的切换 + +:::tip + +- 大多数应用通过 libc 的封装调用 syscall + - 例如 `write`, `read` 而不是 `syscall(SYS_write, 1, "Hello, world!\n", 14)` + - 大多动态依赖 libc - 引入环境依赖 + - 不少应用可通过静态链接 musl 来避免依赖 libc +- Golang 是直接调用 syscall - https://pkg.go.dev/syscall + - 不依赖 libc - 跨平台 + - 静态编译 + +::: + +```c +// SYS_write=1 +syscall(SYS_write, 1, "Hello, world!\n", 14); +``` + ```bash ausyscall 2 # open ausyscall --dump ``` -| N | name | -| --: | ----------------------- | +| N | name | note | +| --: | ----------------------- | ----------------------- | | 0 | read | | 1 | write | | 2 | open | @@ -323,12 +369,12 @@ ausyscall --dump | 309 | getcpu | | 310 | process_vm_readv | | 311 | process_vm_writev | -| 312 | kcmp | +| 312 | kcmp | Kernel Samepage Merging | | 313 | finit_module | | 314 | sched_setattr | | 315 | sched_getattr | | 316 | renameat2 | -| 317 | seccomp | +| 317 | seccomp | Secure Computing Mode | | 318 | getrandom | | 319 | memfd_create | | 320 | kexec_file_load | @@ -373,3 +419,23 @@ ausyscall --dump | 448 | process_mrelease | | 449 | futex_waitv | | 450 | set_mempolicy_home_node | + +- [seccomp.2](https://man7.org/linux/man-pages/man2/seccomp.2.html) + - 一种沙箱机制 + - SECCOMP_MODE_FILTER + - 通过回调函数过滤 syscall + - 过滤器适用 `BPF` 语言 +- [google/gvisor](https://github.com/google/gvisor) + - 拦截 syscall 实现容器隔离 + +# FAQ + +## BPF vs eBPF + +- BPF - Berkeley Packet Filter + - 1992年由Steven McCanne和Van Jacobson在BSD上实现 + - 用于过滤网络数据包 +- eBPF - extended Berkeley Packet Filter + - 2014年由Alexei Starovoitov在Linux内核中实现 + - 用于过滤系统调用 + - 提升内核监控和分析能力 diff --git a/notes/os/mobile.md b/notes/os/mobile.md index 336f91ef1b5..8ba5a231876 100644 --- a/notes/os/mobile.md +++ b/notes/os/mobile.md @@ -47,9 +47,15 @@ PORTLAND OR 97253-1776 ## Random Address +- https://www.meiguodizhi.com/ - https://codebeautify.org/random-street-address - https://www.randomlists.com/new-york-addresses - +- 免税州 + - 蒙大拿州(Montana) + - 俄勒冈州(Oregon) + - 阿拉斯加州(Alaska) + - 特拉华州(Delaware) + - 新罕布什尔州(New Hampshire) # FAQ - Wifi Calling -> WLAN Calling diff --git a/notes/os/virt/virt-glossary.md b/notes/os/virt/virt-glossary.md new file mode 100644 index 00000000000..982cc044097 --- /dev/null +++ b/notes/os/virt/virt-glossary.md @@ -0,0 +1,10 @@ +--- +tags: + - Glossary +--- + +# 虚拟化术语表 + +| abbr. | for | cn | +| ----- | --------------- | ------ | +| VM | Virtual Machine | 虚拟机 | diff --git a/notes/os/virt/virt-nested.md b/notes/os/virt/virt-nested.md index 6a2ca845550..fbafc5b5830 100644 --- a/notes/os/virt/virt-nested.md +++ b/notes/os/virt/virt-nested.md @@ -4,9 +4,15 @@ title: 嵌套虚拟化 # 嵌套虚拟化 +- VMCS shadowing + - VMCS - virtual machine control structure + - 2013 intel Haswell 硬件加速 +- [Nested virtualization](https://en.wikipedia.org/wiki/Nested_virtualization) + ## KVM -* [Nested Guests](https://www.linux-kvm.org/page/Nested_Guests) - * 当启动了嵌套虚拟机后,在未关闭嵌套的虚拟机之前,上层虚拟机无法迁移、保存、加载 + +- [Nested Guests](https://www.linux-kvm.org/page/Nested_Guests) + - 当启动了嵌套虚拟机后,在未关闭嵌套的虚拟机之前,上层虚拟机无法迁移、保存、加载 ```bash # intel @@ -23,11 +29,12 @@ modprobe kvm_intel -r ``` ## HyperV -* 要求 - * Windows Server 2016+, Windows 10+ - * Hyper-V VM 8+ - * Intel VT-x,EPT - * AMD 目前不支持 + +- 要求 + - Windows Server 2016+, Windows 10+ + - Hyper-V VM 8+ + - Intel VT-x,EPT + - AMD 目前不支持 ```powershell # ExposeVirtualizationExtensions 表示是否开启 @@ -36,5 +43,5 @@ Get-VMProcessor -VMName vm_name | fl * Set-VMProcessor -VMName vm_name -ExposeVirtualizationExtensions $true ``` -* 参考 - * [Hyper-V Nested Virtualization Explained](https://www.nakivo.com/blog/hyper-v-nested-virtualization-explained) +- 参考 + - [Hyper-V Nested Virtualization Explained](https://www.nakivo.com/blog/hyper-v-nested-virtualization-explained) diff --git a/notes/platform/README.md b/notes/platform/README.md index e6e3129bad6..5c5ee23e477 100644 --- a/notes/platform/README.md +++ b/notes/platform/README.md @@ -27,6 +27,9 @@ title: 平台 - https://status.digitalocean.com/ - https://status.linode.com/ - https://status.heroku.com/ +- Apple + - https://developer.apple.com/system-status/ + - https://www.apple.com/support/systemstatus/ ## Activity diff --git a/notes/platform/apple/apple-faq.md b/notes/platform/apple/apple-faq.md index cd70d221539..96322e74833 100644 --- a/notes/platform/apple/apple-faq.md +++ b/notes/platform/apple/apple-faq.md @@ -21,3 +21,8 @@ tags: ## Gift Card - https://www.apple.com/shop/gift-cards + +## 注册账号 + +- 只有在手机上能注册成功,Web 注册都是失败 +- https://appleid.apple.com/account diff --git a/notes/platform/netflix.md b/notes/platform/netflix.md index 59421e3d7cc..e8ec3e28285 100644 --- a/notes/platform/netflix.md +++ b/notes/platform/netflix.md @@ -110,4 +110,6 @@ curl http://api-global.netflix.com/apps/applefuji/config - 其他服务的检测方式 - https://github.com/jinwyp/one_click_script/blob/master/netflix_check.sh - https://github.com/sjlleo/netflix-verify -- 地区内容 https://unogs.com/countrydetail +- 地区内容 + - https://unogs.com/countrydetail + - https://www.tvguide.com/ diff --git a/notes/platform/platform-awesome.md b/notes/platform/platform-awesome.md index 7a41f1b84cc..5b2ba6a94f2 100644 --- a/notes/platform/platform-awesome.md +++ b/notes/platform/platform-awesome.md @@ -41,6 +41,9 @@ tags: - https://nervjs.github.io/taro/docs/ - https://zh.uniapp.dcloud.io/tutorial/miniprogram-subject.html - https://jaq-doc.alibaba.com/docs/doc.htm?treeId=478&articleId=120776&docType=1 +- 工具下载 + - [微信小程序/下载](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html) + - [Stable](https://developers.weixin.qq.com/miniprogram/dev/devtools/stable.html) ## 跨端小程序开发 @@ -142,60 +145,3 @@ tags: - [NordVPN](./nordvpn.md) - ExpressVPN - -## Subscriptions - -| service | month | annual | notes | -| -------------------------------- | ------------------: | -------------------------: | ------------------------- | -| **US** | -| ChatGPT Plus | $20/m/mo | -| ChatGPT Team | $30/user/mo | $25/user/y | -| Spotify Premium Duo | $14.99/mo | -| Spotify Premium Family | $16.99/mo | -| Netflix Standard with Ads | $7/mo | | FullHD, 2设备 | -| Netflix Standard | $15.5/mo+$8/slot/mo | | FullHD, 2设备, 1额外成员 | -| Netflix Premium | $23/mo+$8/slot/mo | | UltraHD, 4设备, 2额外成员 | -| NordVPN | $12.99/mo | $67.35/y,$102.33/2y | -| Jetbrains All Pack Organizations | $77.9/mo | $779/1st,$623/2nd,$467/3rd | -| Jetbrains All Pack Individual | $28.9/mo | $289/1st,$231/2nd,$173/3rd | -| Microsoft 356 Family for Home | $9.99/mo | $99.99/y | -| Microsoft 356 Personal for Home | $6.99/mo | $69.99/y | -| Google One Standard 200GB | $2.99/mo | $29.99/y | -| Google One Premium 2TB | $9.99/mo | $99.99/y | -| Google One Premium 5TB | $24.99/mo | $249.99/y | -| Google One Premium 10TB | $49.99/mo | | -| Apple Game Arcade | $6.99/mo | $49.9/y | -| Apple Music | $1.9/mo | $19.9/y | -| About iCloud+ 50GB | $0.99/mo | -| About iCloud+ 200GB | $2.99/mo | -| About iCloud+ 2TB | $9.99/mo | -| About iCloud+ 6TB | $29.99/mo | -| About iCloud+ 12TB | $59.99/mo | -| About Music Student | $5.99/mo | -| About Music Individual | $10.99/mo | -| About Music Family | $16.99/mo | -| Apple One Individual 50G | $19.95/mo | -| Apple One Family 200G | $25.95/mo | -| Apple One Premier 2T | $37.95/mo | -| **China mainland** | | -| About iCloud+ 50GB | ¥6 | -| About iCloud+ 200GB | ¥21 | -| About iCloud+ 2TB | ¥68 | -| About iCloud+ 6TB | ¥198 | -| About iCloud+ 12TB | ¥398 | - -- 10个月付12个月 - 节省 16% -- ChatGPT Team - - 更高的消息量 - - 数据不被用于训练 -- https://one.google.com/about/plans -- [iCloud+ plans and pricing](https://support.apple.com/en-hk/HT201238) -- https://www.apple.com/apple-one/ - - iCloud+ - - Apple TV+ - - Music - - Apple Arcade - - Apple Fitness+ - - Apple News+ -- https://www.apple.com/shop/buy-giftcard/giftcard -- https://www.microsoft.com/en-us/microsoft-365/buy/compare-all-microsoft-365-products diff --git a/notes/platform/platform-pricing.md b/notes/platform/platform-pricing.md new file mode 100644 index 00000000000..92bd2b71b4a --- /dev/null +++ b/notes/platform/platform-pricing.md @@ -0,0 +1,77 @@ +--- +tags: + - Pricing +--- + +# 平台定价 + +- Subscriptions + +| service | month | annual | notes | +| -------------------------------- | ------------------: | -------------------------: | ------------------------- | +| **US** | +| ChatGPT Plus | $20/m/mo | +| ChatGPT Team | $30/user/mo | $25/user/y | +| Spotify Premium Duo | $14.99/mo | +| Spotify Premium Family | $16.99/mo | +| Netflix Standard with Ads | $7/mo | | FullHD, 2设备 | +| Netflix Standard | $15.5/mo+$8/slot/mo | | FullHD, 2设备, 1额外成员 | +| Netflix Premium | $23/mo+$8/slot/mo | | UltraHD, 4设备, 2额外成员 | +| ExpressVPN 1 Year | $ 8.32/mo | $ 99.95/y | +| Jetbrains All Pack Organizations | $77.9/mo | $779/1st,$623/2nd,$467/3rd | +| Jetbrains All Pack Individual | $28.9/mo | $289/1st,$231/2nd,$173/3rd | +| Microsoft 356 Family for Home | $9.99/mo | $99.99/y | +| Microsoft 356 Personal for Home | $6.99/mo | $69.99/y | +| Google One Standard 200GB | $2.99/mo | $29.99/y | +| Google One Premium 2TB | $9.99/mo | $99.99/y | +| Google One Premium 5TB | $24.99/mo | $249.99/y | +| Google One Premium 10TB | $49.99/mo | | +| Apple Game Arcade | $6.99/mo | $49.9/y | +| Apple Music | $1.9/mo | $19.9/y | +| About iCloud+ 50GB | $0.99/mo | +| About iCloud+ 200GB | $2.99/mo | +| About iCloud+ 2TB | $9.99/mo | +| About iCloud+ 6TB | $29.99/mo | +| About iCloud+ 12TB | $59.99/mo | +| About Music Student | $5.99/mo | +| About Music Individual | $10.99/mo | +| About Music Family | $16.99/mo | +| Apple One Individual 50G | $19.95/mo | +| Apple One Family 200G | $25.95/mo | +| Apple One Premier 2T | $37.95/mo | +| **China mainland** | | +| About iCloud+ 50GB | ¥6 | +| About iCloud+ 200GB | ¥21 | +| About iCloud+ 2TB | ¥68 | +| About iCloud+ 6TB | ¥198 | +| About iCloud+ 12TB | ¥398 | +| **HK** | +| NordVPN Complete 2 Year | HKD$ 49/mo | HKD$ 1129/y | + +- 10个月付12个月 - 节省 16% +- ChatGPT Team + - 更高的消息量 + - 数据不被用于训练 +- https://one.google.com/about/plans +- [iCloud+ plans and pricing](https://support.apple.com/en-hk/HT201238) +- https://www.apple.com/apple-one/ + - iCloud+ + - Apple TV+ + - Music + - Apple Arcade + - Apple Fitness+ + - Apple News+ +- https://www.apple.com/shop/buy-giftcard/giftcard +- https://www.microsoft.com/en-us/microsoft-365/buy/compare-all-microsoft-365-products +- https://nordvpn.com/pricing/ + +## Gaming + +| service | month | annual | notes | +| -------------------------------------: | -------- | -------- | ------- | +| **US** | +| Nintendo Switch Online Family | | $34.99/y | 8个账号 | +| Nintendo Switch Online Individual | $3.99/mo | $19.99/y | 1个账号 | +| Nintendo Switch Online Family + 扩展包 | | $79.99/y | 8个账号 | +| Nintendo Switch Online + 扩展包 | | $49.99/y | | +| PlayStation Plus | | diff --git a/notes/queue/nats/README.md b/notes/queue/nats/README.md index 151f58b4ca4..832179bcc9d 100644 --- a/notes/queue/nats/README.md +++ b/notes/queue/nats/README.md @@ -7,8 +7,13 @@ title: NATS :::tip - 支持 JetStreaming -- 支持 WebSocket +- 支持 WebSocket - 能够利用 HTTP 基础设施 - 支持 JWT Auth +- 支持 Auth Resolver - 通过 nats service 监听实现自定义 auth +- 支持 Group Consumer +- 支持 RPC -> Load Balance - Request/Reply +- 支持 KV +- 支持 ObjectStore ::: diff --git a/notes/service/analytics/utm.md b/notes/service/analytics/utm.md index e80300d8bac..74d4d953860 100644 --- a/notes/service/analytics/utm.md +++ b/notes/service/analytics/utm.md @@ -25,18 +25,22 @@ tags: - utm_source,utm_medium,utm_campaign - GA4 必填 - utm_source,utm_medium + +## 参考 + - [UTM 参数](https://en.wikipedia.org/wiki/UTM_parameters) - https://ga-dev-tools.google/campaign-url-builder/ +- [GA4 Collect campaign data with custom URLs](https://support.google.com/analytics/answer/10917952) - [Urchin]() - [Collect campaign data with custom URLs](https://support.google.com/analytics/answer/1033863) -- 百度统计 https://tongji.baidu.com/web/help/article?id=262&type=0 +- [百度统计/hm参数与utm参数的对应关系](https://tongji.baidu.com/web/help/article?id=262&type=0) - utm_source=hmsr - 媒体平台参数,一般用于标识广告投放的广告主、网站等信息,该参数为必填的物料信息。 - utm_medium=hmpl - 计划名称参数,一般用于标识广告所属的推广计划信息,只有设置了推广计划信息,才可以设置推广单元信息。 - utm_campaign=hmcu - 单元名称参数,一般用于标识广告所属的推广单元信息,只有设置了推广单元信息,才可以设置关键词和创意信息。 - utm_term=hmkw - 关键词参数,一般用于标识触发广告的关键词信息。 - utm_content=hmci - 创意参数,一般用于标识广告的创意形式信息。 - Matomo - - utm -> mtm + - 使用 mtm 前缀 - utm -> mtm - 额外参数 - mtm_group, mtm_placement - https://matomo.org/faq/general/faq_119/ diff --git a/notes/service/api/api-awesome.md b/notes/service/api/api-awesome.md index cea436d5cf7..aa2a3155368 100644 --- a/notes/service/api/api-awesome.md +++ b/notes/service/api/api-awesome.md @@ -279,19 +279,6 @@ tags: - [api-platform/api-platform](https://github.com/api-platform/api-platform) - Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time. -## 管理 {#management} - -- [YMFE/yapi](https://github.com/YMFE/yapi) - - YMFE 去哪儿网 - - 商业产品 apifox -- [thx/rap2-delos](https://github.com/thx/rap2-delos) - - http://rap2.taobao.org/ -- [thx/RAP](https://github.com/thx/RAP) -- [sx1989827/DOClever](https://github.com/sx1989827/DOClever) -- https://www.eolinker.com/ -- https://www.getpostman.com/ -- https://paw.cloud/ -- [RecipeUI/RecipeUI](https://github.com/RecipeUI/RecipeUI) ## Doc @@ -305,11 +292,21 @@ tags: - [syroegkin/swagger-markdown](https://github.com/syroegkin/swagger-markdown) - 只支持 v2 -## Tool - +## API IDE/Client + +- [usebruno/bruno](https://github.com/usebruno/bruno) + - MIT, JS, TS + - ightweight alternative to postman/insomnia + - 自定义的 [bru](https://www.usebruno.com/bru) 格式 + - https://www.brulang.org/ + - [Why bru](https://github.com/usebruno/bruno/discussions/360) + - 通过 Desktop APP、CLI、VSC Extension + - HN https://news.ycombinator.com/item?id=39653718 + - [vs Postman](https://www.usebruno.com/compare/bruno-vs-postman) - [Hoppscotch](./hoppscotch.md) - MIT, Vue+Typescript - 不能持久化 + - 支持 OpenAPI, GraphQL - [Kong/insomnia](https://github.com/Kong/insomnia) - MIT, JS+TS - GraphQL, REST, WebSockets, gRPC @@ -319,12 +316,31 @@ tags: - self-hosted, collaborative API development environment - SoapUI - [kubeshop/tracetest](https://github.com/kubeshop/tracetest) -- Postman - [mquan/api2ai](https://github.com/mquan/api2ai) - Create API agents from OpenAPI Specs - [ShishirPatil/gorilla](https://github.com/ShishirPatil/gorilla) - API store for LLMs - +- Markup + - bru + - JB [HTTP Client](https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html) + - [Orange-OpenSource/hurl](https://github.com/Orange-OpenSource/hurl) + - https://hurl.dev/ +- Testing + - [stepci/stepci](https://github.com/stepci/stepci) + - MPLv2, TS + - Automated API Testing and Quality Assurance +- 商业 + - https://www.eolinker.com/ + - [Postman](https://www.getpostman.com/) + - https://paw.cloud/ +- [YMFE/yapi](https://github.com/YMFE/yapi) + - YMFE 去哪儿网 + - 商业产品 apifox +- [thx/rap2-delos](https://github.com/thx/rap2-delos) + - http://rap2.taobao.org/ +- [thx/RAP](https://github.com/thx/RAP) +- [sx1989827/DOClever](https://github.com/sx1989827/DOClever) +- [RecipeUI/RecipeUI](https://github.com/RecipeUI/RecipeUI) ## Codegen - [OpenAPITools/openapi-generator](https://github.com/OpenAPITools/openapi-generator) diff --git a/notes/service/api/api-design.md b/notes/service/api/api-design.md index 13187363f3b..feb7aac27d3 100644 --- a/notes/service/api/api-design.md +++ b/notes/service/api/api-design.md @@ -395,3 +395,8 @@ interface Cursor { ``` where id ${direction === 'asc' ? '>' : '<'} ${id} ``` + +## Naming + +- Pagination +- PaginationInfo diff --git a/notes/service/api/graphql/graphql-awesome.md b/notes/service/api/graphql/graphql-awesome.md index 86b1f887bb0..1d71637724c 100644 --- a/notes/service/api/graphql/graphql-awesome.md +++ b/notes/service/api/graphql/graphql-awesome.md @@ -35,6 +35,47 @@ tags: - [TAO: The power of the graph](https://engineering.fb.com/2013/06/25/core-data/tao-the-power-of-the-graph/) - [howtographql](https://github.com/howtographql/howtographql) +## 决策 {#decision} + +- Code first or GraphQL Schema first + - Code - Code to Schema + - 可读性好,但是需要手动维护,可以复用现有代码 + - Schema - Schema to Code + - 生成很多代码,可读性交较差,但是可以快速搭建原型 +- 动态Schema vs 静态Schema + - 动态 + - 可以根据租户自定义 - 类似动态 CMS + - 可以根据角色自定义 - conditional schema + - 静态 + - 可以手写 + - 可以一次性生成 +- DB Schema first or Entity first + - DB Schema + - 更好的掌控数据库结构 + - 更好的利用数据库特性 + - Entity + - 可能考虑支持多数据库 +- Prototype 阶段 还是 Production 阶段 + - Prototype + - DB -> GraphQL - 只是做简单的接口封装 + - Production + - 要求 DB 设计合理 + - DB Schema first + - 预留扩展 +- 是否需要 类型安全 + - 影响怎么做 schema builder + - 什么程度的 类型安全 + - 全局 + - 输入输出校验 + - 一定程度增加 维护 + - 一定程度增加 写代码 的难度 +- 是否需要 subscriptions + - 要求感知 修改 +- 是否需要 federation/gateway +- 是否需要 dataloader +- 是否需要 relay + - Node, Connection, clientMutationId + ## 设计 {#design} - [GraphQL 最佳实践](https://graphql.org/learn/best-practices) @@ -89,7 +130,6 @@ tags: - [Khan/genqlient](https://github.com/Khan/genqlient) - type-safe Go GraphQL client - Typescript - - [MichalLytek/type-graphql](https://github.com/MichalLytek/type-graphql) - [enisdenjo/graphql-ws](https://github.com/enisdenjo/graphql-ws) - [PROTOCOL](https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md) - [99designs/gqlgen#1430](https://github.com/99designs/gqlgen/issues/1430) 不支持 graph-transport-ws @@ -124,18 +164,19 @@ tags: - graphql - GraphQLSchema - Schema/TypeScript Code First - - [MichalLytek/type-graphql](https://github.com/MichalLytek/type-graphql) + - [MichalLytek/type-graphql](./type-graphql.md) - MIT, Typescript - 注解/修饰器 方式 - - 功能很好,开发不足 - - [hayes/pothos](https://github.com/hayes/pothos) + - [hayes/pothos](./pothos.md) - ISC, Typescript - @pothos/core - 强类型,类似 zod 方式构建 schema - infer 推导类型 + - ⚠️ 写起来有些繁琐 - [graphql-nexus/nexus](https://github.com/graphql-nexus/nexus) - MIT, Typescript - nexus + - ⚠️ 开发不活跃 - 通过代码生成,确保类型 - [IvanGoncharov/graphql-faker](https://github.com/IvanGoncharov/graphql-faker) - mock graphql @@ -149,8 +190,10 @@ tags: > Server, Federation, Gateway, Adapter - NodeJS - - [apollographql/apollo-server] - [graphql-yoga](./graphql-yoga.md) + - 👍 适合各种场景,支持不同的 schema 构建方式 + - 简单轻量 + - [apollographql/apollo-server] - [graphile/postgraphile](https://github.com/graphile/postgraphile) - PostgreSQL -> GraphQL - [zalando-incubator/graphql-jit](https://github.com/zalando-incubator/graphql-jit) @@ -170,6 +213,8 @@ tags: - [ent/ent](https://github.com/ent/ent) - [Apollo Federation specification](https://www.apollographql.com/docs/federation/federation-spec/) - [hasura/graphql-engine](https://github.com/hasura/graphql-engine) +- [dosco/graphjin](https://github.com/dosco/graphjin) + - Apache-2.0, Go - [parse-community/parse-server](https://github.com/parse-community/parse-server) - [dgraph-io/dgraph](https://github.com/dgraph-io/dgraph) - [directus/directus](https://github.com/directus/directus) diff --git a/notes/service/api/graphql/graphql-faq.md b/notes/service/api/graphql/graphql-faq.md index 5e2d740d3ae..6e65eae8c03 100644 --- a/notes/service/api/graphql/graphql-faq.md +++ b/notes/service/api/graphql/graphql-faq.md @@ -6,6 +6,11 @@ tags: # GraphQL FAQ +```bash +# 服务端 常用依赖 +pnpm add graphql graphql-scalars +``` + ## Apollo vs Relay vs URQL - [URQL](https://github.com/FormidableLabs/urql) diff --git a/notes/service/api/graphql/graphql-schema.md b/notes/service/api/graphql/graphql-schema.md new file mode 100644 index 00000000000..ba14b958a9a --- /dev/null +++ b/notes/service/api/graphql/graphql-schema.md @@ -0,0 +1,17 @@ +--- +tags: +- Schema +--- + +# GraphQL Schema + +- Scalar + - Int + - Float + - String + - Boolean + - ID +- 常见自定义 Scalar + - Date -> Timestamp, DateTime, DateTimeISO + - JSON + - JSONObject diff --git a/notes/service/api/graphql/type-graphql.md b/notes/service/api/graphql/type-graphql.md new file mode 100644 index 00000000000..a7deb9798a9 --- /dev/null +++ b/notes/service/api/graphql/type-graphql.md @@ -0,0 +1,10 @@ +--- +tags: + - Typescript +--- + +# TypeGraphQL + +- [MichalLytek/type-graphql](https://github.com/MichalLytek/type-graphql) + - MIT, Typescript + - 注解/修饰器 方式 diff --git a/notes/service/cms/astro.md b/notes/service/cms/astro.md index 5ef10b08aa6..75ea08a8ed7 100644 --- a/notes/service/cms/astro.md +++ b/notes/service/cms/astro.md @@ -5,6 +5,8 @@ title: Astro # Astro - [snowpackjs/astro](https://github.com/snowpackjs/astro) + - web framework for content-driven websites + - 支持非常多的框架: React, Preact, Svelte, Vue, Solid, Lit, AlpineJS - 静态站点生成+动态集成能力 - 支持集成各种框架 - .astro 一种组件格式,面向静态站点生成 diff --git a/notes/service/cms/docusaurus.mdx b/notes/service/cms/docusaurus.mdx index 0ad692988a0..bacda48db77 100644 --- a/notes/service/cms/docusaurus.mdx +++ b/notes/service/cms/docusaurus.mdx @@ -487,3 +487,11 @@ module.exports = { - import-fresh v3 ➡️ jiti v1 - remark-emoji v2 ➡️ v4 - https://docusaurus.io/blog/releases/3.0 + + +## Search +- Algolia DocSearch +- typesense + - 不支持 CJK +- [meilisearch](https://github.com/tauri-apps/meilisearch-docsearch) +- https://docusaurus.io/docs/search diff --git a/notes/service/cms/strapi/README.md b/notes/service/cms/strapi/README.md index 695bd72efca..a3ecbdbeb31 100644 --- a/notes/service/cms/strapi/README.md +++ b/notes/service/cms/strapi/README.md @@ -30,6 +30,8 @@ title: Strapi npx -y create-strapi-app@latest --ts --quickstart --use-npm --no-run my-project cd my-strapi +# pnpm works + # https://docs.strapi.io/dev-docs/plugins/i18n # https://github.com/strapi/strapi/blob/v4.20.2/packages/plugins/i18n/server/src/constants/iso-locales.json npm run strapi install i18n graphql documentation diff --git a/notes/service/cn/business/README.md b/notes/service/cn/business/README.md index fa7515dcc75..7f406e076f7 100644 --- a/notes/service/cn/business/README.md +++ b/notes/service/cn/business/README.md @@ -236,3 +236,19 @@ title: 企业服务行业 - 园区资源 - 园区落户 - 园区政策 + +## 公司注册服务流程 + +- 在线申报 - 递交材料到在线网报系统 +- 名字核准 - 工商局核准公司名称,提供的名字预审通过 +- 客户网签 - 客户通过 APP 完成认证 +- 领取营业执照 +- 材料交接 - 快递材料 + +--- + +- 开设公司银行账户 +- 税务登记 +- 社保登记 +- 刻制公章 +- 办理专业许可证 diff --git a/notes/service/cn/cn-glossary.md b/notes/service/cn/cn-glossary.md index 9366bfca563..df923c57dbf 100644 --- a/notes/service/cn/cn-glossary.md +++ b/notes/service/cn/cn-glossary.md @@ -13,6 +13,7 @@ tags: | zh | en | note | | ------------ | ---------------------------------------------- | ---------------------------------- | +| 个体户 | self-employed | 个体工商户,个体经营 | | 个体工商户 | privately or individually-owned business | | 个体工商户 | Individual Industrial and Commercial Household | | 个体工商户 | Individual business | 国务院法制办公室《民法通则》英译本 | diff --git a/notes/service/cn/isp.md b/notes/service/cn/isp.md index 2d8f13ab712..6e5fb58b07c 100644 --- a/notes/service/cn/isp.md +++ b/notes/service/cn/isp.md @@ -6,10 +6,18 @@ title: ISP ## 带宽 -- 电信互联网专线 https://www.189.cn/xj/support/tariff/adsl/30970.html +- 电信互联网专线 - 50M 约 3W/年 -- 联通专线 http://www.1010sh.com/ltgxdxwzx +- 联通专线 - 50M 约 3W/年 -- https://www.aliyun.com/price/product#/commodity/eip_pre - - 50M 约 4W/年 -- http://www.001kd.com/dxdata.html +- 阿里云 EIP https://help.aliyun.com/zh/eip/product-overview/pay-as-you-go + - 上海 BGP + - 50MB ¥3,725/月 + - 100MB ¥7,725/月 + - 按量 ¥0.8/GB + ¥0.02/小时 +- 移动互联网专线 - IPv4+80 443 + - 上海 14元/MB/月 + - 50MB 700元/月 - 8400元/年 + - 100M 1400元/月 - 16800元/年 + - 宁波 10元/MB/月 +- 移动 SD-WAN - 访问国际互联网 diff --git a/notes/service/dns/gfwlist.txt b/notes/service/dns/gfwlist.txt index f318f53a1aa..fb71b8b1286 100644 --- a/notes/service/dns/gfwlist.txt +++ b/notes/service/dns/gfwlist.txt @@ -22,6 +22,7 @@ blogspot.com cdninstagram.com cdnjs.com centos.org +chatgpt.com chocolatey.org chrome.com chromecast.com @@ -47,6 +48,7 @@ dribbble.com elixir-lang.org elrepo.org erlang.org +expressvpn.com f8.com facebook.br facebook.com diff --git a/notes/service/forge/forge-awesome.md b/notes/service/forge/forge-awesome.md index 7051d7d27d2..ba7afc5c113 100644 --- a/notes/service/forge/forge-awesome.md +++ b/notes/service/forge/forge-awesome.md @@ -12,10 +12,12 @@ tags: - [vs Git](https://fossil-scm.org/home/doc/trunk/www/fossil-v-git.wiki) - [whynotgit](https://www.sqlite.org/whynotgit.html) - Hosted - - gitee - - [github](./github.md) + - [github](./github/README.md) - gitee - CI/CD Jenkins,GiteeGo + - [gitlab](./gitlab/README.md) + - bitbucket + - Sourcehut - [coding](./coding.md) - 腾讯 - CI/CD Jenkins @@ -32,16 +34,18 @@ tags: - SLOC trend - https://code.onedev.io/ - [gitlab](./gitlab/README.md) - - 非常重 - - [gitea](./gitea.md) + - 非常重,不建议 + - [gitea](./gitea/README.md) - 轻量级 - 内置 package - - 无 CI/CD - 可外置 drone + - [gitea action](./gitea/gitea-action.md) + - fork Gogs 继续开发 - gogs + - 开发停滞,治理不好 - [gitness](https://github.com/harness/gitness) - Apache-2.0, Golang - by Harness - - Drone 参考重命名为了 gitness + - Drone Code 重命名为了 gitness - Drone 3.0 ~-> Drone+/Code - https://news.ycombinator.com/item?id=37598082 - Harness 名声不太好 diff --git a/notes/service/forge/gitea/gitea-conf.md b/notes/service/forge/gitea/gitea-conf.md index 8d928cd55aa..043c9c432c0 100644 --- a/notes/service/forge/gitea/gitea-conf.md +++ b/notes/service/forge/gitea/gitea-conf.md @@ -75,3 +75,39 @@ MINIO_BASE_PATH=actions_log/ - 需要 mirror 太多仓库 - 需要 gitea 公开访问 - 推荐 uses 写完整 url,例如: https://gitea.com/actions/checkout@v3 + + +## indexer + +```ini +[indexer] + +ISSUE_INDEXER_TYPE = bleve +ISSUE_INDEXER_PATH = indexers/issues.bleve + +ISSUE_INDEXER_CONN_STR = +ISSUE_INDEXER_NAME = gitea_issues + +STARTUP_TIMEOUT = 30s + +# Repo +# ========== +REPO_INDEXER_ENABLED = false + +# sources,forks,mirrors,templates +REPO_INDEXER_REPO_TYPES = sources + +# bleve, elasticsearch +REPO_INDEXER_TYPE = bleve +REPO_INDEXER_PATH = indexers/repos.bleve + +# ES +# ---------- +# http://elastic:changeme@localhost:9200 +REPO_INDEXER_CONN_STR = +REPO_INDEXER_NAME = gitea_codes + +REPO_INDEXER_INCLUDE = +REPO_INDEXER_EXCLUDE = +MAX_FILE_SIZE = +``` diff --git a/notes/service/media/media-awesome.md b/notes/service/media/media-awesome.md index 7793ea60fcc..845f1bf39ee 100644 --- a/notes/service/media/media-awesome.md +++ b/notes/service/media/media-awesome.md @@ -16,9 +16,31 @@ tags: - [termusic](https://github.com/tramhao/termusic) - [MusicPlayerDaemon](./player/mpd.md) +## Metadata + +- Audio/Music + - [taglib/taglib](https://github.com/taglib/taglib) + - https://taglib.org/ + - TagLib Audio Meta-Data Library +- Anime + - https://anidb.net/ + - https://anidb.net/group/15631 +- Movie & Shows + - https://www.imdb.com/interfaces/ + - openmovie + - TMDB https://www.themoviedb.org/documentation/api +- Subtitles + - opensubtitle + - https://www.media.io/ +- Artwork + - Discogs https://www.discogs.com/ + - Cover Art Archive https://coverartarchive.org/ + ## Music Server - [navidrome/navidrome](https://github.com/navidrome/navidrome) + - GPLv3, Go + - Modern Music Server and Streamer compatible with Subsonic/Airsonic - [owntone/owntone-server](./server/owntone.md) - GPLv2, C+Vue - 🌟 推荐 - WebUI, 支持较多客户端 @@ -43,8 +65,6 @@ tags: - [nukeop/nuclear](https://github.com/nukeop/nuclear) - AGPLv3, TS - Streaming music player that finds free music for you -- [navidrome/navidrome](https://github.com/navidrome/navidrome) - - GPL-3.0, Go - [airsonic-advanced/airsonic-advanced](https://github.com/airsonic-advanced/airsonic-advanced) - GPL-3.0, Java - [mpache/ampache](https://github.com/ampache/ampache) @@ -53,6 +73,10 @@ tags: - Ogg Vorbis and MP3 streaming media server - Gerbera - UPnP media server +- Subsonic +- Airsonic +- [ironsmile/euterpe](https://github.com/ironsmile/euterpe) + - GPLv3, Go ## Media Server @@ -337,21 +361,6 @@ for i in *.mkv; do mkvpropedit $i -d title; done for i in *.mkv; do mkvpropedit $i --edit track:v1 --delete name; done ``` -## Metadata - -- Anime - - https://anidb.net/ - - https://anidb.net/group/15631 -- Movie & Shows - - https://www.imdb.com/interfaces/ - - openmovie - - TMDB https://www.themoviedb.org/documentation/api -- Subtitles - - opensubtitle - - https://www.media.io/ -- Artwork - - Discogs https://www.discogs.com/ - - Cover Art Archive https://coverartarchive.org/ ## Protocol @@ -373,3 +382,9 @@ for i in *.mkv; do mkvpropedit $i --edit track:v1 --delete name; done - [AaronFeng753/Waifu2x-Extension-GUI](https://github.com/AaronFeng753/Waifu2x-Extension-GUI) - 图片放大 + +## Awesome + +- [CoderLine/alphaTab](https://github.com/CoderLine/alphaTab) + - MPL-2.0, TS + - cross platform music notation and guitar tablature rendering diff --git a/notes/service/network/spec/mdns/mdns-sd.md b/notes/service/network/spec/mdns/mdns-sd.md index d97d95ccbbd..f871618b0c9 100644 --- a/notes/service/network/spec/mdns/mdns-sd.md +++ b/notes/service/network/spec/mdns/mdns-sd.md @@ -1,7 +1,7 @@ --- title: mDNS 服务定义 commands: -- dns-sd + - dns-sd --- # mDNS 服务定义 @@ -115,3 +115,38 @@ avahi-browse _ssh._tcp -tr | type | port | txt | | ----------------------- | ---- | ------------- | | `_prometheus-http._tcp` | 9100 | path=/metrics | + +## leboremote + +- `_leboremote._tcp` +- HappyCast +- lebo - 乐播投屏 https://www.lebo.cn/ +- 小米电视 + +| key | value | +| ----------- | -------------------------- | +| omd | Andlink | +| a | 10088 | +| hstv | 320.00 | +| hmd | HappyCast3.2 | +| etv | 1 | +| atv | 0 | +| htv | 1 | +| vv | 2 | +| appInfo | 0 | +| ver | 2.0 | +| u | 10000633013734 | +| packagename | com.xiaomi.mitv.smartshare | +| lebofeature | 255 | +| feature | 255 | +| channel | LEBO-APK--60033-23516 | +| mirror | 7100 | +| devicemac | MAC | +| lelinkport | 52266 | +| remote | 52266 | +| airplay | 52266 | +| raop | 52266 | +| h | 1080 | +| w | 1920 | +| version | 3.2 | +| port | 53388 | diff --git a/notes/service/network/spec/mdns/mdns.md b/notes/service/network/spec/mdns/mdns.md deleted file mode 100644 index 3a1c17a7fc8..00000000000 --- a/notes/service/network/spec/mdns/mdns.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: mDNS ---- - -# mDNS - -- mDNS - Multicast DNS -- mDNS Reflector -- mDNS Repeater -- mDNS 主要用于发现 -- Server - - [avahi](../service/network/avahi.md) -- 参考 - - [rfc6762](https://datatracker.ietf.org/doc/html/rfc6762) Multicast DNS - - [Could I use avahi to publish service across subnetworks?](https://stackoverflow.com/a/21005246/1870054) - - http://www.zeroconf.org/ - - [Using Multicast DNS to protect privacy when exposing ICE candidates](https://tools.ietf.org/id/draft-ietf-rtcweb-mdns-ice-candidates-02.html) - - [MDNS ON A CORPORATE WI-FI NETWORK](https://wifizoo.org/2018/06/23/mdns-on-a-corporate-wifi-network/) - - [Advantages of mDNS protocol | disadvantages of mDNS protocol](https://www.rfwireless-world.com/Terminology/Advantages-and-Disadvantages-of-mDNS-protocol.html) - -mDNS 在家庭环境下很实用,很多东西能实现自动配置发现,但在企业环境下使用会有 Scale 问题。 - -- 所有设备需要在相同 subnet 才能发现 -- 因为是 Multicast,因此在 WiFi 环境下会占用较多带宽 diff --git a/notes/service/office/docxjs.md b/notes/service/office/docxjs.md new file mode 100644 index 00000000000..2fd9d99028e --- /dev/null +++ b/notes/service/office/docxjs.md @@ -0,0 +1,9 @@ +--- +title: DocxJS +--- + +# docxjs +- [dolanmiu/docx](https://github.com/dolanmiu/docx) + - MIT, TS + - 生成 docx + - 修改 docx diff --git a/notes/service/office/office-awesome.md b/notes/service/office/office-awesome.md index 63fff680d9d..3f53984b349 100644 --- a/notes/service/office/office-awesome.md +++ b/notes/service/office/office-awesome.md @@ -63,6 +63,11 @@ tags: - 应用 - [kevinschaich/mintable](https://github.com/kevinschaich/mintable) - personal finances +- 商业 + - https://docxtemplater.com/ + - [open-xml-templating/docxtemplater](https://github.com/open-xml-templating/docxtemplater) + - 开源版本功能有限 + - https://docxtemplater.com/pricing/ ## PDF @@ -111,7 +116,7 @@ tags: - React Table - [adazzle/react-data-grid](https://github.com/adazzle/react-data-grid) - MIT - - [nadbm/react-datasheet](https://github.com/nadbm/react-datasheet) + - ~~[nadbm/react-datasheet](https://github.com/nadbm/react-datasheet)~~ - MIT, JS - [nick-keller/react-datasheet-grid](https://github.com/nick-keller/react-datasheet-grid) - MIT, TS @@ -125,7 +130,7 @@ tags: - 依赖的 fast-formula-parser 相对比较大 - 渲染表格内容部分 - 不支持: Pin, Frozen, Merge, Resize - - 数据为 matrix - 二维数组 + - 数据为 matrix - 二维数组 - [blueprintjs/table](https://blueprintjs.com/docs/#table) - [ruilisi/fortune-sheet](./fortune-sheet.md) - fork Luckysheet @@ -146,6 +151,10 @@ tags: ## Word/Doc +- NodeJS/Browser + - [docxjs](./docxjs.md) +- 商业 + ## LowCode DataTable - [apitable/apitable](https://github.com/apitable/apitable) diff --git a/notes/service/service-awesome.md b/notes/service/service-awesome.md index ee1e953eb1a..8fd684cc88f 100644 --- a/notes/service/service-awesome.md +++ b/notes/service/service-awesome.md @@ -149,15 +149,6 @@ tags: - [Cian911/switchboard](https://github.com/Cian911/switchboard) - Auto-magic file organisation for your machines - https://www.opensourcealternative.to/ -- Music - - [CoderLine/alphaTab](https://github.com/CoderLine/alphaTab) - - MPL-2.0, TS - - cross platform music notation and guitar tablature rendering - - [navidrome/navidrome](https://github.com/navidrome/navidrome) - - GPLv3, Go - - Modern Music Server and Streamer compatible with Subsonic/Airsonic - - Subsonic - - Airsonic - secrets manager/security/KMS - [Infisical/infisical](./secret/infisical.md) - MIT + EE, Typescript diff --git a/notes/service/storage/s3.md b/notes/service/storage/s3.md index 01c2aa9c404..5c783001801 100644 --- a/notes/service/storage/s3.md +++ b/notes/service/storage/s3.md @@ -6,6 +6,7 @@ tags: # S3 +- [MinIO](./minio/README.md) - [oxyno-zeta/s3-proxy](https://github.com/oxyno-zeta/s3-proxy) - Apache-2.0, Go - [gaul/s3proxy](https://github.com/gaul/s3proxy) diff --git a/notes/service/storage/storage-awesome.md b/notes/service/storage/storage-awesome.md index d81e8cce06c..3b57d566631 100644 --- a/notes/service/storage/storage-awesome.md +++ b/notes/service/storage/storage-awesome.md @@ -130,16 +130,14 @@ tags: - by 网易 - [cubefs](https://github.com/cubefs/cubefs) - Apache-2.0, Go,C++ - - chubaofs -> cubeFS - by 京东, OPPO - - 🚧 开发不活跃 + - chubaofs -> cubeFS - CNCF 项目 - 提供 S3 接口 - POSIX - 多租户 - [happyfish100/fastdfs](https://github.com/happyfish100/fastdfs) - GPL-3.0, C - - 🚧 开发不活跃 - [haiwen/seafile](https://github.com/haiwen/seafile) - GPL, C - 🚧 开发不活跃 diff --git a/notes/service/storage/storage-faq.md b/notes/service/storage/storage-faq.md index 1b0e419f5af..0099f28d81d 100644 --- a/notes/service/storage/storage-faq.md +++ b/notes/service/storage/storage-faq.md @@ -31,8 +31,7 @@ tags: ## Object Storage Service vs Filesystem - 对象存储 - - 存储对象 - - 每个对象包含数据本身+元数据+全局唯一标识 - data, metadata, key + - 存储对象 - Key, Blob - 面向网络 - 面向大规模 - 可伸缩 - 处理大量小文件时可能不如文件系统高效,但在处理大文件或流式数据时性能良好。 @@ -40,9 +39,31 @@ tags: - 如照片、视频、日志文件和备份数据等。 - 广泛应用于云存储、大数据分析、静态Web资源托管和数据归档。 - RESTful + - 功能区别 + - List 会很快且不受文件梳理影响 + - 不能 重命名目录 - 如果支持 rename 也是某种层面的封装 - 文件系统 - 文件+目录 - 支持嵌套 - 本地 - POSIX - 低延迟 - 可靠 + - inode 本身大多操作可以原子 + - 大多使用 btree 索引 + +--- + +**对象存储** + +| path | blob | metadata | +| -------------------- | ---- | -------- | +| /etc/app/config.json | `{}` | + +**文件系统** + +| inode | parent | name | blob | metadata | +| ----- | ------ | ----------- | ---- | -------- | +| 1 | (null) | | +| 2 | 1 | etc | | | +| 3 | 2 | app | | | +| 4 | 3 | config.json | `{}` | | diff --git a/notes/service/workflow/workflow-faq.md b/notes/service/workflow/workflow-faq.md index c20dbca36bc..9f5a23d4737 100644 --- a/notes/service/workflow/workflow-faq.md +++ b/notes/service/workflow/workflow-faq.md @@ -74,3 +74,18 @@ tags: - https://docs.temporal.io/docs/cadence-to-temporal/ - [Temporal vs Cadence](https://stackoverflow.com/questions/61157400) + +## Flow+Step vs Single Form + +- Single Form - 单个表单 + - 单个 Form 也能记录整个服务流程 - 服务请求、服务过程、服务结果 + - 实现简单 - 使用一个大的 JSON 即可记录所有信息 + - 在原型阶段,或者临时性较强的业务非常适用 +- Flow Step - 流程步骤 + - 业务逻辑的服务流程步骤 对应 设计的流程步骤 + - 要求业务逻辑相对标准 + - 利于流程控制 + - 权限、分工 + - 通知 + - 异常处理 + - 操作规范 diff --git a/notes/service/workflow/xstate.md b/notes/service/workflow/xstate.md index cebd67d3152..38f47824c24 100644 --- a/notes/service/workflow/xstate.md +++ b/notes/service/workflow/xstate.md @@ -19,6 +19,7 @@ title: xstate - [statelyai/xstate-viz](https://github.com/statelyai/xstate-viz) - 开源 可视化 ,现在官方推的是 自己的在线编辑器 - XState V5 + - Docs https://stately.ai/docs - https://stately.ai/blog/2023-12-01-xstate-v5 - actor model diff --git a/notes/web/app.md b/notes/web/app.md new file mode 100644 index 00000000000..988377cf3b8 --- /dev/null +++ b/notes/web/app.md @@ -0,0 +1,8 @@ +--- +title: Web APP +--- + +# Web APP + +- https://w3c.github.io/manifest/ +- https://developer.mozilla.org/en-US/docs/Web/Manifest diff --git a/notes/web/browser/chrome/chrome-faq.md b/notes/web/browser/chrome/chrome-faq.md index 33c4929a396..1378a0a0cad 100644 --- a/notes/web/browser/chrome/chrome-faq.md +++ b/notes/web/browser/chrome/chrome-faq.md @@ -69,3 +69,26 @@ Docker 环境,非 root - adopted by Netflix、Amazon Prime Video - https://www.widevine.com/ - https://support.mozilla.org/en-US/kb/enable-drm +- https://www.freshports.org/www/linux-widevine-cdm/ + +## Chrome vs Chromium + +- Chromium + - BSD-3 - 开源 + - 更新频繁 + - 不支持 DRM + - https://www.freshports.org/www/linux-widevine-cdm/ + - 只包含基本编码: Opus, Theora, Vorbis, VP8, VP9, WAV + - **可能是最大的影响** + - https://www.chromium.org/audio-video/ + - http://hpr.dogphilosophy.net/test/ +- Chrome + - Google Chrome - 商业产品 + - 分三个版本: Stable, Beta/Canary, Dev + - **DRM** - 支持 Netflix, Amazon Prime Video + - 支持更多编码: AC, H.264, MP3, + - 额外内容 + - [can i use format](https://caniuse.com/?search=format) + - 自动更新功能 + - 用户跟踪 + - 安全检测 diff --git a/notes/web/browser/chrome/chromium.md b/notes/web/browser/chrome/chromium.md index e2200f2e016..6e648005880 100644 --- a/notes/web/browser/chrome/chromium.md +++ b/notes/web/browser/chrome/chromium.md @@ -4,9 +4,11 @@ title: Chromium # Chromium -- https://chromium.woolyss.com/ - - [HTML5 audio/video tester](https://tools.woolyss.com/html5-audio-video-tester/) -- ~~[StaZhu/enable-chromium-hevc-hardware-decoding](https://github.com/StaZhu/enable-chromium-hevc-hardware-decoding)~~ - - 官方已经支持 HEVC - - 可直接下载 - - 不能网飞 4K [#6](https://github.com/StaZhu/enable-chromium-hevc-hardware-decoding/issues/6) +- [chromium/chromium](https://github.com/chromium/chromium) + - BSD-3-Clause, C++ +- 衍生浏览器 + - Microsoft Edge + - Google Chrome + - Opera + - Vivaldi + - Brave diff --git a/notes/web/dev/turbopack.md b/notes/web/dev/turbopack.md index b3b8686e909..43a6eba59ed 100644 --- a/notes/web/dev/turbopack.md +++ b/notes/web/dev/turbopack.md @@ -4,6 +4,7 @@ title: turbopack # turbopack +- https://areweturboyet.com/ :::caution diff --git a/notes/web/framework/nextjs/nextjs-app.md b/notes/web/framework/nextjs/nextjs-app.md index 6a409e8eb8e..30834dedfac 100644 --- a/notes/web/framework/nextjs/nextjs-app.md +++ b/notes/web/framework/nextjs/nextjs-app.md @@ -57,17 +57,27 @@ title: App Layout └─ 📂 path ``` +## 文件命名约定 {#file-conventions} + - `src/app/` - page.tsx - 页面内容 - layout.tsx - 布局 - Root 布局必须存在 - 替代 `_app.js`, `_document.js` + - 没有 searchParams + - 不应该添加 ``, 使用 metadata API + - 支持多个分组布局 - 会导致整页刷新 + - `app/(shop)/layout.js` + - `app/(marketing)/layout.js` - template.tsx - 模板 - 类似 layout 但不会持续存在 - head.tsx - head 标签内容 - title,meta,link,script - loading.tsx - Suspense, Loading 时显示的内容 - error.tsx - not-found.tsx +- https://nextjs.org/docs/app/api-reference/file-conventions + +## config ```tsx // 'auto' | 'force-dynamic' | 'error' | 'force-static' diff --git a/notes/web/framework/nextjs/nextjs-conf.md b/notes/web/framework/nextjs/nextjs-conf.md index 1ff9a70e41e..13b81efd98c 100644 --- a/notes/web/framework/nextjs/nextjs-conf.md +++ b/notes/web/framework/nextjs/nextjs-conf.md @@ -1,9 +1,102 @@ --- tags: -- Configuration + - Configuration --- # NextJS Conf -- optimizePackageImports - - @mui/icons-material, @mui/material, date-fns, lodash, lodash-es, react-bootstrap, @headlessui/react, @heroicons/react, lucide-react +```js +/** @type {import('next').NextConfig} */ +const nextConfig = { + experimental: { + // 只有在用到时才 import + // https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports + optimizePackageImports: [ + '@ant-design/icons', + '@headlessui-float/react', + '@headlessui/react', + '@heroicons/react/20/solid', + '@heroicons/react/24/outline', + '@heroicons/react/24/solid', + '@material-ui/core', + '@material-ui/icons', + '@mui/icons-material', + '@mui/material', + '@tabler/icons-react', + '@tremor/react', + '@visx/visx', + 'ahooks', + 'antd', + 'date-fns', + 'lodash-es', + 'lucide-react', + 'mui-core', + 'ramda', + 'react-bootstrap', + 'react-icons/*', + 'react-use', + 'recharts', + 'rxjs', + ], + + // https://nextjs.org/docs/app/api-reference/next-config-js/serverComponentsExternalPackages + // https://github.com/vercel/next.js/blob/canary/packages/next/src/lib/server-external-packages.json + serverComponentsExternalPackages: [ + '@aws-sdk/client-s3', + '@aws-sdk/s3-presigned-post', + '@blockfrost/blockfrost-js', + '@highlight-run/node', + '@jpg-store/lucid-cardano', + '@libsql/client', + '@mikro-orm/core', + '@mikro-orm/knex', + '@prisma/client', + '@react-pdf/renderer', + '@sentry/profiling-node', + '@swc/core', + 'argon2', + 'autoprefixer', + 'aws-crt', + 'bcrypt', + 'better-sqlite3', + 'canvas', + 'cpu-features', + 'cypress', + 'eslint', + 'express', + 'firebase-admin', + 'jest', + 'jsdom', + 'libsql', + 'lodash', + 'mdx-bundler', + 'mongodb', + 'mongoose', + 'next-mdx-remote', + 'next-seo', + 'node-pty', + 'node-web-audio-api', + 'pg', + 'playwright', + 'postcss', + 'prettier', + 'prisma', + 'puppeteer-core', + 'puppeteer', + 'rimraf', + 'sharp', + 'shiki', + 'sqlite3', + 'tailwindcss', + 'ts-node', + 'typescript', + 'vscode-oniguruma', + 'webpack', + 'websocket', + 'zeromq', + ], + }, +}; + +export default nextConfig; +``` diff --git a/notes/web/framework/prisma.md b/notes/web/framework/prisma.md index 149680b63fe..be8bd269277 100644 --- a/notes/web/framework/prisma.md +++ b/notes/web/framework/prisma.md @@ -1,32 +1,19 @@ --- -title: Prisma2 +title: Prisma --- -# Prisma2 +# Prisma -- PostgreSQL, MySQL, SQL Server, SQLite, MongoDB, CockroachDB -- Query Engine - Rust 实现 - - 作为 sidecard 或者 n-api 使用 -- 架构不同于 Prisma1 - 客户端 -> 查询引擎 -> 数据库 - - 没有额外的服务 - 内嵌 - - cli 集成 db 迁移能力 - - 对不同组件进行拆分 - - Photon - 生成 ORM 代码 - - Life - 模型定义和迁移 - - Studio - 管理界面 - - GrahQL 能力 - - 部分核心能力使用 RUST 重写 - 之前为 Scala - - 因为考虑可能多语言 -- 支持数据库 - - PostgreSQL - - MySQL - - SQLite +- [prisma/prisma](https://github.com/prisma/prisma) + - Apache-2.0, TS + - PostgreSQL, MySQL, SQL Server, SQLite, MongoDB, CockroachDB - 问题 - 不支持 yarn2 PnP [#1439](https://github.com/prisma/prisma/issues/1439) - 修改输出路径为 `../src/generated/prisma`,调整 PrismaClient 的引入路径可以使用 -- [prisma/studio](https://github.com/prisma/studio) - - 闭源 -- https://playground.prisma.io/ +- 参考 + - [prisma/studio](https://github.com/prisma/studio) + - 闭源 + - https://playground.prisma.io/ ```bash npm install prisma --save-dev @@ -50,7 +37,7 @@ yarn add @prisma/cli --dev yarn add @prisma/client mkdir prisma -cat < ./prisma/schema.prisma +cat << EOF > ./prisma/schema.prisma datasource db { provider = "sqlite" url = "file:./dev.db" @@ -93,10 +80,24 @@ npm install @prisma/client npx prisma generate ``` - ```hcl datasource db { provider = "postgresql" url = env("DATABASE_URL") } ``` + +## Notes + +- Query Engine - Rust 实现 + - 作为 sidecard 或者 n-api 使用 +- 架构不同于 Prisma1 - 客户端 -> 查询引擎 -> 数据库 + - 没有额外的服务 - 内嵌 + - cli 集成 db 迁移能力 + - 对不同组件进行拆分 + - Photon - 生成 ORM 代码 + - Life - 模型定义和迁移 + - Studio - 管理界面 + - GrahQL 能力 + - 部分核心能力使用 RUST 重写 - 之前为 Scala + - 因为考虑可能多语言 diff --git a/notes/web/framework/prisma1.md b/notes/web/framework/prisma1.md index 2b0364e82d2..ea919b0faf2 100644 --- a/notes/web/framework/prisma1.md +++ b/notes/web/framework/prisma1.md @@ -1,9 +1,13 @@ --- title: Prisma +tags: +- Legacy --- # Prisma +- [prisma/prisma](https://github.com/prisma/prisma) + - Apache-2.0, TS - 注意 - 生成的客户端只能服务端执行 [#3142](https://github.com/prisma/prisma/issues/3142) - 浏览器端只能通过 GraphQL 使用 diff --git a/notes/web/framework/remix/README.md b/notes/web/framework/remix/README.md index e741ebfd474..cae7ddb1936 100644 --- a/notes/web/framework/remix/README.md +++ b/notes/web/framework/remix/README.md @@ -37,13 +37,13 @@ npm add -D @remix-run/dev npx create-remix@latest ``` +## routes + - app/root.tsx - 顶层 layout - 路由规则 app/routes - `SEGMENT.tsx` 或 目录 `SEGMENT/_index.tsx` - `A.B.tsx` 或者 `A/B.tsx` - `$var` - 路径上变量 -- https://remix.run/docs/en/main/file-conventions/routes -- https://interactive-remix-routing-v2.netlify.app/ - exports - Route Module - loader - 在 GET 请求时执行 - action - 在 DELETE, PATCH, POST, PUT 请求时执行 @@ -91,6 +91,12 @@ export default function Projects() { } ``` +**参考** + +- https://remix.run/docs/en/main/discussion/routes +- https://remix.run/docs/en/main/file-conventions/routes +- https://interactive-remix-routing-v2.netlify.app/ + ## remix.config.js - https://remix.run/docs/en/main/file-conventions/remix-config @@ -98,4 +104,3 @@ export default function Projects() { ## vite - https://github.com/remix-run/remix/tree/main/templates/unstable-vite - diff --git a/notes/web/framework/taro.md b/notes/web/framework/taro.md index 51d0913e1e1..250c1514a5c 100644 --- a/notes/web/framework/taro.md +++ b/notes/web/framework/taro.md @@ -31,7 +31,8 @@ npm install -g @tarojs/cli # npm install -g mirror-config-china # npx -y @tarojs/cli init my-app -taro init my-app +# taro init my-app +npx -y @tarojs/cli init --name my-app --typescript --description '' cd my-app diff --git a/notes/web/nodejs/mikro-orm.md b/notes/web/nodejs/mikro-orm.md index e903f4a9423..e39af36f5d7 100644 --- a/notes/web/nodejs/mikro-orm.md +++ b/notes/web/nodejs/mikro-orm.md @@ -187,4 +187,18 @@ MikroORM.init({ # FAQ +## LockMode + +``` +OPTIMISTIC +PESSIMISTIC_READ +PESSIMISTIC_WRITE +PESSIMISTIC_PARTIAL_WRITE +PESSIMISTIC_WRITE_OR_FAIL +PESSIMISTIC_PARTIAL_READ +``` + +- PESSIMISTIC_WRITE_OR_FAIL + - FOR UPDATE NOWAIT + ## Transaction query already complete diff --git a/notes/web/nodejs/nodejs-awesome.md b/notes/web/nodejs/nodejs-awesome.md index d2bd76a78bd..cb27233553d 100644 --- a/notes/web/nodejs/nodejs-awesome.md +++ b/notes/web/nodejs/nodejs-awesome.md @@ -286,6 +286,9 @@ export N_PREFIX=$HOME/n - https://www.twilio.com/docs/twilio-cli - CLI Helper/terminal ui/tui/prompt - [chalk](https://github.com/chalk/chalk) + - Color + - [larswaechter/voici.js](https://github.com/larswaechter/voici.js) + - Print table - execa - winston - logging diff --git a/notes/web/nodejs/package.json.md b/notes/web/nodejs/package.json.md index 22f132698fa..82a1b5e7336 100644 --- a/notes/web/nodejs/package.json.md +++ b/notes/web/nodejs/package.json.md @@ -1,16 +1,19 @@ --- title: package.json files: -- package.json + - package.json --- # package.json - 参考 + - [stereobooster/package.json](https://github.com/stereobooster/package.json) + - package.json fields explained + - npm [package.json](https://docs.npmjs.com/cli/v10/configuring-npm/package-json) + - pnpm [package.json](https://pnpm.io/package_json) - https://nodejs.org/api/packages.html - https://nodejs.org/api/packages.html#packages_package_entry_points - https://webpack.js.org/guides/package-exports - - https://github.com/stereobooster/package.json - https://unpkg.com/browse/antd/package.json - jsnext:main [jsforum/jsforum#5](https://github.com/jsforum/jsforum/issues/5) - style,sass [twbs/bootstrap#12441](https://github.com/twbs/bootstrap/pull/12441) @@ -218,8 +221,8 @@ import '#dep'; - pnpm - `pnp:` - yarn plug & play -- alias - `@npm:` - - `lodash1@npm:lodash@1` +- alias - `@npm:` +- `lodash1@npm:lodash@1` - `git+{url}.git` - `://[[:]@][:][:][/][# | #semver:]` - GIT_ASKPASS @@ -258,7 +261,6 @@ npm install gist/gist_id - https://docs.npmjs.com/cli/v8/commands/npm-install - ## resolve - esm 要求有后缀 diff --git a/notes/web/react/antd.md b/notes/web/react/antd.md index ff1a315062b..9da36e3187b 100644 --- a/notes/web/react/antd.md +++ b/notes/web/react/antd.md @@ -1,8 +1,12 @@ --- title: Ant Design +tags: + - Design + - Design System --- # Ant Design + - [ant-design/ant-design](https://github.com/ant-design/ant-design) - 不建议产品使用 - 丰富强大的组件库 @@ -50,7 +54,6 @@ npm add antd - 依赖 - [clauderic/dnd-kit](https://github.com/clauderic/dnd-kit) - # Versions | version | date | @@ -78,7 +81,6 @@ npm add antd - [#33862](https://github.com/ant-design/ant-design/issues/33862) - https://kitchen.alipay.com/ - ## antd mobile v5 - 使用 use-gesture 处理手势 diff --git a/notes/web/react/blueprint.md b/notes/web/react/blueprint.md index e2f56d03c2a..34ccf246702 100644 --- a/notes/web/react/blueprint.md +++ b/notes/web/react/blueprint.md @@ -1,5 +1,7 @@ --- title: BlueprinrJS +tags: + - Design System --- # BlueprinrJS diff --git a/notes/web/react/formik.md b/notes/web/react/formik.md index a4598e1712f..00fc1fa583f 100644 --- a/notes/web/react/formik.md +++ b/notes/web/react/formik.md @@ -1,5 +1,7 @@ --- title: formik +tags: + - Form --- # formik diff --git a/notes/web/react/hermes.md b/notes/web/react/hermes.md index d09e7d60b5c..66e6f7f2ee4 100644 --- a/notes/web/react/hermes.md +++ b/notes/web/react/hermes.md @@ -1,5 +1,7 @@ --- title: hermes +tags: + - Runtime --- # hermes diff --git a/notes/web/react/react-awesome.md b/notes/web/react/react-awesome.md index 2f094214c4e..c5843b9c201 100644 --- a/notes/web/react/react-awesome.md +++ b/notes/web/react/react-awesome.md @@ -811,6 +811,7 @@ npm add date-fns lodash-es react-fast-compare ## Rendering/Native +- [scheduler](https://github.com/facebook/react/tree/main/packages/scheduler) - DOM - [remarkablemark/html-react-parser](https://github.com/remarkablemark/html-react-parser) - ~28kB - gzip 10kB @@ -835,12 +836,8 @@ npm add date-fns lodash-es react-fast-compare - 2D/Canvas - [konvajs/react-konva](https://github.com/konvajs/react-konva) - 基于 [konvajs/konva](https://github.com/konvajs/konva) - - [Flipboard/react-canvas](https://github.com/Flipboard/react-canvas) + - ~~[Flipboard/react-canvas](https://github.com/Flipboard/react-canvas)~~ - 停止 -- [diegomura/react-pdf](https://github.com/diegomura/react-pdf) - - 渲染 PDF -- [wojtekmaj/react-pdf](https://github.com/wojtekmaj/react-pdf) - - 显示 PDF - 使用 pdfjs 并非 React 渲染 - Native - [react-native-skia/react-native-skia](https://github.com/react-native-skia/react-native-skia) - [Shopify/react-native-skia](https://github.com/Shopify/react-native-skia) @@ -860,6 +857,15 @@ npm add date-fns lodash-es react-fast-compare - blessed - [vadimdemedes/ink](https://github.com/vadimdemedes/ink) - 终端 渲染引擎 + - [vadimdemedes/ink-ui](https://github.com/vadimdemedes/ink-ui) + - [vadimdemedes/pastel](https://github.com/vadimdemedes/pastel) + - Next.js-like framework for CLIs made with Ink +- Documents + - [diegomura/react-pdf](https://github.com/diegomura/react-pdf) + - 使用 react 创建 PDF + - 渲染 PDF + - [wojtekmaj/react-pdf](https://github.com/wojtekmaj/react-pdf) + - 显示 PDF - 使用 pdfjs 并非 React 渲染 - [chentsulin/awesome-react-renderer](https://github.com/chentsulin/awesome-react-renderer) ## 有趣 diff --git a/notes/web/react/react-hook-form.md b/notes/web/react/react-hook-form.md index b44585a6a6b..8bf17b311e0 100644 --- a/notes/web/react/react-hook-form.md +++ b/notes/web/react/react-hook-form.md @@ -34,15 +34,15 @@ title: React Hook Form ::: ```tsx -const MyForm: React.FC<{onSubmit; defaultValue}> = ({onSubmit, defaultValue}) => { - const formMethods = useForm({mode: 'onBlur', defaultValues: defaultValue}); - const {register, handleSubmit} = formMethods; +const MyForm: React.FC<{ onSubmit; defaultValue }> = ({ onSubmit, defaultValue }) => { + const formMethods = useForm({ mode: 'onBlur', defaultValues: defaultValue }); + const { register, handleSubmit } = formMethods; return (
- - + +
); @@ -58,8 +58,24 @@ const MyForm: React.FC<{onSubmit; defaultValue}> = ({onSubmit, defaultValue}) => - FormProvider 使用了 React.Context, 导致 form 状态变化会 rerender - useForm - 返回的是内部 `_formControl` - - formState 会代理 - - 代理记录 validation +- formState + - 注意 + - 会被代理 - 返回 Proxy 的对象,用于 subscribe + - useEffect 需要将 formState 作为依赖 + - 取值时不要加 condition - 会导致未订阅的值不会更新 + - isDirty - 和 defaultValues 比较 + - dirtyFields + - touchedFields + - defaultValues + - isSubmitted - reset 会设置为 false + - isSubmitSuccessful + - isSubmitting + - isLoading - defaultValues 可以为 async 函数 + - submitCount + - isValid + - isValidating + - validatingFields + - errors --- diff --git a/notes/web/react/react-spectrum.md b/notes/web/react/react-spectrum.md new file mode 100644 index 00000000000..122075ce345 --- /dev/null +++ b/notes/web/react/react-spectrum.md @@ -0,0 +1,15 @@ +--- +title: react-spectrum +tags: +- Design System +--- + +# react-spectrum + +- [adobe/react-spectrum](https://github.com/adobe/react-spectrum) + - React Spectrum - 开箱即用组件 + - Adobe Design System + - React Aria - 行为 Hooks + - unstyled React components and hooks + - React Stately - 状态 Hooks + - 类似于 [radix](./radix.md#primitives) 的 primitives diff --git a/notes/web/script/js/js-awesome.md b/notes/web/script/js/js-awesome.md index d3ac009f3dc..41235447464 100644 --- a/notes/web/script/js/js-awesome.md +++ b/notes/web/script/js/js-awesome.md @@ -68,10 +68,12 @@ tags: - socketio - sockjs - IoC/Container/DI - - nestjs + - [nestjs](../../framework/nestjs/README.md) + - 👍 整体设计类似 Spring/Angular + - ⚠️ 只支持 NodeJS - [inversify/InversifyJS](https://github.com/inversify/InversifyJS) - inversify - - 功能非常全的 IoC + - 功能非常全的 IoC - 使用起来有一点复杂 - ⚠️ 不活跃 - [typestack/typedi](https://github.com/typestack/typedi) - typedi @@ -80,7 +82,7 @@ tags: - ⚠️ 非常不活跃 - [Microsoft/tsyringe](https://github.com/Microsoft/tsyringe) - ⚠️ 非常不活跃 - - [jeffijoe/awilix](./lib/awilix.md) + - [jeffijoe/awilix](../lib/awilix.md) - 0 依赖, 12kB - Proxy+Reflect - Chrome >= 49, Safari >= 10 - 支持代理模式 - 通过访问的字段名字进行 resolve @@ -209,6 +211,9 @@ tags: - [fabricjs/fabric.js](https://github.com/fabricjs/fabric.js) - SVG <-> Canvas - [Build indoor maps with Fabric.js and React](https://blog.logrocket.com/build-indoor-maps-fabric-js-using-react/) + - [obsidianmd/jsoncanvas](https://github.com/obsidianmd/jsoncanvas) + - file format for infinite canvas data + - [HN](https://news.ycombinator.com/item?id=39670922) - [jonobr1/two.js](https://github.com/jonobr1/two.js) - [signature_pad](https://github.com/szimek/signature_pad) - [yisibl/resvg-js](https://github.com/yisibl/resvg-js) @@ -412,6 +417,8 @@ tags: - log4js - [unjs/consola](https://github.com/unjs/consola) - validate + - [decs/typeschema](https://github.com/decs/typeschema) + - adapter for TypeScript schema validation. - [ajv](./lib/ajv.md) - JSON Schema - [zod](./lib/zod.md) @@ -517,6 +524,7 @@ tags: - [stalniy/casl](https://github.com/stalniy/casl) - Syntax Highlighter - [shikijs/shiki](https://github.com/shikijs/shiki) + - MIT, TS - jwt - [openid-client](https://github.com/panva/node-openid-client) - nodejs RP client for passport. diff --git a/notes/web/script/typescript/typescript-faq.md b/notes/web/script/typescript/typescript-faq.md index af82f29ed26..75d6a69b46a 100644 --- a/notes/web/script/typescript/typescript-faq.md +++ b/notes/web/script/typescript/typescript-faq.md @@ -108,7 +108,12 @@ const identity = (arg: T): T => arg; ## Path alias -```json +- 推荐 `@/*` -> `src/*` + - 简单好配置 + - 适用于大多场景 +- 尽量保持使用相同的 alias 位置,让代码夸项目粘贴复制方便 + +```json title="tsconfig.json" { "compilerOptions": { "baseUrl": ".", @@ -119,6 +124,29 @@ const identity = (arg: T): T => arg; } ``` +```ts title="vite.config.ts" +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + alias: { + '@/': new URL('./src/', import.meta.url).pathname, + }, + }, +}); +``` + +```json title=".swcrc" +{ + "jsc": { + "baseUrl": "./", + "paths": { + "@/*": ["@/*"] + } + } +} +``` + - https://www.npmjs.com/package/module-alias - self link - PNPM diff --git a/notes/web/spec/js-faq.md b/notes/web/spec/js-faq.md index 25628a319bd..f05ed5ec6e0 100644 --- a/notes/web/spec/js-faq.md +++ b/notes/web/spec/js-faq.md @@ -31,29 +31,6 @@ tags: - https://tvcutsem.github.io/js-membranes - https://tvcutsem.github.io/membranes -## Date.toJSON include timezone - -```js -// 默认 toJSON 为 UTC -const now = new Date(2021, 12, 12, 0, 0, 0); -// now.getTimezoneOffset() // local timezone offset -console.assert(now.toJSON() === now.toISOString()); -JSON.stringify({ now }); - -Date.prototype.toJSON = function () { - // return moment(this).format(); - // return format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx") // date-fns - return dayjs(this).format(); -}; -``` - -| method | format | -| ---------------------------------------------------- | ----------------------------- | -| now.toJSON() | 2022-01-11T16:00:00.000Z | -| moment(now).format() | 2022-01-12T00:00:00+08:00 | -| dayjs(now).format() | 2022-01-12T00:00:00+08:00 | -| date-fns format(now, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx") | 2022-01-12T00:00:00.000+08:00 | - ## tbody to array ```js diff --git a/notes/web/web-faq.md b/notes/web/web-faq.md index 779d342b482..acf5da50a71 100644 --- a/notes/web/web-faq.md +++ b/notes/web/web-faq.md @@ -179,6 +179,16 @@ location.origin; - useOnClickOutside 处理 touchstart 时触发,需要传入 passive 参数 +## passive event listener + +- 不等待事件处理完成,直接执行下一个事件 +- 因此 preventDefault 不会生效 +- 对于性能影响较大的 event listener,可以使用 passive 优化 + - 例如 scroll、wheel、touchstart、touchmove +- 参考 + - Chrome 51+ + - [react#6436](https://github.com/facebook/react/issues/6436) Support Passive Event Listeners + ## Failed to execute 'postMessage' on 'DOMWindow': The target origin provided does not match the recipient window's origin 1. 确保 iframe 完全加载 diff --git a/story/2022/2022-08-17-crm-trials.md b/story/2022/2022-08-17-crm-trials.md index 80628862d71..c8d5e0bb959 100644 --- a/story/2022/2022-08-17-crm-trials.md +++ b/story/2022/2022-08-17-crm-trials.md @@ -22,6 +22,8 @@ tags: ::: + + ## v2 - 2020.1 - 2020.6 @@ -113,7 +115,7 @@ tags: ## v4 -- 2022.6 -> +- 2022.6 -> 2022.11 - 后端 - 确定了要优先 GRPC,且使用标准 Schema。 - 因此将 protobuf 的定义作为 Single-Source—Of—Truth Schema。 @@ -155,3 +157,33 @@ tags: - 提供开放的 OSS 存储 - 目前明确方向 - 分离 os 逻辑和核心 route 逻辑 - 揉在一起困难 + +## v5 + +- 2022.11 -> +- 方式的调整 + - 不只是独立于业务单纯的思考怎么做 CRM - 没有任何意义/产出的东西不可用 + - 业务层面将以前的思路以 DB Schema 的方式沉淀 + - 贴合现实做一些实际的事情 +- 后端 + - RPC over NATS + - 简单易用 + - 能实现多租户 + - 自定义 RPC + - 弱 Schema - 一个人维护不过来 + - 重新定义分层 + - DB -> Entity -> EntityService -> RemoteService -> Controller, tRPC, GraphQL + - 层次更多,但是更清晰 + - 改动相对独立,互不影响 + - 依然全面的 NodeJS/TS/NextJS/NestJS + - 尝试更加轻量的服务 - HonoJS + - 尝试更加轻量的前端 - Vite + - 不能 SSR/SSG/Server Action + - 添加多个页面相对麻烦 + - 尝试 Typescript 生成 zod/typebox - Single-Source-Of-Truth +- 前端 + - 大部分页面直接使用了 v4 的内容 - 逻辑结构上有一定调整 + - 证明 daisyui+tailwindcss 的移植性的确很好 + - 尝试引入了 shadcn + - 核心功能能够做到模块化 + - 尝试重新恢复多窗口 diff --git a/story/2023/2023-05-29-recover-synology.md b/story/2023/2023-05-29-recover-synology.md index 218238f8af9..578e1d2c980 100644 --- a/story/2023/2023-05-29-recover-synology.md +++ b/story/2023/2023-05-29-recover-synology.md @@ -21,6 +21,8 @@ tags: 主要目的是挂载 btrfs 恢复数据。 + + ## 操作 ```bash