Compare commits

..

321 Commits

Author SHA1 Message Date
jaywcjlove
229193a584 released v1.44.0 2024-06-25 23:49:41 +08:00
jaywcjlove
222f5bc604 feat: add stylex.md 2024-06-25 23:22:03 +08:00
jaywcjlove
4b22796c36 doc: update docs/dart.md 2024-06-25 23:22:03 +08:00
jaywcjlove
eb01adb655 doc: update docs/dart.md 2024-06-25 23:22:03 +08:00
jaywcjlove
ebc7ef957a doc: update docs/regex.md 2024-06-25 23:22:03 +08:00
jaywcjlove
91e0fb3af7 doc: add hook.md 2024-06-25 23:22:03 +08:00
jaywcjlove
3b817385a8 doc: update xjs.md #674 2024-06-25 23:22:03 +08:00
github-actions[bot]
d19915eac8 doc: update README.md. 2024-06-25 15:04:42 +00:00
github-actions[bot]
3478e345eb doc: update CONTRIBUTING.md. 2024-06-25 15:04:42 +00:00
h7ml
70b561c710 docs(erlang): update docs/erlang.md (#676)
* feat(docs): add Erlang cheat sheet

Create an Erlang备忘清单 in markdown format to document common commands and
operations for Erlang programming, including入门, 代码结构, 常用内置函数 (BIFs),
并发编程, 错误处理, 分布式编程, OTP框架, 和测试.

This cheat sheet aims to provide a quick reference for Erlang developers and
learners, summarizing key points and examples for various aspects of the
language.

* docs(erlang): update links and clean up markdown formatting

- Update Erlang documentation links.
2024-06-25 23:03:33 +08:00
github-actions[bot]
60fae2b928 doc: update README.md. 2024-06-25 05:54:13 +00:00
github-actions[bot]
85d74eb81a doc: update CONTRIBUTING.md. 2024-06-25 05:54:12 +00:00
jaywcjlove
99c34277e1 doc: update xjs.md #674 2024-06-25 13:52:13 +08:00
h7ml
1013713630 doc: add rxjs.md cheat sheet (#674)
Create a new cheat sheet for RxJS covering key concepts, operators, and methods. This includes installation, importing, creating Observables, and using various operators such as map, filter, switchMap, and more. The document also explains important concepts like Schedulers and provides examples for better understanding.
2024-06-25 13:05:27 +08:00
jaywcjlove
942f2c9563 doc: update erlang.md #673 2024-06-25 13:01:26 +08:00
jaywcjlove
0be71ca830 doc: update erlang.md #673 2024-06-25 12:53:41 +08:00
github-actions[bot]
121db975c4 doc: update README.md. 2024-06-25 04:35:12 +00:00
github-actions[bot]
8f54901b92 doc: update CONTRIBUTING.md. 2024-06-25 04:35:11 +00:00
h7ml
09fd8603cb feat(docs): add Erlang cheat sheet (#673)
Create an Erlang备忘清单 in markdown format to document common commands and
operations for Erlang programming, including入门, 代码结构, 常用内置函数 (BIFs),
并发编程, 错误处理, 分布式编程, OTP框架, 和测试.

This cheat sheet aims to provide a quick reference for Erlang developers and
learners, summarizing key points and examples for various aspects of the
language.
2024-06-25 12:33:55 +08:00
jaywcjlove
1fb3dd7c34 doc: update pinia.md #672 2024-06-25 05:46:30 +08:00
github-actions[bot]
819704c974 doc: update README.md. 2024-06-24 21:25:53 +00:00
github-actions[bot]
41e7f5e2ce doc: update CONTRIBUTING.md. 2024-06-24 21:25:52 +00:00
github-actions[bot]
3fa46ae173 doc: update README.md. 2024-06-24 21:25:13 +00:00
github-actions[bot]
d4115b3044 doc: update CONTRIBUTING.md. 2024-06-24 21:25:12 +00:00
h7ml
60c463b1cb feats (docs): add Pinia Memo List (#672)
* feats (docs): add Pinia Memo List

Create a Pinia Memo List to document common commands and actions of the Pinia State Management Library in markdown format. Content includes getting started, creating Pinia instances, defining the Store, using the Store, and more

* docs(pinia): update link to pinia-plugin-persist documentation

Correct the documentation link for pinia-plugin-persist in the Pinia documentation
to point to the official documentation hosted on seb-l.github.io. This ensures
that readers will access the most up-to-date and correct information regarding
the usage of the pinia-plugin-persist library.
2024-06-25 05:24:36 +08:00
jaywcjlove
aadb7e664b doc: Update bun.md #671 2024-06-25 05:22:56 +08:00
h7ml
deeed5ec0b feat: add bun (#671)
Create a Bun备忘清单 in markdown format to document the common commands
for the Bun package manager, comparing it to npm and Yarn. This includes
installation, project creation, dependency management, script execution,
and cache handling.
2024-06-25 04:20:29 +08:00
jaywcjlove
c0903a400c doc: Update docs/pnpm.md #670 2024-06-25 03:30:46 +08:00
github-actions[bot]
80761d5cf6 doc: update README.md. 2024-06-24 18:40:49 +00:00
github-actions[bot]
2fbe314f16 doc: update CONTRIBUTING.md. 2024-06-24 18:40:48 +00:00
h7ml
e657882897 docs: add pnpm memo and update README (#670)
Add a new pnpm.md memo in the docs directory and update the README to
include pnpm in the quick reference section. Also, introduce a new
pnpm.svg asset in the assets directory.
2024-06-25 02:39:46 +08:00
jaywcjlove
04b0b48d94 ci: Update FUNDING.yml 2024-06-22 23:53:32 +08:00
jaywcjlove
7e32739eb6 ci: Update FUNDING.yml 2024-06-22 23:52:11 +08:00
jaywcjlove
9659f0f074 ci: Update FUNDING.yml 2024-06-22 23:49:26 +08:00
jaywcjlove
e1b5344903 ci: Update FUNDING.yml 2024-06-22 23:46:01 +08:00
github-actions[bot]
f5c4e78c11 doc: update README.md. 2024-06-21 10:12:30 +00:00
github-actions[bot]
08edd2ad3d doc: update CONTRIBUTING.md. 2024-06-21 10:12:29 +00:00
jaywcjlove
9f7014bc52 doc: update docs/chatgpt.md #669 2024-06-21 18:10:54 +08:00
zhangym
8197b8f641 feat: add chatgpt prompt (#669) 2024-06-21 17:41:46 +08:00
jaywcjlove
1c55ee64bf doc: update README.md 2024-06-20 18:21:35 +08:00
jaywcjlove
8cca95af19 doc: update springboot.md (#668) 2024-06-20 18:19:51 +08:00
jaywcjlove
4138d22968 doc: update springboot.md (#668) 2024-06-20 18:05:02 +08:00
github-actions[bot]
9529667952 doc: update README.md. 2024-06-20 09:33:32 +00:00
github-actions[bot]
6730b65788 doc: update CONTRIBUTING.md. 2024-06-20 09:33:31 +00:00
zhangym
a527cb28a0 feat: add springboot (#668) 2024-06-20 17:32:08 +08:00
github-actions[bot]
100297d821 doc: update README.md. 2024-06-17 14:10:46 +00:00
github-actions[bot]
7ef107d114 doc: update CONTRIBUTING.md. 2024-06-17 14:10:46 +00:00
王叨叨
864da459ef doc: update README.md #102 (#666) 2024-06-17 22:09:39 +08:00
github-actions[bot]
44e5c5a248 doc: update README.md. 2024-06-08 18:45:54 +00:00
github-actions[bot]
a3dab064ce doc: update CONTRIBUTING.md. 2024-06-08 18:45:53 +00:00
jaywcjlove
4b9ff8a35e doc: update docs/github-actions.md 2024-06-09 02:44:46 +08:00
小弟调调
fa2c86a964 doc: Update README.md #102 2024-06-09 01:44:52 +08:00
焕晨HChen
d7008594f8 doc: update docs/adb.md (#662) 2024-06-09 01:43:12 +08:00
leauny
df9c2ac08b doc: update docs/lua.md (#661)
* Update lua.md

* Update lua.md

* Update lua.md
2024-06-09 01:42:21 +08:00
小弟调调
7494981f5f doc: Update README.md 2024-06-07 00:54:39 +08:00
jaywcjlove
ae490e878e doc: update docs/twitter.md 2024-06-06 22:20:07 +08:00
jaywcjlove
ae594eb45a doc: update docs/quickreference.md 2024-06-06 21:50:19 +08:00
jaywcjlove
8fad195069 doc: update docs/quickreference.md 2024-06-06 11:01:36 +08:00
jaywcjlove
8dbec19255 ci: update markdown lint 2024-06-06 11:01:36 +08:00
jaywcjlove
8880d82092 doc: update docs/vimium.md #660 2024-06-06 11:01:36 +08:00
github-actions[bot]
ee03850619 doc: update README.md. 2024-06-06 00:32:00 +00:00
github-actions[bot]
9acc906680 doc: update CONTRIBUTING.md. 2024-06-06 00:31:59 +00:00
Small Long
05191c8c2c feat: add docs/vimium.md (#660) 2024-06-06 08:30:45 +08:00
jaywcjlove
3b0416a2c3 ci: update workflows config. 2024-06-05 13:59:33 +08:00
jaywcjlove
10dfe11942 doc: update docs/glances.md #659 #575 2024-06-05 13:44:44 +08:00
jaywcjlove
a0480a90dd doc: update docs/glances.md #659 #575 2024-06-05 12:04:59 +08:00
github-actions[bot]
1bb046db08 doc: update README.md. 2024-06-05 01:45:52 +00:00
github-actions[bot]
1cbc663abf doc: update CONTRIBUTING.md. 2024-06-05 01:45:51 +00:00
Small Long
29a3787140 feat: add glances (#659) 2024-06-05 09:44:51 +08:00
小弟调调
e28914b3c7 doc: Update README.md #102 2024-06-03 17:19:27 +08:00
github-actions[bot]
6d9782c019 doc: update README.md. 2024-05-30 13:51:02 +00:00
github-actions[bot]
8727334a7c doc: update CONTRIBUTING.md. 2024-05-30 13:51:01 +00:00
zhangym
861d35482a doc: update docs/docker-compose.md (#656) 2024-05-30 21:49:58 +08:00
github-actions[bot]
5708867a5d doc: update README.md. 2024-05-23 01:58:48 +00:00
github-actions[bot]
02240aaab0 doc: update CONTRIBUTING.md. 2024-05-23 01:58:47 +00:00
小弟调调
1189c92fd7 doc: Update README.md #102 2024-05-23 09:57:31 +08:00
jaywcjlove
a1a1bd60f8 doc: update docs/pytorch.md #649 2024-05-13 17:03:11 +08:00
github-actions[bot]
739b18048d doc: update README.md. 2024-05-13 08:34:42 +00:00
github-actions[bot]
bcd60d6020 doc: update CONTRIBUTING.md. 2024-05-13 08:34:41 +00:00
滴滴答滴滴的雨
afbe61aebc doc(pytorch): update docs/pytorch.md (#649)
Co-authored-by: zhulin.zzz <zhul289@chinaunicom.cn>
2024-05-13 16:33:42 +08:00
jaywcjlove
f2183a90c3 doc: update docs/docker-compose.md 2024-05-12 14:35:56 +08:00
jaywcjlove
a10d0f850d doc: update docs/docker-compose.md 2024-05-12 14:25:32 +08:00
jaywcjlove
167fef356f doc: update docs/docker-compose.md 2024-05-12 14:19:16 +08:00
jaywcjlove
5e22e28a2d doc: update docs/docker-compose.md (#645) 2024-05-12 13:15:52 +08:00
小弟调调
3a1d780bbe doc: Update README.md #102 2024-05-11 19:01:53 +08:00
jaywcjlove
a2b8fc493b doc: Update README.md 2024-05-11 17:49:58 +08:00
jaywcjlove
7eaa5786d1 doc: update docs/docker-compose.md (#645) 2024-05-11 17:46:32 +08:00
github-actions[bot]
2dbcac300f doc: update README.md. 2024-05-11 06:10:47 +00:00
github-actions[bot]
127f2752dd doc: update CONTRIBUTING.md. 2024-05-11 06:10:46 +00:00
zhangym
19ed3fa3b2 feat: add docs/docker-compose.md (#645)
* feat: add docker-compose reference

* fix: alter note
2024-05-11 14:09:45 +08:00
jaywcjlove
c808475d59 released v1.43.0 2024-05-10 23:47:03 +08:00
jaywcjlove
63725cf4ab ci: update workflows config. 2024-05-10 23:47:03 +08:00
github-actions[bot]
fad6a20b13 doc: update README.md. 2024-05-10 11:12:18 +00:00
github-actions[bot]
1c5850b8e9 doc: update CONTRIBUTING.md. 2024-05-10 11:12:17 +00:00
Jeremy Jone
a64e21d466 doc: update README #102 (#643) 2024-05-10 19:10:58 +08:00
jaywcjlove
fcda71cfd3 doc: update docs/neo4j.md 2024-05-09 21:58:42 +08:00
jaywcjlove
450d3d8f0e doc: update docs/neo4j.md 2024-05-09 19:03:58 +08:00
jaywcjlove
f24b08489d doc: update docs/docker.md #640 2024-05-09 08:24:51 +08:00
github-actions[bot]
443f2ba7b0 doc: update README.md. 2024-05-08 22:51:00 +00:00
github-actions[bot]
da0c16aab7 doc: update CONTRIBUTING.md. 2024-05-08 22:50:59 +00:00
Kim同学
35e2e58205 doc: Update docker.md (#640)
新增一些常见的Docker运维项
新增一些常见的中间件、数据库容器启动示例和备注信息
2024-05-09 06:49:54 +08:00
github-actions[bot]
b9e327cfb7 doc: update README.md. 2024-05-08 00:02:10 +00:00
github-actions[bot]
01c8c04b30 doc: update CONTRIBUTING.md. 2024-05-08 00:02:08 +00:00
jaywcjlove
1b1ad3453c doc: update README.md 2024-05-08 08:00:47 +08:00
jaywcjlove
70e94f5cc9 doc: update docs/cpp.md (#589) 2024-05-07 14:56:12 +08:00
小弟调调
d70b190edc doc: Delete assets/Neo4j.svg 2024-05-07 14:38:53 +08:00
小弟调调
1df034e846 doc: Delete docs/Neo4j.md 2024-05-07 14:36:45 +08:00
github-actions[bot]
88d6e50319 doc: update README.md. 2024-05-07 06:20:57 +00:00
github-actions[bot]
265bffe9c1 doc: update CONTRIBUTING.md. 2024-05-07 06:20:56 +00:00
jqzhao
ffa69578a6 doc: update docs/cpp.md (#589)
* 数据结构和开发技巧以及C++面试知识点

* Update cpp.md

修改md中cpp格式
2024-05-07 14:20:30 +08:00
LesterChang0987
73106942ca doc: docs/mysql.md (#639)
* update neo4j.md

* update neo4j.md
2024-05-07 14:19:55 +08:00
github-actions[bot]
9446bc0ab9 doc: update README.md. 2024-05-07 01:53:51 +00:00
github-actions[bot]
4c86b97c40 doc: update CONTRIBUTING.md. 2024-05-07 01:53:50 +00:00
LesterChang0987
6f16c43dc5 doc: update neo4j.md (#638) 2024-05-07 09:52:51 +08:00
jaywcjlove
7c005d8e8a doc: update docs/fastapi.md 2024-05-06 07:01:20 +08:00
jaywcjlove
1a829ec469 doc: update neo4j document #636 2024-05-05 17:31:37 +08:00
jaywcjlove
4d638b26c5 doc: update docs/java.md #628 2024-05-05 16:58:56 +08:00
github-actions[bot]
22ecbc56a6 doc: update README.md. 2024-05-05 08:48:01 +00:00
github-actions[bot]
3d2c2d4d25 doc: update CONTRIBUTING.md. 2024-05-05 08:48:00 +00:00
github-actions[bot]
6f0ec249f6 doc: update README.md. 2024-05-05 08:46:57 +00:00
github-actions[bot]
654dc15eb6 doc: update CONTRIBUTING.md. 2024-05-05 08:46:56 +00:00
Jason Zhuang
c71ea7d356 doc: update docs/fastapi.md (#637)
Co-authored-by: AAJZ <aajz@163.com>
2024-05-05 16:46:46 +08:00
LesterChang0987
f6a29c9e9e fet: add docs/Neo4j.md (#636)
* 新增了c#中的类(所有内容都是经过书籍,资料证实的)

* 新增了c#中的类部分模块,元组模块,集合模块

* 更改了c#中集合的样式,之前显示出来有bug

* 新增了Neo4j模块

* 新增了Neo4j模块
2024-05-05 16:45:52 +08:00
小弟调调
bec51fa09f doc: Update README.md #102 2024-05-04 13:47:05 +08:00
小弟调调
aaf6d1669b doc: Update README.md (#102) 2024-04-29 19:30:55 +08:00
github-actions[bot]
0c4c020aaf doc: update README.md. 2024-04-28 10:46:24 +00:00
github-actions[bot]
5456dbfa24 doc: update CONTRIBUTING.md. 2024-04-28 10:46:24 +00:00
Aze
3ceb796324 doc: Update figma.md (#630)
figma.md  ffmpeg -> Figma
2024-04-28 18:45:21 +08:00
github-actions[bot]
87554d1616 doc: update README.md. 2024-04-28 04:14:33 +00:00
github-actions[bot]
69d5fe0b2a doc: update CONTRIBUTING.md. 2024-04-28 04:14:32 +00:00
LesterChang0987
404f5f1070 doc: uppdate docs/cs.md (#629)
* 新增了c#中的类(所有内容都是经过书籍,资料证实的)

* 新增了c#中的类部分模块,元组模块,集合模块

* 更改了c#中集合的样式,之前显示出来有bug
2024-04-28 12:13:30 +08:00
YuRuiH
c0b8eb4da7 docs: update docs/java.md. (#628) 2024-04-26 11:15:25 +08:00
小弟调调
7fa1528be5 doc: Update vim.md fix #625 2024-04-24 14:59:25 +08:00
jaywcjlove
564ef54c1b doc: update tauri.md 2024-04-23 16:15:21 +08:00
jaywcjlove
dd0d19cf1c doc: update elasticsearch.md (#623) 2024-04-23 16:15:21 +08:00
jaywcjlove
5c34078de5 doc: docs/oracle.md (#617) 2024-04-23 16:15:21 +08:00
github-actions[bot]
4e21fd05d1 doc: update README.md. 2024-04-23 05:49:16 +00:00
github-actions[bot]
d1fb7ad8cb doc: update CONTRIBUTING.md. 2024-04-23 05:49:15 +00:00
zhangym
43397a9cf7 feat: add elasticsearch reference (#623) 2024-04-23 13:48:00 +08:00
github-actions[bot]
166cbbd02f doc: update README.md. 2024-04-18 15:23:32 +00:00
github-actions[bot]
d52c7c2abc doc: update CONTRIBUTING.md. 2024-04-18 15:23:31 +00:00
SuperDiscovery
21ddcb51cb doc: update docs/tauri.md (#618) 2024-04-18 23:22:10 +08:00
github-actions[bot]
ac70a8d913 doc: update README.md. 2024-04-18 09:45:55 +00:00
github-actions[bot]
b28c141fdf doc: update CONTRIBUTING.md. 2024-04-18 09:45:54 +00:00
Kim同学
a9552508a0 doc: update oracle.md (#617)
增加DBA对Oracle维护巡检的常用SQL命令
2024-04-18 17:44:39 +08:00
小弟调调
2c61572a99 doc: Update README.md 2024-04-17 23:15:13 +08:00
jaywcjlove
d3ece9328d doc: update docs/cpp.md 2024-04-16 23:41:10 +08:00
jaywcjlove
d3e778ee35 doc: update docs/github-actions.md (#613) 2024-04-16 23:39:57 +08:00
github-actions[bot]
187fe9e8c0 doc: update README.md. 2024-04-16 13:50:12 +00:00
github-actions[bot]
fe5d52682e doc: update CONTRIBUTING.md. 2024-04-16 13:50:11 +00:00
lozhu
642aa08cd6 doc: update docs/github-actions.md (#613) 2024-04-16 21:48:51 +08:00
github-actions[bot]
8c80f47c99 doc: update README.md. 2024-04-16 08:11:38 +00:00
github-actions[bot]
e8e1a83240 doc: update CONTRIBUTING.md. 2024-04-16 08:11:37 +00:00
YuRuiH
c0ebe199d1 doc: update docs/cpp.md (#611) 2024-04-16 16:10:24 +08:00
jaywcjlove
ebcae6d5cd doc: update docs/tauri.md (#610) 2024-04-14 20:46:12 +08:00
github-actions[bot]
a39f00461b doc: update README.md. 2024-04-14 09:05:31 +00:00
github-actions[bot]
73099249f4 doc: update CONTRIBUTING.md. 2024-04-14 09:05:30 +00:00
SuperDiscovery
4db4c7a750 feat: add docs/tauri.md (#610) 2024-04-14 17:04:10 +08:00
jaywcjlove
9db13825c5 doc: update docs/github.md 2024-04-13 13:53:02 +08:00
jaywcjlove
444f2c8c91 doc: update README.md 2024-04-12 22:28:34 +08:00
jaywcjlove
e8af72372c doc: update docs/cs.md 2024-04-12 22:27:03 +08:00
github-actions[bot]
d8e1bdf6ca doc: update README.md. 2024-04-12 08:54:02 +00:00
github-actions[bot]
55587bd145 doc: update CONTRIBUTING.md. 2024-04-12 08:54:01 +00:00
Willxup
9684f7c9e4 doc: update docs/cs.md (#609)
* 增加国内镜像

* add reference of syntax sugar for c#

* optimizing page format for cs.md

* optimizing page format for cs.md

* add reference of linq for c#
2024-04-12 16:52:44 +08:00
jaywcjlove
51336f8b86 doc: update docs/cs.md (#608) 2024-04-11 20:09:17 +08:00
github-actions[bot]
f682690b9f doc: update README.md. 2024-04-11 09:43:17 +00:00
github-actions[bot]
6e46907d5c doc: update CONTRIBUTING.md. 2024-04-11 09:43:16 +00:00
Willxup
b0df70a952 doc: update docs/cs.md (#608)
* 增加国内镜像

* add reference of syntax sugar for c#

* optimizing page format for cs.md

* optimizing page format for cs.md
2024-04-11 17:42:00 +08:00
jaywcjlove
55be092001 doc: Update README.md 2024-04-11 02:10:55 +08:00
github-actions[bot]
7cf8fae835 doc: update README.md. 2024-04-10 15:23:07 +00:00
github-actions[bot]
8b3784038d doc: update CONTRIBUTING.md. 2024-04-10 15:23:07 +00:00
Willxup
f000ab5d67 doc: update README.md (#607) 2024-04-10 23:22:02 +08:00
github-actions[bot]
599e776b1a doc: update README.md. 2024-04-10 07:53:58 +00:00
github-actions[bot]
959afe6bf7 doc: update CONTRIBUTING.md. 2024-04-10 07:53:57 +00:00
Mao Wang
be81f1bfcb doc: update docs/mysql.md (#605) 2024-04-10 15:53:01 +08:00
jaywcjlove
3cee78a29e doc: add docs/ftp.md #596 2024-04-09 23:58:19 +08:00
github-actions[bot]
742c4b0018 doc: update README.md. 2024-04-09 10:14:56 +00:00
github-actions[bot]
e1d523036e doc: update CONTRIBUTING.md. 2024-04-09 10:14:55 +00:00
jaywcjlove
38bbf5d6d3 doc: update docs/kubernetes.md 2024-04-09 18:13:55 +08:00
jaywcjlove
0bced7ac0f doc: docs/bash.md 2024-04-09 18:13:55 +08:00
jaywcjlove
104f34dff9 doc: docs/bash.md 2024-04-09 18:13:55 +08:00
jaywcjlove
c3197fe24b doc: update docs/bash.md 2024-04-09 18:13:55 +08:00
jaywcjlove
d5e6cb3b62 doc: update docs/c.md 2024-04-09 18:13:55 +08:00
jlchen5
99e41b2798 doc: Update r.md (#604) 2024-04-09 18:13:38 +08:00
github-actions[bot]
93d760298e doc: update README.md. 2024-04-09 09:04:41 +00:00
github-actions[bot]
62777d1690 doc: update CONTRIBUTING.md. 2024-04-09 09:04:41 +00:00
cizai
881033ca36 doc: Update README.md (#602) (#102)
添加镜像站https://reference.cizai.io/
2024-04-09 17:03:43 +08:00
小弟调调
00cc7f7330 doc: Update README.md 2024-04-09 12:59:50 +08:00
github-actions[bot]
8c7cecb128 doc: update README.md. 2024-04-09 04:58:11 +00:00
github-actions[bot]
d4000a3c02 doc: update CONTRIBUTING.md. 2024-04-09 04:58:10 +00:00
jaywcjlove
7bb91f3f60 doc: update docs/java.md #601 2024-04-09 12:55:37 +08:00
YuRuiH
1b9437656d docs: update docs/java.md. (#601) 2024-04-09 11:44:38 +08:00
jaywcjlove
2b6b58d7fb doc: update docs/fastapi.md 2024-04-08 02:40:02 +08:00
github-actions[bot]
8dca5a8765 doc: update README.md. 2024-04-07 18:29:28 +00:00
github-actions[bot]
ce4e16fb75 doc: update CONTRIBUTING.md. 2024-04-07 18:29:27 +00:00
jaywcjlove
ae10c15d2a doc: update docs/fastapi.md 2024-04-08 02:27:58 +08:00
jaywcjlove
844bc6d307 doc: update docs/sdkman.md 2024-04-07 19:11:32 +08:00
Sacabambaspis
c343cb3587 doc: update docs/adb.md (#590) 2024-04-07 17:22:31 +08:00
小弟调调
7f0709f502 doc: Update README.md 2024-04-07 13:53:58 +08:00
小弟调调
d8427d22a9 doc: Update README.md 2024-04-07 13:53:19 +08:00
小弟调调
626b7ec961 doc: Update README.md (#102) 2024-04-07 00:45:58 +08:00
jaywcjlove
278ebee2c0 doc: update CONTRIBUTING.md 2024-04-06 12:05:42 +08:00
jaywcjlove
822af71d7f doc: update docs/twitter.md 2024-04-06 02:56:07 +08:00
jaywcjlove
b5f9d14ab1 doc: add docs/twitter.md 2024-04-06 02:27:19 +08:00
github-actions[bot]
0a012311dd doc: update README.md. 2024-04-03 05:52:02 +00:00
github-actions[bot]
c49b7002ce doc: update CONTRIBUTING.md. 2024-04-03 05:52:01 +00:00
jaywcjlove
bb605ea530 doc: update docs/sdkman.md (#588) 2024-04-03 13:49:47 +08:00
jaywcjlove
a3ffdd16fc doc: update docs/elixir.md #587 2024-04-03 12:37:20 +08:00
zhangym
b880c23f05 feat: update docs/sdkman.md (#588) 2024-04-03 12:37:06 +08:00
jaywcjlove
df3e46f34d doc: Update README.md 2024-04-02 16:11:34 +08:00
github-actions[bot]
a45fcfef20 doc: update README.md. 2024-04-02 08:10:42 +00:00
github-actions[bot]
3b65deb8d1 doc: update CONTRIBUTING.md. 2024-04-02 08:10:41 +00:00
jaywcjlove
3fdfa19b74 doc: update docs/elixir.md #587 2024-04-02 16:09:00 +08:00
gowshwah
8d60181b96 feat: add docs/elixir.md (#587)
Co-authored-by: gowshwah <1099764281@qq.com>
2024-04-02 15:16:48 +08:00
jaywcjlove
cb5df68489 doc: update docs/cs.md 2024-04-02 11:18:01 +08:00
github-actions[bot]
88f43a924a doc: update README.md. 2024-04-02 02:55:54 +00:00
github-actions[bot]
6f50c1adfd doc: update CONTRIBUTING.md. 2024-04-02 02:55:53 +00:00
LesterChang0987
c6d9901d5e doc: update docs/cs.md (#586)
* 新增了c#中的类(所有内容都是经过书籍,资料证实的)

* 新增了c#中的类部分模块,元组模块,集合模块
2024-04-02 10:54:58 +08:00
jaywcjlove
bd2d631b02 doc: update docs/feds.md 2024-04-01 14:18:04 +08:00
jaywcjlove
e25412175f doc: update docs/homebrew.md 2024-03-31 13:49:55 +08:00
jaywcjlove
b6ca1e5166 doc: update docs/homebrew.md 2024-03-31 12:55:18 +08:00
小弟调调
3d0ce212a9 doc: Update README.md 2024-03-31 02:36:51 +08:00
github-actions[bot]
2a4c08a69e doc: update README.md. 2024-03-29 07:25:37 +00:00
github-actions[bot]
3ddb8959c5 doc: update CONTRIBUTING.md. 2024-03-29 07:25:36 +00:00
jaywcjlove
37906f6548 doc: update docs/docker.md #583 2024-03-29 15:23:58 +08:00
github-actions[bot]
ce2640f9cf doc: update README.md. 2024-03-26 13:13:12 +00:00
github-actions[bot]
9e42db6fcb doc: update CONTRIBUTING.md. 2024-03-26 13:13:11 +00:00
jaywcjlove
fd85b9d819 doc: update docs/docker.md #583 2024-03-26 09:11:41 -04:00
jaywcjlove
2dd3fd1e84 doc: update docs/cs.md #584 2024-03-26 09:09:14 -04:00
jaywcjlove
21dc25c2a4 doc: update docs/cs.md #584 2024-03-26 09:03:19 -04:00
LesterChang0987
ea8d6b3391 doc: update docs/cs.md (#584) 2024-03-26 08:38:18 -04:00
jaywcjlove
1efbb7155b doc: update docs/docker.md #583 2024-03-26 05:31:07 -04:00
Maylon
22194283aa doc: Update docker.md (#583) 2024-03-26 05:09:37 -04:00
Maylon
56d8186e0a doc: Update docker.md (#582)
add docker installation
2024-03-25 20:07:49 +08:00
github-actions[bot]
9e5e671a1a doc: update README.md. 2024-03-24 08:20:36 +00:00
github-actions[bot]
dc3005bc99 doc: update CONTRIBUTING.md. 2024-03-24 08:20:35 +00:00
zhangym
dedb8b9475 doc: update docs/iso-3166-1.md (#581 #579)
* doc: Add content related to simplified and traditional Chinese

* doc: alter number

---------

Co-authored-by: zhangyanming <zhangyanming@kxsz.net>
2024-03-24 04:19:17 -04:00
jaywcjlove
6f978c8df0 doc: add docs/iso-3166-1.md #579 2024-03-22 20:34:32 +08:00
jaywcjlove
8ce7714bca doc: update docs/nvm.md (#512) 2024-03-22 06:18:15 +08:00
github-actions[bot]
f8b4ef611f doc: update README.md. 2024-03-21 21:38:28 +00:00
github-actions[bot]
057eddb4b2 doc: update CONTRIBUTING.md. 2024-03-21 21:38:27 +00:00
DEEMO101
6dfc13ee6d doc: add nvm-windows (#512) 2024-03-22 05:37:22 +08:00
小弟调调
b77f29a1c2 doc: Update README.md #102 2024-03-20 13:12:46 +08:00
github-actions[bot]
55f807f407 doc: update README.md. 2024-03-20 03:32:45 +00:00
github-actions[bot]
2e2b3b8ee4 doc: update CONTRIBUTING.md. 2024-03-20 03:32:44 +00:00
BlacAmDK
234da6d914 doc: update docs/emacs.md (#573) 2024-03-20 11:31:37 +08:00
小弟调调
36068c9ad3 doc: Update README.md #102 2024-03-19 23:03:14 +08:00
jaywcjlove
359b81a44f feat: add docs/phpstorm.md. #571 2024-03-15 21:58:44 +08:00
小弟调调
20b3a1969d doc: Update README.md (#102) 2024-03-15 16:31:50 +08:00
jaywcjlove
d59d128bd1 doc: update docs/cs.md #566 2024-03-14 00:04:47 +08:00
github-actions[bot]
f5ce635f97 doc: update README.md. 2024-03-13 15:45:11 +00:00
github-actions[bot]
d6121b3ce9 doc: update CONTRIBUTING.md. 2024-03-13 15:45:10 +00:00
小弟调调
e5ccf68774 doc: Update README.md #102 2024-03-13 23:44:05 +08:00
BobH
f3699e12cd doc: Update cs.md (#566)
* doc: Update cs.md

将“逻辑运算”更变为一级标题

* <update>[cs.md]: add subtitle `运算符和表达式`

将`运算符和表达式`和`字符串`区分开
2024-03-13 23:42:36 +08:00
jaywcjlove
88452a8b07 feat: add docs/figma.md #567 2024-03-13 21:22:54 +08:00
github-actions[bot]
2d8753a6a5 doc: update README.md. 2024-03-12 13:02:19 +00:00
github-actions[bot]
a7a5d029d5 doc: update CONTRIBUTING.md. 2024-03-12 13:02:18 +00:00
南宫乘风
dabb4b2cd7 doc: update docs/docker.md (#565)
* doc: update ansible.md

* doc: update ansible.md 代码格式

* 增加十分钟同步的域名、增加自动部署脚本

* 优化部署文档:定时任务同步pages的内容

* 优化 git-down-pages.sh 脚本 到配置

* update  README.md

* 更新代码

* update: doc ansible.md

* update CONTRIBUTING.md

* update CONTRIBUTING.md fix

* 优化ansible排版格式

* fix: 定时脚本的逻辑 bug

* update: ansible.md

* update: 增加 docker 的清除命令

---------

Co-authored-by: 魏栋梁 <dongliang.wei@fujfu.com>
2024-03-12 21:01:17 +08:00
github-actions[bot]
f318e2456d doc: update README.md. 2024-03-10 04:20:48 +00:00
github-actions[bot]
8250615bca doc: update CONTRIBUTING.md. 2024-03-10 04:20:48 +00:00
Weidong Guo
f7c2d6555f doc: update docs/python.md (#564)
when we installed pipenv pkg, we can't run pipenv install command on our local shell, because maybe we didn't have the site-package-bin dir in system $PATH, so we need to add it firstly.
2024-03-10 12:19:42 +08:00
小弟调调
a15bd68a59 doc: Update README.md 2024-03-09 16:16:11 +08:00
github-actions[bot]
5d82708d56 doc: update README.md. 2024-03-07 16:47:55 +00:00
github-actions[bot]
fda807a97b doc: update CONTRIBUTING.md. 2024-03-07 16:47:54 +00:00
Jovins
c076d32fc1 doc: update docs/swiftui.md (#562) 2024-03-08 00:46:43 +08:00
github-actions[bot]
da7cccb50b doc: update README.md. 2024-03-07 16:46:18 +00:00
github-actions[bot]
349d811c66 doc: update CONTRIBUTING.md. 2024-03-07 16:46:17 +00:00
Blanket58
4c7e86893d doc: update docs/r.md (#561)
Add book link to my study notes of R.
2024-03-08 00:45:16 +08:00
github-actions[bot]
b040885e8b doc: update README.md. 2024-03-07 06:46:06 +00:00
github-actions[bot]
925a2913c4 doc: update CONTRIBUTING.md. 2024-03-07 06:46:05 +00:00
findnr
76785c6c55 doc: Update README.md (#560) #102 2024-03-07 14:45:07 +08:00
Jovins
13991b8b5e doc: update docs/swift.md (#558)
* fix issue

* add extension

* update
2024-03-06 17:36:48 +08:00
github-actions[bot]
e5ad863e2d doc: update README.md. 2024-03-06 06:21:26 +00:00
github-actions[bot]
3c2e52f47e doc: update CONTRIBUTING.md. 2024-03-06 06:21:25 +00:00
findnr
137210c886 doc: Update README.md (#557) (#102) 2024-03-06 14:20:23 +08:00
github-actions[bot]
60e83d0e0b doc: update README.md. 2024-03-05 13:25:34 +00:00
github-actions[bot]
338b54f3c5 doc: update CONTRIBUTING.md. 2024-03-05 13:25:33 +00:00
JavaZero
5fc5c065df doc: update docs/pytorch.md (#554) 2024-03-05 21:23:43 +08:00
github-actions[bot]
435fdead51 doc: update README.md. 2024-03-05 08:37:46 +00:00
github-actions[bot]
61f4697406 doc: update CONTRIBUTING.md. 2024-03-05 08:37:45 +00:00
jaywcjlove
6122942c95 doc: update docs/swift.md 2024-03-05 16:35:42 +08:00
TRDSCSH
57d42b29ba doc: update docs/swift.md (#550) 2024-03-05 15:12:10 +08:00
小弟调调
ee97d75160 chore: Update .gitattributes 2024-03-05 03:50:37 +08:00
小弟调调
cff4119203 doc: Update README.md #102 2024-03-04 23:20:17 +08:00
小弟调调
4dfb3c8e9f doc: Update README.md #102 2024-03-04 22:03:44 +08:00
小弟调调
50526ab7a4 chore: Update .gitattributes 2024-03-04 17:09:01 +08:00
小弟调调
6a9c656af6 doc: Update README.md #102 2024-03-04 17:07:46 +08:00
小弟调调
ee1c50166c chore: Update .gitattributes 2024-03-04 11:33:25 +08:00
小弟调调
18189760b7 doc: Update README.md 2024-03-03 22:17:14 +08:00
github-actions[bot]
e8c86ad588 doc: update README.md. 2024-02-29 04:07:42 +00:00
github-actions[bot]
d9ff20b22c doc: update CONTRIBUTING.md. 2024-02-29 04:07:41 +00:00
南宫乘风
c03deba9a5 doc: update docs/ansible.md (#543)
* doc: update ansible.md

* doc: update ansible.md 代码格式

* 增加十分钟同步的域名、增加自动部署脚本

* 优化部署文档:定时任务同步pages的内容

* 优化 git-down-pages.sh 脚本 到配置

* update  README.md

* 更新代码

* update: doc ansible.md

* update CONTRIBUTING.md

* update CONTRIBUTING.md fix

* 优化ansible排版格式

* fix: 定时脚本的逻辑 bug

* update: ansible.md

---------

Co-authored-by: 魏栋梁 <dongliang.wei@fujfu.com>
2024-02-29 12:06:43 +08:00
jaywcjlove
6358f19144 fix: fix markdown lint issue. 2024-02-29 11:29:56 +08:00
jaywcjlove
8ef5df72f0 doc: update docs/ansible.md #535 2024-02-29 11:29:15 +08:00
南宫乘风
704ba7332e doc: update docs/ansible.md (#542)
* doc: update ansible.md

* doc: update ansible.md 代码格式

* 增加十分钟同步的域名、增加自动部署脚本

* 优化部署文档:定时任务同步pages的内容

* 优化 git-down-pages.sh 脚本 到配置

* update  README.md

* 更新代码

* update: doc ansible.md

* update CONTRIBUTING.md

* update CONTRIBUTING.md fix

* 优化ansible排版格式

---------

Co-authored-by: 魏栋梁 <dongliang.wei@fujfu.com>
2024-02-29 10:59:18 +08:00
小弟调调
bc4e48c5fd doc: Update README.md #102 2024-02-29 10:27:39 +08:00
github-actions[bot]
587aa7e304 doc: update README.md. 2024-02-29 01:51:38 +00:00
github-actions[bot]
bacaf4df44 doc: update CONTRIBUTING.md. 2024-02-29 01:51:37 +00:00
南宫乘风
1da65002ba doc: update docs/ansible.md (#541)
* doc: update ansible.md

* doc: update ansible.md 代码格式

* 增加十分钟同步的域名、增加自动部署脚本

* 优化部署文档:定时任务同步pages的内容

* 优化 git-down-pages.sh 脚本 到配置

* update  README.md

* 更新代码

* update: doc ansible.md

* update CONTRIBUTING.md

* update CONTRIBUTING.md fix

---------

Co-authored-by: 魏栋梁 <dongliang.wei@fujfu.com>
2024-02-29 09:50:27 +08:00
jaywcjlove
11dc28cea3 doc: update CONTRIBUTING.md #535 2024-02-29 01:04:10 +08:00
github-actions[bot]
8c21b7126a doc: update README.md. 2024-02-28 15:59:22 +00:00
github-actions[bot]
7da5b74811 doc: update CONTRIBUTING.md. 2024-02-28 15:59:21 +00:00
南宫乘风
893391cc3b doc: update docs/ansible.md & update CONTRIBUTING.md (#535)
* doc: update ansible.md

* doc: update ansible.md 代码格式

* 增加十分钟同步的域名、增加自动部署脚本

* 优化部署文档:定时任务同步pages的内容

* 优化 git-down-pages.sh 脚本 到配置

* update  README.md

---------

Co-authored-by: 魏栋梁 <dongliang.wei@fujfu.com>
2024-02-28 23:58:09 +08:00
小弟调调
20c2bfdbef doc: Update README.md #102 2024-02-28 13:15:22 +08:00
github-actions[bot]
4e40ae2b1d doc: update README.md. 2024-02-28 05:13:22 +00:00
github-actions[bot]
52fc7597ca doc: update CONTRIBUTING.md. 2024-02-28 05:13:21 +00:00
南宫乘风
f176bf6f56 doc: update ansible.md (#534)
Co-authored-by: 魏栋梁 <dongliang.wei@fujfu.com>
2024-02-28 13:12:11 +08:00
jaywcjlove
67c7a0ef49 ci: update workflows config. 2024-02-27 10:45:49 +08:00
jaywcjlove
04a12487c0 doc: Update README.md #102 2024-02-27 10:38:35 +08:00
jaywcjlove
4305ed8bd9 ci: update workflows config. 2024-02-26 23:35:00 +08:00
renovate[bot]
2f66dbc882 chore(deps): update dependency markdownlint to ^0.33.0 (#334)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-26 23:31:42 +08:00
renovate[bot]
9d8e885aec chore(deps): update dependency lint-staged to v15 (#459)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-26 23:30:35 +08:00
renovate[bot]
fbbc5195f7 chore(deps): update dependency markdownlint-cli to ^0.39.0 (#362)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-26 23:30:22 +08:00
renovate[bot]
72109ba7b6 chore(deps): update ruby docker tag to v3.3.0 (#494)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-26 23:29:50 +08:00
jaywcjlove
f263431ab1 feat: add docs/r.md #410 #285 #283 2024-02-26 23:27:37 +08:00
jaywcjlove
fae20e6a71 chore: update husky config. 2024-02-26 16:10:09 +08:00
renovate[bot]
706fe7855f chore(deps): update dependency husky to v9 (#510)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-26 16:08:36 +08:00
jaywcjlove
f5e5357de7 doc: update docs/sketch.md 2024-02-26 16:06:30 +08:00
jaywcjlove
cb434e1180 feat: add finder.md. 2024-02-26 15:47:23 +08:00
jaywcjlove
df9bf1f5e9 feat: add Pacman. 2024-02-26 15:04:52 +08:00
jaywcjlove
a0754c5397 doc: Update README.md 2024-02-26 14:30:47 +08:00
89 changed files with 17959 additions and 1901 deletions

3
.gitattributes vendored
View File

@@ -1,3 +1,4 @@
Dockerfile linguist-documentation=false
.husky/* linguist-vendored
*.svg linguist-language=md
*.md linguist-detectable=true

5
.github/FUNDING.yml vendored
View File

@@ -3,7 +3,8 @@
# github: [jaywcjlove]
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
# ko_fi: # Replace with a single Ko-fi username
ko_fi: jaywcjlove
buy_me_a_coffee: jaywcjlove
# tidelift: #npm/mocker-api
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
custom: https://jaywcjlove.github.io/#/sponsor
custom: ["https://www.paypal.me/kennyiseeyou", "https://jaywcjlove.github.io/#/sponsor"]

View File

@@ -74,7 +74,7 @@ jobs:
EOF
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
commit_message: ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -84,16 +84,18 @@ jobs:
id: changelog
uses: jaywcjlove/changelog-generator@main
with:
filter-author: (小弟调调™|github-actions-bot|\@github\-actions\-bot|dependabot|renovate\\[bot\\]|dependabot\\[bot\\]|Renovate Bot)
filter-author: (小弟调调™|\@github-actions-bot\@renovate-bot|dependabot|renovate\\[bot\\]|dependabot\\[bot\\]|Renovate Bot)
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)
- name: Create Release
uses: ncipollo/release-action@v1
uses: jaywcjlove/create-tag-action@main
if: steps.create_tag.outputs.successful
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.create_tag.outputs.version }}
tag: ${{ steps.create_tag.outputs.version }}
package-path: ./package.json
version: ${{steps.create_tag.outputs.version}}
release: true
prerelease: false
draft: false
body: |
[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)
@@ -134,7 +136,7 @@ jobs:
- run: docker buildx prune
- name: Build and push image:latest
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
push: true
context: .
@@ -142,7 +144,7 @@ jobs:
tags: wcjiang/reference:latest
- name: Build and push image:tags
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
if: steps.create_tag.outputs.successful
with:
push: true

View File

@@ -22,7 +22,7 @@ jobs:
cd dist
ls
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
path: ${{ github.workspace }}\dist\**\*

3
.husky/pre-commit vendored
View File

@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no-install lint-staged

View File

@@ -4,7 +4,11 @@
"MD014": false,
"MD024": false,
"MD033": false,
"MD036": false,
"MD040": false,
"MD055": false,
"MD056": false,
"MD051": false,
"MD010": {
"code_blocks": true,
"spaces_per_tab": 2

View File

@@ -1,7 +1,7 @@
Contributing 贡献
====
感谢您对**备忘清单**贡献的兴趣👍👍,是像您这样的人使 [`Quick Reference`](https://jaywcjlove.github.io/reference) 成为如此出色的网站 🎉🎉。随时提交问题和增强请求。
感谢您对**备忘清单**贡献的兴趣👍👍,是像您这样的人使 [`Quick Reference`](https://jaywcjlove.github.io/reference) 成为如此出色的网站 🎉🎉。随时提交问题和增强请求,还提供一个[在线说明排版说明]( https://wangchujiang.com/reference/docs/quickreference.html),所以各种使用技巧,都在这个排版说明中有预览和实现代码
`docs/{filename}.md` 文件将被处理成备忘清单,让我们创建或编辑一个 `markdown` 文件:
@@ -98,6 +98,123 @@ $ npm run start # 监听 md 文件编译输出 HTML
$ git clone https://github.com/jaywcjlove/reference.git -b gh-pages
```
**定时更新**
在 Linux 服务执行创建 `git-down-pages.sh` 脚本,将脚本放置在 `/opt/cron/` 目录下
> 注意:⚠️ 脚本会根据线上 pages 的 commit 和 本地 commit 比较。如果不一致才会同步更新,否则跳过
下面是脚本 `git-down-pages.sh` 的源码
```bash
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#author: 南宫乘风
DATA_DIR="/data"
REPO_URL="https://gitee.com/jaywcjlove/reference.git"
BRANCH="gh-pages"
MAX_BACKUPS=3
# 函数:备份旧版本
backup_old_version() {
echo "备份旧版本..."
mv ../reference ../reference_backup_$(date +%Y%m%d%H%M%S)
if [ $? -eq 0 ]; then
echo "备份完成。"
remove_old_backups
else
echo "备份时出现错误。"
exit 1
fi
}
# 函数:删除多余备份,保留最近的三个
remove_old_backups() {
echo "删除多余备份,保留最近的三个..."
ls -1d ../reference_backup_* | head -n -${MAX_BACKUPS} | xargs -r rm -r
}
# 函数:拉取最新代码
clone_latest_code() {
echo "拉取最新代码..."
# 进入 /data 目录
cd $DATA_DIR
git clone $REPO_URL -b $BRANCH
if [ $? -eq 0 ]; then
echo "拉取最新代码完成。"
else
echo "拉取最新代码时出现错误。"
exit 1
fi
}
# 检查是否存在 DATA_DIR 目录,不存在则创建
if [ ! -d "$DATA_DIR" ]; then
echo "目录 $DATA_DIR 不存在,创建中..."
mkdir -p "$DATA_DIR"
if [ $? -eq 0 ]; then
echo "目录创建成功。"
else
echo "目录创建失败。"
exit 1
fi
fi
# 进入 /data 目录
cd $DATA_DIR
# 检查是否存在 reference 目录
if [ -d "reference" ]; then
# 进入 reference 目录
cd reference
# 获取远程和本地的 commit 哈希值
REMOTE_COMMIT=$(git ls-remote $REPO_URL $BRANCH | cut -f1)
LOCAL_COMMIT=$(git rev-parse HEAD)
# 比较远程和本地的 commit
if [ "$REMOTE_COMMIT" == "$LOCAL_COMMIT" ]; then
echo "本地 'reference' 目录已经是最新版本,无需拉取。"
else
echo "本地 'reference' 目录不是最新版本,开始拉取最新代码..."
backup_old_version
clone_latest_code
fi
else
# 如果目录不存在,直接克隆
clone_latest_code
fi
echo "----------------------------------------------------------------------------"
endDate=`date +"%Y-%m-%d %H:%M:%S"`
echo "★[$endDate] Successful"
echo "----------------------------------------------------------------------------"
```
**创建定时任务**
注意:请把脚本放在 `/opt/cron/` 目录下 (时间可以根据自己需求设定),下面案例:每十分钟同步线上的 `pages` 的内容
```shell
crontab -e
*/10 * * * * /opt/cron/git-down-pages.sh >> /opt/cron/git-down.log 2>&1
```
**添加 NGINX 配置:**
```nginx
listen 80;
listen 443 ssl http2;
server_name xxx.xxx.top; #配置你的域名
index index.php index.html index.htm default.php default.htm default.html;
root /data/reference; # 文件存放的位置
```
### 方法二,使用 [docker](https://hub.docker.com/r/wcjiang/reference) 快捷部署 web 版
```shell
@@ -161,6 +278,7 @@ REF_LABEL=网站首页
- [quickreference.pages.dev](https://quickreference.pages.dev/)
- [code05.com](https://reference.code05.com/)
- [xhfun.cn](https://ref.xhfun.cn/)
- [ownit.top](https://memo.ownit.top/)
感谢🙏
@@ -210,369 +328,157 @@ jobs:
请参阅[贡献指南](./CONTRIBUTING.md)了解如何开始。一如既往,感谢我们出色的贡献者!
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调">
<img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调"/>
</a>
<a href="https://github.com/fwqaaq" title="fwqaaq">
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fwqaaq"/>
</a>
<a href="https://github.com/mofelee" title="mofelee">
<img src="https://avatars.githubusercontent.com/u/5069410?v=4" width="42;" alt="mofelee"/>
</a>
<a href="https://github.com/Country-If" title="Maylon">
<img src="https://avatars.githubusercontent.com/u/62837275?v=4" width="42;" alt="Maylon"/>
</a>
<a href="https://github.com/JeffersonHuang" title="Jefferson Huang">
<img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson Huang"/>
</a>
<a href="https://github.com/aixcyi" title="砹小翼">
<img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"/>
</a>
<a href="https://github.com/Alex20180512" title="Alex">
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
</a>
<a href="https://github.com/undefined-hestudio" title="undefined">
<img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"/>
</a>
<a href="https://github.com/eryajf" title="二丫讲梵">
<img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/>
</a>
<a href="https://github.com/k23223" title="k23223">
<img src="https://avatars.githubusercontent.com/u/57606136?v=4" width="42;" alt="k23223"/>
</a>
<a href="https://github.com/expoli" title="expoli">
<img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/>
</a>
<a href="https://github.com/mailbaoer" title="baoer">
<img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/>
</a>
<a href="https://github.com/LufsX" title="LufsX">
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
</a>
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu">
<img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/>
</a>
<a href="https://github.com/chaos-cn" title="chaos">
<img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/>
</a>
<a href="https://github.com/1250422131" title="萌新杰少">
<img src="https://avatars.githubusercontent.com/u/52126790?v=4" width="42;" alt="萌新杰少"/>
</a>
<a href="https://github.com/MackDing" title="Blossom">
<img src="https://avatars.githubusercontent.com/u/19878893?v=4" width="42;" alt="Blossom"/>
</a>
<a href="https://github.com/Darkiiiiiice" title="Darkiiiiiice">
<img src="https://avatars.githubusercontent.com/u/3959555?v=4" width="42;" alt="Darkiiiiiice"/>
</a>
<a href="https://github.com/qyl27" title="秋 雨落">
<img src="https://avatars.githubusercontent.com/u/53731501?v=4" width="42;" alt="秋 雨落"/>
</a>
<a href="https://github.com/lvelvee" title="Lve Lvee">
<img src="https://avatars.githubusercontent.com/u/25785753?v=4" width="42;" alt="Lve Lvee"/>
</a>
<a href="https://github.com/wsypower" title="魏">
<img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/>
</a>
<a href="https://github.com/itldg" title="老大哥">
<img src="https://avatars.githubusercontent.com/u/13432299?v=4" width="42;" alt="老大哥"/>
</a>
<a href="https://github.com/catcto" title="小武Alan">
<img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="小武Alan"/>
</a>
<a href="https://github.com/ryanhex53" title="ryanhex53">
<img src="https://avatars.githubusercontent.com/u/360426?v=4" width="42;" alt="ryanhex53"/>
</a>
<a href="https://github.com/partoneplay" title="partoneplay">
<img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/>
</a>
<a href="https://github.com/pangxiaoli" title="pangxiaoli">
<img src="https://avatars.githubusercontent.com/u/54620953?v=4" width="42;" alt="pangxiaoli"/>
</a>
<a href="https://github.com/mancuoj" title="mancuoj">
<img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/>
</a>
<a href="https://github.com/1834423612" title="kjch">
<img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/>
</a>
<a href="https://github.com/greyhao" title="greyhao">
<img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/>
</a>
<a href="https://github.com/XYZscratcher" title="XYZ">
<img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/>
</a>
<a href="https://github.com/ljq" title="Jack Liu">
<img src="https://avatars.githubusercontent.com/u/7278286?v=4" width="42;" alt="Jack Liu"/>
</a>
<a href="https://github.com/dadatom" title="Da Da">
<img src="https://avatars.githubusercontent.com/u/33886943?v=4" width="42;" alt="Da Da"/>
</a>
<a href="https://github.com/webeautiful" title="Albert">
<img src="https://avatars.githubusercontent.com/u/3364316?v=4" width="42;" alt="Albert"/>
</a>
<a href="https://github.com/yanxuplay" title="hupilan">
<img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/>
</a>
<a href="https://github.com/hweining" title="hweining">
<img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/>
</a>
<a href="https://github.com/infanx" title="infanx">
<img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/>
</a>
<a href="https://github.com/auroraslot" title="Tang Weize">
<img src="https://avatars.githubusercontent.com/u/48817882?v=4" width="42;" alt="Tang Weize"/>
</a>
<a href="https://github.com/joyfully-W" title="joyfully-W">
<img src="https://avatars.githubusercontent.com/u/32212924?v=4" width="42;" alt="joyfully-W"/>
</a>
<a href="https://github.com/jussker" title="jussker">
<img src="https://avatars.githubusercontent.com/u/33953356?v=4" width="42;" alt="jussker"/>
</a>
<a href="https://github.com/k983551019" title="k983551019">
<img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/>
</a>
<a href="https://github.com/kdxcxs" title="kdxcxs">
<img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/>
</a>
<a href="https://github.com/genius-kim" title="Kim同学">
<img src="https://avatars.githubusercontent.com/u/119488561?v=4" width="42;" alt="Kim同学"/>
</a>
<a href="https://github.com/kubeme" title="kubernetes for me">
<img src="https://avatars.githubusercontent.com/u/16346220?v=4" width="42;" alt="kubernetes for me"/>
</a>
<a href="https://github.com/larry-xue" title="larry">
<img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/>
</a>
<a href="https://github.com/hua03" title="hua03">
<img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/>
</a>
<a href="https://github.com/gzttcydxx" title="gzttcydxx">
<img src="https://avatars.githubusercontent.com/u/50025185?v=4" width="42;" alt="gzttcydxx"/>
</a>
<a href="https://github.com/sunny0826" title="Xudong Guo">
<img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/>
</a>
<a href="https://github.com/godotc" title="godot42">
<img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godot42"/>
</a>
<a href="https://github.com/gi-b716" title="gi-b716">
<img src="https://avatars.githubusercontent.com/u/78394473?v=4" width="42;" alt="gi-b716"/>
</a>
<a href="https://github.com/fjqz177" title="fjqz177">
<img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/>
</a>
<a href="https://github.com/fakevn" title="fakevn">
<img src="https://avatars.githubusercontent.com/u/11464386?v=4" width="42;" alt="fakevn"/>
</a>
<a href="https://github.com/cool9203" title="cool9203">
<img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/>
</a>
<a href="https://github.com/gaoxiaoduan" title="CoderDuan">
<img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="CoderDuan"/>
</a>
<a href="https://github.com/chyok" title="chyok">
<img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/>
</a>
<a href="https://github.com/zlfyuan" title="bgbgPang">
<img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/>
</a>
<a href="https://github.com/Zeng-qh" title="都一样">
<img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/>
</a>
<a href="https://github.com/binscor" title="Zheng Nai Bin">
<img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/>
</a>
<a href="https://github.com/qwxingzhe" title="行者">
<img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/>
</a>
<a href="https://github.com/HuaChan233" title="花开花落">
<img src="https://avatars.githubusercontent.com/u/75212820?v=4" width="42;" alt="花开花落"/>
</a>
<a href="https://github.com/lisheng741" title="芦荟柚子茶">
<img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/>
</a>
<a href="https://github.com/ZIDOUZI" title="ZIDOUZI">
<img src="https://avatars.githubusercontent.com/u/53157536?v=4" width="42;" alt="ZIDOUZI"/>
</a>
<a href="https://github.com/LuckyJie12" title="夜未央">
<img src="https://avatars.githubusercontent.com/u/102901105?v=4" width="42;" alt="夜未央"/>
</a>
<a href="https://github.com/lvzhenbo" title="吕振波">
<img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/>
</a>
<a href="https://github.com/zxx457" title="zxx457">
<img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx457"/>
</a>
<a href="https://github.com/zhouhw0306" title="zhouhw0306">
<img src="https://avatars.githubusercontent.com/u/82752681?v=4" width="42;" alt="zhouhw0306"/>
</a>
<a href="https://github.com/hiyms" title="yms">
<img src="https://avatars.githubusercontent.com/u/84654050?v=4" width="42;" alt="yms"/>
</a>
<a href="https://github.com/xing133" title="xing133">
<img src="https://avatars.githubusercontent.com/u/5336490?v=4" width="42;" alt="xing133"/>
</a>
<a href="https://github.com/wjjwkwindy" title="Hudson Alen">
<img src="https://avatars.githubusercontent.com/u/9508591?v=4" width="42;" alt="Hudson Alen"/>
</a>
<a href="https://github.com/wannima66" title="tmen">
<img src="https://avatars.githubusercontent.com/u/26410255?v=4" width="42;" alt="tmen"/>
</a>
<a href="https://github.com/swift-fs" title="swift">
<img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift"/>
</a>
<a href="https://github.com/suyangzuo" title="suyangzuo">
<img src="https://avatars.githubusercontent.com/u/50766353?v=4" width="42;" alt="suyangzuo"/>
</a>
<a href="https://github.com/Mowmowj" title="nexo">
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/>
</a>
<a href="https://github.com/phygerr" title="phygerr">
<img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/>
</a>
<a href="https://github.com/onewesong" title="onewesong">
<img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/>
</a>
<a href="https://github.com/miclon-dev" title="miclon-dev">
<img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/>
</a>
<a href="https://github.com/lykjjj" title="lykjjj">
<img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/>
</a>
<a href="https://github.com/liliangrong777" title="liliangrong777">
<img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/>
</a>
<a href="https://github.com/Moeyuuko" title="Moeyuuko">
<img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/>
</a>
<a href="https://github.com/malcolmyu" title="Minghao Yu">
<img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/>
</a>
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski">
<img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/>
</a>
<a href="https://github.com/likeshop-github" title="LikeShop技术社区">
<img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="LikeShop技术社区"/>
</a>
<a href="https://github.com/Lihuagreek" title="Lihuagreek">
<img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/>
</a>
<a href="https://github.com/LightQuanta" title="Light_Quanta">
<img src="https://avatars.githubusercontent.com/u/18213217?v=4" width="42;" alt="Light_Quanta"/>
</a>
<a href="https://github.com/JetSquirrel" title="JetSquirrel">
<img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/>
</a>
<a href="https://github.com/jasnzhuang" title="Jason Zhuang">
<img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/>
</a>
<a href="https://github.com/Ding-Kyoma" title="HooinKyoma">
<img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/>
</a>
<a href="https://github.com/gongyeheyu" title="GONGYE Heyu">
<img src="https://avatars.githubusercontent.com/u/85177605?v=4" width="42;" alt="GONGYE Heyu"/>
</a>
<a href="https://github.com/Fuku-L" title="Fuku-L">
<img src="https://avatars.githubusercontent.com/u/38535911?v=4" width="42;" alt="Fuku-L"/>
</a>
<a href="https://github.com/sirius-fan" title="Fan">
<img src="https://avatars.githubusercontent.com/u/25720015?v=4" width="42;" alt="Fan"/>
</a>
<a href="https://github.com/eeeeeio" title="EEEEE">
<img src="https://avatars.githubusercontent.com/u/20723545?v=4" width="42;" alt="EEEEE"/>
</a>
<a href="https://github.com/demigodliu" title="DemigodLiu">
<img src="https://avatars.githubusercontent.com/u/30372735?v=4" width="42;" alt="DemigodLiu"/>
</a>
<a href="https://github.com/dasferco" title="Dasferco">
<img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/>
</a>
<a href="https://github.com/Damao2250" title="Damao">
<img src="https://avatars.githubusercontent.com/u/19251992?v=4" width="42;" alt="Damao"/>
</a>
<a href="https://github.com/ohto-ai" title="Choo">
<img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/>
</a>
<a href="https://github.com/CharlotteZeng" title="hanchZ">
<img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/>
</a>
<a href="https://github.com/ch3nnn" title="chentong">
<img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="chentong"/>
</a>
<a href="https://github.com/Brid9e" title="Joe">
<img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Joe"/>
</a>
<a href="https://github.com/dousha0w0" title="dousha0w0">
<img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/>
</a>
<a href="https://github.com/13812700839" title="花殇">
<img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/>
</a>
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm">
<img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/>
</a>
<a href="https://github.com/y52y" title="Zyj">
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
</a>
<a href="https://github.com/Leaderzhangyi" title="ZinkCas">
<img src="https://avatars.githubusercontent.com/u/46915666?v=4" width="42;" alt="ZinkCas"/>
</a>
<a href="https://github.com/zhu0629" title="zhucong">
<img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="zhucong"/>
</a>
<a href="https://github.com/yikuaibro" title="yikuaibro">
<img src="https://avatars.githubusercontent.com/u/44493045?v=4" width="42;" alt="yikuaibro"/>
</a>
<a href="https://github.com/dfshizhiqiang" title="Zech">
<img src="https://avatars.githubusercontent.com/u/7030019?v=4" width="42;" alt="Zech"/>
</a>
<a href="https://github.com/Yo-gurts" title="Yogurt">
<img src="https://avatars.githubusercontent.com/u/44612841?v=4" width="42;" alt="Yogurt"/>
</a>
<a href="https://github.com/hi-liyan" title="李李李">
<img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="李李李"/>
</a>
<a href="https://github.com/BATTLEHAWK00" title="While True: learn()">
<img src="https://avatars.githubusercontent.com/u/45313304?v=4" width="42;" alt="While True: learn()"/>
</a>
<a href="https://github.com/whb1998a" title="WHB">
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
</a>
<a href="https://github.com/YLee9527" title="Terry Young">
<img src="https://avatars.githubusercontent.com/u/18697332?v=4" width="42;" alt="Terry Young"/>
</a>
<a href="https://github.com/Xiwin" title="Xiwin">
<img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="Xiwin"/>
</a>
<a href="https://github.com/qinxiongzhou" title="Ryan Zhou">
<img src="https://avatars.githubusercontent.com/u/33239096?v=4" width="42;" alt="Ryan Zhou"/>
</a>
<a href="https://github.com/RivailleF" title="RivailleF">
<img src="https://avatars.githubusercontent.com/u/93083015?v=4" width="42;" alt="RivailleF"/>
</a>
<a href="https://github.com/QDelta" title="QDelta">
<img src="https://avatars.githubusercontent.com/u/60222316?v=4" width="42;" alt="QDelta"/>
</a>
<a href="https://github.com/sevenleave" title="Poirot Hercule">
<img src="https://avatars.githubusercontent.com/u/24411140?v=4" width="42;" alt="Poirot Hercule"/>
</a>
<a href="https://github.com/PipecraftNet" title="Pipecraft">
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
</a>
<a href="https://github.com/Perzch" title="Perzch">
<img src="https://avatars.githubusercontent.com/u/67987641?v=4" width="42;" alt="Perzch"/>
</a>
<a href="https://github.com/PILIHU2022" title="PILIHU2022">
<img src="https://avatars.githubusercontent.com/u/100511118?v=4" width="42;" alt="PILIHU2022"/>
</a>
<a href="https://github.com/HanaNoryu" title="Noryu">
<img src="https://avatars.githubusercontent.com/u/109856546?v=4" width="42;" alt="Noryu"/>
</a>
<a href="https://github.com/NianwenDan" title="NianwenDan">
<img src="https://avatars.githubusercontent.com/u/74407127?v=4" width="42;" alt="NianwenDan"/>
</a>
<a href="https://github.com/mo3et" title="Monet Lee">
<img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/>
</a><!--GAMFC-END-->
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调"><img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调"/></a>
<a href="https://github.com/fwqaaq" title="fwqaaq"><img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fwqaaq"/></a>
<a href="https://github.com/mofelee" title="mofelee"><img src="https://avatars.githubusercontent.com/u/5069410?v=4" width="42;" alt="mofelee"/></a>
<a href="https://github.com/Country-If" title="Maylon"><img src="https://avatars.githubusercontent.com/u/62837275?v=4" width="42;" alt="Maylon"/></a>
<a href="https://github.com/zhangymPerson" title="zhangym"><img src="https://avatars.githubusercontent.com/u/40376181?v=4" width="42;" alt="zhangym"/></a>
<a href="https://github.com/aixcyi" title="砹小翼"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"/></a>
<a href="https://github.com/nangongchengfeng" title="南宫乘风"><img src="https://avatars.githubusercontent.com/u/46562911?v=4" width="42;" alt="南宫乘风"/></a>
<a href="https://github.com/h7ml" title="h7ml"><img src="https://avatars.githubusercontent.com/u/55233292?v=4" width="42;" alt="h7ml"/></a>
<a href="https://github.com/LesterChang0987" title="Steve Hartwell"><img src="https://avatars.githubusercontent.com/u/114913921?v=4" width="42;" alt="Steve Hartwell"/></a>
<a href="https://github.com/JeffersonHuang" title="Jefferson Huang"><img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson Huang"/></a>
<a href="https://github.com/Alex20180512" title="Alex"><img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/></a>
<a href="https://github.com/LufsX" title="LufsX"><img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/></a>
<a href="https://github.com/mailbaoer" title="baoer"><img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/></a>
<a href="https://github.com/expoli" title="expoli"><img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/></a>
<a href="https://github.com/k23223" title="k23223"><img src="https://avatars.githubusercontent.com/u/57606136?v=4" width="42;" alt="k23223"/></a>
<a href="https://github.com/eryajf" title="二丫讲梵"><img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/></a>
<a href="https://github.com/undefined-hestudio" title="undefined"><img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"/></a>
<a href="https://github.com/Darkiiiiiice" title="Darkiiiiiice"><img src="https://avatars.githubusercontent.com/u/3959555?v=4" width="42;" alt="Darkiiiiiice"/></a>
<a href="https://github.com/genius-kim" title="Kim同学"><img src="https://avatars.githubusercontent.com/u/119488561?v=4" width="42;" alt="Kim同学"/></a>
<a href="https://github.com/qyl27" title="秋 雨落"><img src="https://avatars.githubusercontent.com/u/53731501?v=4" width="42;" alt="秋 雨落"/></a>
<a href="https://github.com/MackDing" title="Blossom"><img src="https://avatars.githubusercontent.com/u/19878893?v=4" width="42;" alt="Blossom"/></a>
<a href="https://github.com/1250422131" title="萌新杰少"><img src="https://avatars.githubusercontent.com/u/52126790?v=4" width="42;" alt="萌新杰少"/></a>
<a href="https://github.com/chaos-cn" title="chaos"><img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/></a>
<a href="https://github.com/xia0ne" title="YuRuiH"><img src="https://avatars.githubusercontent.com/u/32591223?v=4" width="42;" alt="YuRuiH"/></a>
<a href="https://github.com/Willxup" title="Willxup"><img src="https://avatars.githubusercontent.com/u/51990395?v=4" width="42;" alt="Willxup"/></a>
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu"><img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/></a>
<a href="https://github.com/lvelvee" title="Lve Lvee"><img src="https://avatars.githubusercontent.com/u/25785753?v=4" width="42;" alt="Lve Lvee"/></a>
<a href="https://github.com/wsypower" title="魏"><img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/></a>
<a href="https://github.com/itldg" title="老大哥"><img src="https://avatars.githubusercontent.com/u/13432299?v=4" width="42;" alt="老大哥"/></a>
<a href="https://github.com/catcto" title="小武Alan"><img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="小武Alan"/></a>
<a href="https://github.com/ryanhex53" title="ryanhex53"><img src="https://avatars.githubusercontent.com/u/360426?v=4" width="42;" alt="ryanhex53"/></a>
<a href="https://github.com/partoneplay" title="partoneplay"><img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/></a>
<a href="https://github.com/pangxiaoli" title="pangxiaoli"><img src="https://avatars.githubusercontent.com/u/54620953?v=4" width="42;" alt="pangxiaoli"/></a>
<a href="https://github.com/mancuoj" title="mancuoj"><img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/></a>
<a href="https://github.com/webeautiful" title="Albert"><img src="https://avatars.githubusercontent.com/u/3364316?v=4" width="42;" alt="Albert"/></a>
<a href="https://github.com/dadatom" title="Da Da"><img src="https://avatars.githubusercontent.com/u/33886943?v=4" width="42;" alt="Da Da"/></a>
<a href="https://github.com/ljq" title="Jack Liu"><img src="https://avatars.githubusercontent.com/u/7278286?v=4" width="42;" alt="Jack Liu"/></a>
<a href="https://github.com/jasnzhuang" title="Jason Zhuang"><img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/></a>
<a href="https://github.com/Jovins" title="Jovins"><img src="https://avatars.githubusercontent.com/u/17738992?v=4" width="42;" alt="Jovins"/></a>
<a href="https://github.com/long-910" title="Small Long"><img src="https://avatars.githubusercontent.com/u/7323488?v=4" width="42;" alt="Small Long"/></a>
<a href="https://github.com/SuperDiscovery" title="SuperDiscovery"><img src="https://avatars.githubusercontent.com/u/49646863?v=4" width="42;" alt="SuperDiscovery"/></a>
<a href="https://github.com/XYZscratcher" title="XYZ"><img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/></a>
<a href="https://github.com/findnr" title="findnr"><img src="https://avatars.githubusercontent.com/u/3909023?v=4" width="42;" alt="findnr"/></a>
<a href="https://github.com/greyhao" title="greyhao"><img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/></a>
<a href="https://github.com/1834423612" title="kjch"><img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/></a>
<a href="https://github.com/yanxuplay" title="hupilan"><img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/></a>
<a href="https://github.com/hweining" title="hweining"><img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/></a>
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
<a href="https://github.com/auroraslot" title="irony"><img src="https://avatars.githubusercontent.com/u/48817882?v=4" width="42;" alt="irony"/></a>
<a href="https://github.com/jlchen5" title="jlchen5"><img src="https://avatars.githubusercontent.com/u/61578993?v=4" width="42;" alt="jlchen5"/></a>
<a href="https://github.com/joyfully-W" title="joyfully-W"><img src="https://avatars.githubusercontent.com/u/32212924?v=4" width="42;" alt="joyfully-W"/></a>
<a href="https://github.com/jqzhao7" title="jqzhao"><img src="https://avatars.githubusercontent.com/u/54694535?v=4" width="42;" alt="jqzhao"/></a>
<a href="https://github.com/jussker" title="jussker"><img src="https://avatars.githubusercontent.com/u/33953356?v=4" width="42;" alt="jussker"/></a>
<a href="https://github.com/k983551019" title="k983551019"><img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/></a>
<a href="https://github.com/kdxcxs" title="kdxcxs"><img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/></a>
<a href="https://github.com/kubeme" title="kubernetes for me"><img src="https://avatars.githubusercontent.com/u/16346220?v=4" width="42;" alt="kubernetes for me"/></a>
<a href="https://github.com/larry-xue" title="larry"><img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/></a>
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
<a href="https://github.com/hua03" title="hua03"><img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/></a>
<a href="https://github.com/gzttcydxx" title="gzttcydxx"><img src="https://avatars.githubusercontent.com/u/50025185?v=4" width="42;" alt="gzttcydxx"/></a>
<a href="https://github.com/sunny0826" title="Xudong Guo"><img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/></a>
<a href="https://github.com/nodjoy" title="gowshwah"><img src="https://avatars.githubusercontent.com/u/145280043?v=4" width="42;" alt="gowshwah"/></a>
<a href="https://github.com/godotc" title="godot42"><img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godot42"/></a>
<a href="https://github.com/gi-b716" title="Gavin"><img src="https://avatars.githubusercontent.com/u/78394473?v=4" width="42;" alt="Gavin"/></a>
<a href="https://github.com/fjqz177" title="fjqz177"><img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/></a>
<a href="https://github.com/fakevn" title="fakevn"><img src="https://avatars.githubusercontent.com/u/11464386?v=4" width="42;" alt="fakevn"/></a>
<a href="https://github.com/cool9203" title="cool9203"><img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/></a>
<a href="https://github.com/gaoxiaoduan" title="CoderDuan"><img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="CoderDuan"/></a>
<a href="https://github.com/lijc210" title="cizai"><img src="https://avatars.githubusercontent.com/u/10651081?v=4" width="42;" alt="cizai"/></a>
<a href="https://github.com/chyok" title="chyok"><img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/></a>
<a href="https://github.com/zlfyuan" title="bgbgPang"><img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/></a>
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm"><img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/></a>
<a href="https://github.com/binscor" title="Zheng Nai Bin"><img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/></a>
<a href="https://github.com/qwxingzhe" title="行者"><img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/></a>
<a href="https://github.com/HanaChan233" title="花开花落"><img src="https://avatars.githubusercontent.com/u/75212820?v=4" width="42;" alt="花开花落"/></a>
<a href="https://github.com/lisheng741" title="芦荟柚子茶"><img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/></a>
<a href="https://github.com/wangdaodao" title="王叨叨"><img src="https://avatars.githubusercontent.com/u/2317442?v=4" width="42;" alt="王叨叨"/></a>
<a href="https://github.com/HChenX" title="焕晨HChen"><img src="https://avatars.githubusercontent.com/u/123531821?v=4" width="42;" alt="焕晨HChen"/></a>
<a href="https://github.com/LebranceBW" title="落叶乌龟"><img src="https://avatars.githubusercontent.com/u/19501514?v=4" width="42;" alt="落叶乌龟"/></a>
<a href="https://github.com/ZIDOUZI" title="子斗子"><img src="https://avatars.githubusercontent.com/u/53157536?v=4" width="42;" alt="子斗子"/></a>
<a href="https://github.com/LuckyJie12" title="夜未央"><img src="https://avatars.githubusercontent.com/u/102901105?v=4" width="42;" alt="夜未央"/></a>
<a href="https://github.com/lvzhenbo" title="吕振波"><img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/></a>
<a href="https://github.com/zxx457" title="zxx457"><img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx457"/></a>
<a href="https://github.com/zhouhw0306" title="zhouhw0306"><img src="https://avatars.githubusercontent.com/u/82752681?v=4" width="42;" alt="zhouhw0306"/></a>
<a href="https://github.com/hiyms" title="yms"><img src="https://avatars.githubusercontent.com/u/84654050?v=4" width="42;" alt="yms"/></a>
<a href="https://github.com/xing133" title="xing133"><img src="https://avatars.githubusercontent.com/u/5336490?v=4" width="42;" alt="xing133"/></a>
<a href="https://github.com/wjjwkwindy" title="Hudson Alen"><img src="https://avatars.githubusercontent.com/u/9508591?v=4" width="42;" alt="Hudson Alen"/></a>
<a href="https://github.com/wannima66" title="tmen"><img src="https://avatars.githubusercontent.com/u/26410255?v=4" width="42;" alt="tmen"/></a>
<a href="https://github.com/swift-fs" title="swift"><img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift"/></a>
<a href="https://github.com/suyangzuo" title="suyangzuo"><img src="https://avatars.githubusercontent.com/u/50766353?v=4" width="42;" alt="suyangzuo"/></a>
<a href="https://github.com/Mowmowj" title="nexo"><img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/></a>
<a href="https://github.com/phygerr" title="phygerr"><img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/></a>
<a href="https://github.com/onewesong" title="onewesong"><img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/></a>
<a href="https://github.com/miclon-dev" title="miclon-dev"><img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/></a>
<a href="https://github.com/lykjjj" title="lykjjj"><img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/></a>
<a href="https://github.com/lozhu20" title="lozhu"><img src="https://avatars.githubusercontent.com/u/44923922?v=4" width="42;" alt="lozhu"/></a>
<a href="https://github.com/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></a>
<a href="https://github.com/leauny" title="leauny"><img src="https://avatars.githubusercontent.com/u/42369176?v=4" width="42;" alt="leauny"/></a>
<a href="https://github.com/y52y" title="Zyj"><img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/></a>
<a href="https://github.com/isecret" title="Mao Wang"><img src="https://avatars.githubusercontent.com/u/15724152?v=4" width="42;" alt="Mao Wang"/></a>
<a href="https://github.com/likeshop-github" title="likeshop技术社区"><img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="likeshop技术社区"/></a>
<a href="https://github.com/Lihuagreek" title="Lihuagreek"><img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/></a>
<a href="https://github.com/LightQuanta" title="Light_Quanta"><img src="https://avatars.githubusercontent.com/u/18213217?v=4" width="42;" alt="Light_Quanta"/></a>
<a href="https://github.com/JetSquirrel" title="JetSquirrel"><img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/></a>
<a href="https://github.com/jeremyjone" title="Jeremy Jone"><img src="https://avatars.githubusercontent.com/u/37676231?v=4" width="42;" alt="Jeremy Jone"/></a>
<a href="https://github.com/JavaZeroo" title="JavaZero"><img src="https://avatars.githubusercontent.com/u/71128095?v=4" width="42;" alt="JavaZero"/></a>
<a href="https://github.com/Ding-Kyoma" title="HooinKyoma"><img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/></a>
<a href="https://github.com/gongyeheyu" title="GONGYE Heyu"><img src="https://avatars.githubusercontent.com/u/85177605?v=4" width="42;" alt="GONGYE Heyu"/></a>
<a href="https://github.com/Fuku-L" title="Foozi"><img src="https://avatars.githubusercontent.com/u/38535911?v=4" width="42;" alt="Foozi"/></a>
<a href="https://github.com/sirius-fan" title="Fan"><img src="https://avatars.githubusercontent.com/u/25720015?v=4" width="42;" alt="Fan"/></a>
<a href="https://github.com/eeeeeio" title="EEEEE"><img src="https://avatars.githubusercontent.com/u/20723545?v=4" width="42;" alt="EEEEE"/></a>
<a href="https://github.com/demigodliu" title="DemigodLiu"><img src="https://avatars.githubusercontent.com/u/30372735?v=4" width="42;" alt="DemigodLiu"/></a>
<a href="https://github.com/dasferco" title="Dasferco"><img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/></a>
<a href="https://github.com/Damao2250" title="Damao"><img src="https://avatars.githubusercontent.com/u/19251992?v=4" width="42;" alt="Damao"/></a>
<a href="https://github.com/DEEMO101" title="DEEMO101"><img src="https://avatars.githubusercontent.com/u/35123091?v=4" width="42;" alt="DEEMO101"/></a>
<a href="https://github.com/ohto-ai" title="Choo"><img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/></a>
<a href="https://github.com/CharlotteZeng" title="hanchZ"><img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/></a>
<a href="https://github.com/ch3nnn" title="chentong"><img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="chentong"/></a>
<a href="https://github.com/Brid9e" title="Joe"><img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Joe"/></a>
<a href="https://github.com/BobH-Official" title="BobH"><img src="https://avatars.githubusercontent.com/u/29333228?v=4" width="42;" alt="BobH"/></a>
<a href="https://github.com/Blanket58" title="Blanket58"><img src="https://avatars.githubusercontent.com/u/39766189?v=4" width="42;" alt="Blanket58"/></a>
<a href="https://github.com/BlacAmDK" title="BlacAmDK"><img src="https://avatars.githubusercontent.com/u/10971397?v=4" width="42;" alt="BlacAmDK"/></a>
<a href="https://github.com/gitchenze" title="Aze"><img src="https://avatars.githubusercontent.com/u/13357869?v=4" width="42;" alt="Aze"/></a>
<a href="https://github.com/dousha0w0" title="dousha0w0"><img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/></a>
<a href="https://github.com/13812700839" title="花殇"><img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/></a>
<a href="https://github.com/Leaderzhangyi" title="ZinkCas"><img src="https://avatars.githubusercontent.com/u/46915666?v=4" width="42;" alt="ZinkCas"/></a>
<a href="https://github.com/zhu0629" title="zhucong"><img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="zhucong"/></a>
<a href="https://github.com/yikuaibro" title="yikuaibro"><img src="https://avatars.githubusercontent.com/u/44493045?v=4" width="42;" alt="yikuaibro"/></a>
<a href="https://github.com/dfshizhiqiang" title="Zech"><img src="https://avatars.githubusercontent.com/u/7030019?v=4" width="42;" alt="Zech"/></a>
<a href="https://github.com/Yo-gurts" title="Yogurt"><img src="https://avatars.githubusercontent.com/u/44612841?v=4" width="42;" alt="Yogurt"/></a>
<a href="https://github.com/hi-liyan" title="李李李"><img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="李李李"/></a>
<a href="https://github.com/BATTLEHAWK00" title="While True: learn()"><img src="https://avatars.githubusercontent.com/u/45313304?v=4" width="42;" alt="While True: learn()"/></a>
<a href="https://github.com/dwgeneral" title="Happy-Engineer"><img src="https://avatars.githubusercontent.com/u/8654993?v=4" width="42;" alt="Happy-Engineer"/></a>
<a href="https://github.com/whb1998a" title="Wafer"><img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="Wafer"/></a>
<a href="https://github.com/YLee9527" title="Terry Young"><img src="https://avatars.githubusercontent.com/u/18697332?v=4" width="42;" alt="Terry Young"/></a>
<a href="https://github.com/TRDSCSH" title="TRDSCSH"><img src="https://avatars.githubusercontent.com/u/125717891?v=4" width="42;" alt="TRDSCSH"/></a>
<a href="https://github.com/Xiwin" title="Xiwin"><img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="Xiwin"/></a>
<a href="https://github.com/DataEraserC" title="Sacabambaspis"><img src="https://avatars.githubusercontent.com/u/102341238?v=4" width="42;" alt="Sacabambaspis"/></a>
<a href="https://github.com/qinxiongzhou" title="Ryan Zhou"><img src="https://avatars.githubusercontent.com/u/33239096?v=4" width="42;" alt="Ryan Zhou"/></a>
<a href="https://github.com/RivailleF" title="RivailleF"><img src="https://avatars.githubusercontent.com/u/93083015?v=4" width="42;" alt="RivailleF"/></a>
<a href="https://github.com/QDelta" title="QDelta"><img src="https://avatars.githubusercontent.com/u/60222316?v=4" width="42;" alt="QDelta"/></a>
<a href="https://github.com/sevenleave" title="Poirot Hercule"><img src="https://avatars.githubusercontent.com/u/24411140?v=4" width="42;" alt="Poirot Hercule"/></a>
<a href="https://github.com/PipecraftNet" title="Pipecraft"><img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/></a>
<a href="https://github.com/Perzch" title="Perzch"><img src="https://avatars.githubusercontent.com/u/67987641?v=4" width="42;" alt="Perzch"/></a>
<a href="https://github.com/PILIHU2022" title="PILIHU2022"><img src="https://avatars.githubusercontent.com/u/100511118?v=4" width="42;" alt="PILIHU2022"/></a>
<a href="https://github.com/HanaNoryu" title="Noryu"><img src="https://avatars.githubusercontent.com/u/109856546?v=4" width="42;" alt="Noryu"/></a>
<a href="https://github.com/NianwenDan" title="NianwenDan"><img src="https://avatars.githubusercontent.com/u/74407127?v=4" width="42;" alt="NianwenDan"/></a>
<a href="https://github.com/mo3et" title="Monet Lee"><img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/></a>
<a href="https://github.com/Moeyuuko" title="Moeyuuko"><img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/></a>
<a href="https://github.com/malcolmyu" title="Minghao Yu"><img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/></a>
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a><!--GAMFC-END-->
上图贡献者列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 自动生成贡献者图片。

626
README.md
View File

@@ -38,23 +38,31 @@ Quick Reference
[Vue 3](./docs/vue.md)<!--rehype:style=background: rgb(64 184 131);&class=contributing-->
[Github Copilot](./docs/github-copilot.md)<!--rehype:style=background: rgb(125 45 220);&class=tag contributing&data-lang=AI&data-info=👆看看还缺点儿什么?-->
[Chown](./docs/chown.md)<!--rehype:style=background: rgb(12 75 51/var(\-\-bg\-opacity));&class=contributing-->
[R 语言](./docs/r.md)<!--rehype:style=background: rgb(39 108 192);&class=contributing-->
[Elixir](./docs/elixir.md)<!--rehype:style=background: rgb(124 26 156);&class=contributing tag&data-lang=Elixir-->
[Tauri](./docs/tauri.md)<!--rehype:style=background: rgb(103 214 237);&class=contributing-->
[Docker Compose](./docs/docker-compose.md)<!--rehype:style=background: rgb(72 143 223);&class=contributing tag&data-lang=Docker-->
<!--rehype:class=home-card-->
## 编程
[Bash](./docs/bash.md)<!--rehype:style=background: rgb(72 143 223);-->
[C](./docs/c.md)<!--rehype:style=background: rgb(92 107 192);-->
[C 语言](./docs/c.md)<!--rehype:style=background: rgb(92 107 192);-->
[C#](./docs/cs.md)<!--rehype:style=background: rgb(6 147 13);&class=contributing-->
[C++](./docs/cpp.md)<!--rehype:style=background: rgb(6 147 13);&class=contributing-->
[Dart](./docs/dart.md)<!--rehype:style=background: rgb(64 196 255);-->
[Docker](./docs/docker.md)<!--rehype:style=background: rgb(72 143 223);-->
[Docker-Compose](./docs/docker-compose.md)<!--rehype:style=background: rgb(72 143 223);&class=contributing tag&data-lang=Docker-->
[Dockerfile](./docs/dockerfile.md)<!--rehype:style=background: rgb(0 72 153);&class=tag&data-lang=Docker-->
[Django](./docs/django.md)<!--rehype:style=background: rgb(12 75 51);&class=contributing tag&data-lang=Python-->
[Elixir](./docs/elixir.md)<!--rehype:style=background: rgb(124 26 156);&class=contributing tag&data-lang=Elixir-->
[Erlang](./docs/erlang.md)<!--rehype:style=background: rgb(206 55 97);&class=contributing-->
[Flask](./docs/flask.md)<!--rehype:style=background: rgb(210 168 255);&class=contributing tag&data-lang=Python-->
[FastAPI](./docs/fastapi.md)<!--rehype:style=background: rgb(210 168 255);&class=contributing tag&data-lang=Python-->
[Flutter](./docs/flutter.md)<!--rehype:style=background: rgb(150 220 254);&class=contributing tag&data-lang=Dart-->
[Golang](./docs/golang.md)<!--rehype:style=background: rgb(39 160 193);-->
[GraphQL](./docs/graphql.md)<!--rehype:style=background: rgb(214 66 146);-->
[Hook](./docs/hook.md)<!--rehype:style=background: rgb(211 55 49);-->
[Java](./docs/java.md)<!--rehype:style=background: rgb(211 55 49);&class=contributing&data-info=👆看看还缺点儿什么?-->
[Julia](./docs/julia.md)<!--rehype:style=background: rgb(26 188 156);&class=contributing&data-info=👆看看还缺点儿什么?-->
[Kotlin](./docs/kotlin.md)<!--rehype:style=background: rgb(211 55 49);&class=contributing&data-info=👆看看还缺点儿什么?-->
@@ -65,11 +73,13 @@ Quick Reference
[MATLAB](./docs/matlab.md)<!--rehype:style=background: rgb(0 118 168);&class=contributing-->
[PHP](./docs/php.md)<!--rehype:style=background: rgb(79 91 147);-->
[Python](./docs/python.md)<!--rehype:style=background: rgb(43 91 132);-->
[R 语言](./docs/r.md)<!--rehype:style=background: rgb(39 108 192);&class=contributing&data-info-->
[Ruby](./docs/ruby.md)<!--rehype:style=background: rgb(204 52 45);-->
[Rust](./docs/rust.md)<!--rehype:style=background: rgb(71 71 71);-->
[Scala](./docs/scala.md)<!--rehype:style=background: rgb(34 82 94);-->
[Swift](./docs/swift.md)<!--rehype:style=background: rgb(240 81 57);-->
[SwiftUI](./docs/swiftui.md)<!--rehype:style=background: rgb(10 127 247);&class=tag&data-lang=swift-->
[Spring Boot](./docs/springboot.md)<!--rehype:style=background: rgb(0 149 0);&class=tag&data-lang=Java-->
[Lua](./docs/lua.md)<!--rehype:style=background: rgb(3 3 128);-->
[Pytorch](./docs/pytorch.md)<!--rehype:style=background: rgb(238 76 44);&class=contributing tag&data-lang=Python&data-info=👆看看还缺点儿什么?-->
<!--rehype:class=home-card-->
@@ -92,14 +102,17 @@ Quick Reference
[JavaScript](./docs/javascript.md)<!--rehype:style=background: rgb(203 183 31);-->
[jQuery](./docs/jquery.md)<!--rehype:style=background: rgb(203 183 31);-->
[Next.js](./docs/nextjs.md)<!--rehype:style=background: rgb(0 0 0);&class=tag&data-lang=React-->
[RxJS](./docs/rxjs.md)<!--rehype:style=background: rgb(151 0 81);-->
[React](./docs/react.md)<!--rehype:style=background: rgb(34 143 173);-->
[React Router](./docs/reactrouter.md)<!--rehype:style=background: rgb(244 66 79);&class=tag&data-lang=React-->
[React Native](./docs/react-native.md)<!--rehype:style=background: rgb(34 143 173);&class=tag&data-lang=React-->
[RegEx 正则表达式](./docs/regex.md)<!--rehype:style=background: rgb(149 36 155);-->
[TypeScript](./docs/typescript.md)<!--rehype:style=background: rgb(49 120 198);-->
[Vue 2](./docs/vue2.md)<!--rehype:style=background: rgb(64 184 131);-->
[Vue 3](./docs/vue.md)<!--rehype:style=background: rgb(64 184 131);&class=contributing-->
[Tauri](./docs/tauri.md)<!--rehype:style=background: rgb(103 214 237);&class=contributing-->
[Vue 2](./docs/vue2.md)<!--rehype:style=background: rgb(64 184 131);&class=tag&data-lang=Vue-->
[Vue 3](./docs/vue.md)<!--rehype:style=background: rgb(64 184 131);&class=tag&class=contributing tag&data-lang=Vue-->
[</> htmx](./docs/htmx.md)<!--rehype:style=background: rgb(52 101 164);&class=contributing-->
[Pinia](./docs/pinia.md)<!--rehype:style=background: rgb(44 136 50);&class=tag&data-lang=Vue-->
<!--rehype:class=home-card-->
## CSS
@@ -109,7 +122,8 @@ Quick Reference
[Stylus](./docs/stylus.md)<!--rehype:style=background: rgb(109 161 63);&class=tag&data-lang=CSS-->
[Sass](./docs/sass.md)<!--rehype:style=background: rgb(207 100 154);&class=tag&data-lang=CSS-->
[Less.js](./docs/lessjs.md)<!--rehype:style=background: rgb(29 54 93);&class=tag&data-lang=CSS-->
[Tailwind CSS](./docs/tailwindcss.md)<!--rehype:style=background: rgb(49 120 198);-->
[Tailwind CSS](./docs/tailwindcss.md)<!--rehype:style=background: rgb(49 120 198);&class=tag&data-lang=CSS-->
[StyleX](./docs/stylex.md)<!--rehype:style=background: rgb(91 79 163);&class=tag&data-lang=CSS-->
<!--rehype:class=home-card-->
## Nodejs
@@ -124,6 +138,9 @@ Quick Reference
[PM2](./docs/pm2.md)<!--rehype:style=background: rgb(73 117 241);&class=contributing-->
[package.json](./docs/package.json.md)<!--rehype:style=background: rgb(132 132 132);-->
[Yarn](./docs/yarn.md)<!--rehype:style=background: rgb(33 136 182);-->
[nvm](./docs/nvm.md)<!--rehype:style=background: rgb(132 132 132);-->
[pnpm](./docs/pnpm.md)<!--rehype:style=background: rgb(191 133 0);-->
[Bun](./docs/bun.md)<!--rehype:style=background: rgb(157 49 81);-->
<!--rehype:class=home-card-->
## 工具
@@ -141,47 +158,55 @@ Quick Reference
[ADB, Android Debug Bridge](./docs/adb.md)<!--rehype:style=background: rgb(238 0 0);&class=contributing tag&data-lang=Android&data-info=👆看看还缺点儿什么?-->
[Ansible](./docs/ansible.md)<!--rehype:style=background: rgb(238 0 0);&class=contributing tag&data-lang=RedHat&data-info=👆看看还缺点儿什么?-->
[Awk](./docs/awk.md)<!--rehype:style=background: rgb(16 185 129);-->
[Conan](./docs/conan.md)<!--rehype:style=background: rgb(0 193 9);&class=tag&data-lang=C/C++-->
[Conda](./docs/conda.md)<!--rehype:style=background: rgb(68 168 51);&class=tag&data-lang=Python-->
[CocoaPods](./docs/cocoapods.md)<!--rehype:style=background: rgb(251 0 6);&class=tag&data-lang=C/C++-->
[Cargo](./docs/cargo.md)<!--rehype:style=background: rgb(71 71 71);&class=tag&data-lang=Rust-->
[Curl](./docs/curl.md)<!--rehype:style=background: rgb(16 185 129);-->
[Chmod](./docs/chmod.md)<!--rehype:style=background: rgb(16 185 129);-->
[Chown](./docs/chown.md)<!--rehype:style=background: rgb(12 75 51/var(\-\-bg\-opacity));&class=contributing-->
[Cron](./docs/cron.md)<!--rehype:style=background: rgb(239 68 68);-->
[CMake](./docs/cmake.md)<!--rehype:style=background: rgb(92 107 192);&class=contributing-->
[Make](./docs/make.md)<!--rehype:style=background: rgb(99 99 99);&class=contributing-->
[Gdb](./docs/gdb.md)<!--rehype:style=background: rgb(215 89 62);-->
[Git](./docs/git.md)<!--rehype:style=background: rgb(215 89 62);-->
[Grep](./docs/grep.md)<!--rehype:style=background: rgb(16 185 129);-->
[CMD](./docs/cmd.md)<!--rehype:style=background: rgb(99 99 99);-->
[Find](./docs/find.md)<!--rehype:style=background: rgb(16 185 129);-->
[FFmpeg](./docs/ffmpeg.md)<!--rehype:style=background: rgb(0 193 9);&class=contributing-->
[Gdb](./docs/gdb.md)<!--rehype:style=background: rgb(215 89 62);-->
[Git](./docs/git.md)<!--rehype:style=background: rgb(215 89 62);&class=tag&data-lang=版本控制-->
[Glances](./docs/glances.md)<!--rehype:style=background: rgb(16 185 129);-->
[Grep](./docs/grep.md)<!--rehype:style=background: rgb(16 185 129);-->
[Htop](./docs/htop.md)<!--rehype:style=background: rgb(16 185 129);-->
[Homebrew](./docs/homebrew.md)<!--rehype:style=background: rgb(252 185 87);&class=tag&data-lang=macOS-->
[Netstat](./docs/netstat.md)<!--rehype:style=background: rgb(16 185 129);-->
[iptables](./docs/iptables.md)<!--rehype:style=background: rgb(32 74 135);-->
[jq](./docs/jq.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=JSON-->
[Justfile](./docs/justfile.md)<!--rehype:style=background: rgb(16 185 129);-->
[Lsof](./docs/lsof.md)<!--rehype:style=background: rgb(16 185 129);-->
[Mitmproxy](./docs/mitmproxy.md)<!--rehype:style=background: rgb(4 92 135);-->
[Make](./docs/make.md)<!--rehype:style=background: rgb(99 99 99);&class=contributing-->
[Netstat](./docs/netstat.md)<!--rehype:style=background: rgb(16 185 129);-->
[Netcat](./docs/netcat.md)<!--rehype:style=background: rgb(4 92 135);-->
[OpenSSL](./docs/openssl.md)<!--rehype:style=background: rgb(114 20 18);-->
[ps](./docs/ps.md)<!--rehype:style=background: rgb(99 99 99);-->
[Pandoc](./docs/pandoc.md)<!--rehype:style=background: rgb(99 99 99);&class=tag&data-lang=文档转换器-->
[Sed](./docs/sed.md)<!--rehype:style=background: rgb(16 185 129);-->
[Systemd](./docs/systemd.md)<!--rehype:style=background: rgb(16 185 129);-->
[SSH](./docs/ssh.md)<!--rehype:style=background: rgb(99 99 99);-->
[Subversion (SVN)](./docs/subversion.md)<!--rehype:style=background: rgb(99 99 99);-->
[Subversion (SVN)](./docs/subversion.md)<!--rehype:style=background: rgb(99 99 99);&class=tag&data-lang=版本控制-->
[Screen](./docs/screen.md)<!--rehype:style=background: rgb(99 99 99);-->
[Sysdig](./docs/sysdig.md)<!--rehype:style=background: rgb(1 171 199);-->
[Tmux](./docs/tmux.md)<!--rehype:style=background: rgb(99 99 99);-->
[Taskset](./docs/taskset.md)<!--rehype:style=background: rgb(99 99 99);-->
[YUM](./docs/yum.md)<!--rehype:style=background: rgb(86 86 123);-->
[CMD](./docs/cmd.md)<!--rehype:style=background: rgb(99 99 99);-->
[Zip](./docs/zip.md)<!--rehype:style=background: rgb(99 99 99);-->
[tar](./docs/tar.md)<!--rehype:style=background: rgb(215 89 62);&class=tag&data-lang=解压缩-->
[Zip](./docs/zip.md)<!--rehype:style=background: rgb(99 99 99);&class=tag&data-lang=解压缩-->
[FTP](./docs/ftp.md)<!--rehype:style=background: rgb(99 99 99);-->
<!--rehype:class=home-card-->
## 工具箱
[APT](./docs/apt.md)<!--rehype:style=background: rgb(30 144 255);-->
[tar](./docs/tar.md)<!--rehype:style=background: rgb(215 89 62);-->
[pacman](./docs/pacman.md)<!--rehype:style=background: rgb(24 147 209);&class=tag&data-lang=archlinux&class=contributing-->
[Conan](./docs/conan.md)<!--rehype:style=background: rgb(0 193 9);&class=tag&data-lang=C/C++-->
[Conda](./docs/conda.md)<!--rehype:style=background: rgb(68 168 51);&class=tag&data-lang=Python-->
[CocoaPods](./docs/cocoapods.md)<!--rehype:style=background: rgb(251 0 6);&class=tag&data-lang=C/C++-->
[Cargo](./docs/cargo.md)<!--rehype:style=background: rgb(71 71 71);&class=tag&data-lang=Rust-->
[Homebrew](./docs/homebrew.md)<!--rehype:style=background: rgb(252 185 87);&class=tag&data-lang=macOS-->
[Linux Command](./docs/linux-command.md)<!--rehype:style=background: rgb(215 89 62);&class=tag&data-lang=命令速查-->
[Mitmproxy](./docs/mitmproxy.md)<!--rehype:style=background: rgb(4 92 135);-->
[Pacman](./docs/pacman.md)<!--rehype:style=background: rgb(24 147 209);&class=tag&data-lang=archlinux&class=contributing-->
[YUM](./docs/yum.md)<!--rehype:style=background: rgb(86 86 123);-->
[SDKMAN](./docs/sdkman.md)<!--rehype:style=background: rgb(0 118 198);-->
<!--rehype:class=home-card-->
## 数据库
@@ -191,6 +216,8 @@ Quick Reference
[Oracle](./docs/oracle.md)<!--rehype:style=background: rgb(255 0 0);&class=tag&data-lang=SQL-->
[PostgreSQL](./docs/postgres.md)<!--rehype:style=background: rgb(43 109 163);&class=tag&data-lang=SQL-->
[Redis](./docs/redis.md)<!--rehype:style=background: rgb(198 47 44);-->
[Elasticsearch](./docs/elasticsearch.md)<!--rehype:style=background: rgb(36 187 177);-->
[Neo4j](./docs/neo4j.md)<!--rehype:style=background: rgb(86 86 123);-->
<!--rehype:class=home-card-->
## 快捷键
@@ -201,14 +228,19 @@ Quick Reference
[Android Studio](./docs/android-studio.md)<!--rehype:style=background: rgb(16 185 129);-->
[Blender](./docs/blender.md)<!--rehype:style=background: rgb(16 185 129);-->
[Firefox](./docs/firefox.md)<!--rehype:style=background: rgb(253 53 76);-->
[Finder](./docs/finder.md)<!--rehype:style=background: rgb(253 53 76);&class=tag&data-lang=macOS-->
[Figma](./docs/figma.md)<!--rehype:style=background: rgb(147 90 238);-->
[Gmail](./docs/gmail.md)<!--rehype:style=background: rgb(234 67 54);-->
[Gitlab](./docs/gitlab.md)<!--rehype:style=background: rgb(226 67 41);-->
[Google Chrome](./docs/google-chrome.md)<!--rehype:style=background: rgb(29 116 232);-->
[IntelliJ IDEA](./docs/intelli-j-idea.md)<!--rehype:style=background: rgb(223 148 0);&class=tag&data-lang=Java-->
[PyCharm](./docs/pycharm.md)<!--rehype:style=background: rgb(36 215 137);&class=tag&data-lang=Python-->
[PhpStorm](./docs/phpstorm.md)<!--rehype:style=\-\-bg\-opacity: 0.75;background-image: linear-gradient(to left, rgba(255 106 172 / var(\-\-bg\-opacity)), rgba(183 173 255 / var(\-\-bg\-opacity)));-->
[Sketch](./docs/sketch.md)<!--rehype:style=background: rgb(223 148 0);&class=tag&data-lang=macOS-->
[Sublime Text](./docs/sublime-text.md)<!--rehype:style=background: rgb(223 148 0);-->
[Vimium](./docs/vimium.md)<!--rehype:style=background: rgb(49 168 255);&class=contributing&class=tag&data-lang=浏览器插件-->
[VSCode](./docs/vscode.md)<!--rehype:style=background: rgb(91 163 230);-->
[Twitter(X)](./docs/twitter.md)<!--rehype:style=background: rgb(91 163 230);-->
[WebStorm](./docs/webstorm.md)<!--rehype:style=background: rgb(32 148 220);-->
[Xcode](./docs/xcode.md)<!--rehype:style=background: rgb(24 151 233);&class=tag&data-lang=macOS-->
<!--rehype:class=home-card-->
@@ -224,10 +256,12 @@ Quick Reference
[Colors Named](./docs/colors-named.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=CSS-->
[HTTP 状态码](./docs/http-status-code.md)<!--rehype:style=background: rgb(16 185 129);-->
[HTML 字符实体](./docs/html-char.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=HTML-->
[ISO 639-1 Language Code](./docs/iso-639-1.md)<!--rehype:style=background: rgb(16 185 129);-->
[ISO-3166 国家代码](./docs/iso-3166-1.md)<!--rehype:style=background: rgb(16 185 129);-->
[ISO-639 语言代码](./docs/iso-639-1.md)<!--rehype:style=background: rgb(16 185 129);-->
[Emoji](./docs/emoji.md)<!--rehype:style=\-\-bg\-opacity: 0.75;background-image: linear-gradient(to left, rgba(74 222 128 / var(\-\-bg\-opacity)), rgba(59 130 246 / var(\-\-bg\-opacity)));-->
[MIME types](./docs/mime.md)<!--rehype:style=background: rgb(16 185 129);-->
[Resolutions](./docs/resolutions.md)<!--rehype:style=background: rgb(16 185 129);-->
[ChatGPT](./docs/chatgpt.md)<!--rehype:style=background: rgb(74, 161, 129);&class=tag&data-lang=ai-->
<!--rehype:class=home-card-->
## 看到缺少什么了吗?
@@ -245,369 +279,157 @@ Quick Reference
请参阅 [Quick Reference](./docs/quickreference.md) 了解如何开始。一如既往,感谢我们出色的[贡献者](https://github.com/jaywcjlove/reference/graphs/contributors)
<!--rehype:style=padding-bottom:1rem;-->
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调">
<img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调"/>
</a>
<a href="https://github.com/fwqaaq" title="fwqaaq">
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fwqaaq"/>
</a>
<a href="https://github.com/mofelee" title="mofelee">
<img src="https://avatars.githubusercontent.com/u/5069410?v=4" width="42;" alt="mofelee"/>
</a>
<a href="https://github.com/Country-If" title="Maylon">
<img src="https://avatars.githubusercontent.com/u/62837275?v=4" width="42;" alt="Maylon"/>
</a>
<a href="https://github.com/JeffersonHuang" title="Jefferson Huang">
<img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson Huang"/>
</a>
<a href="https://github.com/aixcyi" title="砹小翼">
<img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"/>
</a>
<a href="https://github.com/Alex20180512" title="Alex">
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
</a>
<a href="https://github.com/undefined-hestudio" title="undefined">
<img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"/>
</a>
<a href="https://github.com/eryajf" title="二丫讲梵">
<img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/>
</a>
<a href="https://github.com/k23223" title="k23223">
<img src="https://avatars.githubusercontent.com/u/57606136?v=4" width="42;" alt="k23223"/>
</a>
<a href="https://github.com/expoli" title="expoli">
<img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/>
</a>
<a href="https://github.com/mailbaoer" title="baoer">
<img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/>
</a>
<a href="https://github.com/LufsX" title="LufsX">
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
</a>
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu">
<img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/>
</a>
<a href="https://github.com/chaos-cn" title="chaos">
<img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/>
</a>
<a href="https://github.com/1250422131" title="萌新杰少">
<img src="https://avatars.githubusercontent.com/u/52126790?v=4" width="42;" alt="萌新杰少"/>
</a>
<a href="https://github.com/MackDing" title="Blossom">
<img src="https://avatars.githubusercontent.com/u/19878893?v=4" width="42;" alt="Blossom"/>
</a>
<a href="https://github.com/Darkiiiiiice" title="Darkiiiiiice">
<img src="https://avatars.githubusercontent.com/u/3959555?v=4" width="42;" alt="Darkiiiiiice"/>
</a>
<a href="https://github.com/qyl27" title="秋 雨落">
<img src="https://avatars.githubusercontent.com/u/53731501?v=4" width="42;" alt="秋 雨落"/>
</a>
<a href="https://github.com/lvelvee" title="Lve Lvee">
<img src="https://avatars.githubusercontent.com/u/25785753?v=4" width="42;" alt="Lve Lvee"/>
</a>
<a href="https://github.com/wsypower" title="魏">
<img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/>
</a>
<a href="https://github.com/itldg" title="老大哥">
<img src="https://avatars.githubusercontent.com/u/13432299?v=4" width="42;" alt="老大哥"/>
</a>
<a href="https://github.com/catcto" title="小武Alan">
<img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="小武Alan"/>
</a>
<a href="https://github.com/ryanhex53" title="ryanhex53">
<img src="https://avatars.githubusercontent.com/u/360426?v=4" width="42;" alt="ryanhex53"/>
</a>
<a href="https://github.com/partoneplay" title="partoneplay">
<img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/>
</a>
<a href="https://github.com/pangxiaoli" title="pangxiaoli">
<img src="https://avatars.githubusercontent.com/u/54620953?v=4" width="42;" alt="pangxiaoli"/>
</a>
<a href="https://github.com/mancuoj" title="mancuoj">
<img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/>
</a>
<a href="https://github.com/1834423612" title="kjch">
<img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/>
</a>
<a href="https://github.com/greyhao" title="greyhao">
<img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/>
</a>
<a href="https://github.com/XYZscratcher" title="XYZ">
<img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/>
</a>
<a href="https://github.com/ljq" title="Jack Liu">
<img src="https://avatars.githubusercontent.com/u/7278286?v=4" width="42;" alt="Jack Liu"/>
</a>
<a href="https://github.com/dadatom" title="Da Da">
<img src="https://avatars.githubusercontent.com/u/33886943?v=4" width="42;" alt="Da Da"/>
</a>
<a href="https://github.com/webeautiful" title="Albert">
<img src="https://avatars.githubusercontent.com/u/3364316?v=4" width="42;" alt="Albert"/>
</a>
<a href="https://github.com/yanxuplay" title="hupilan">
<img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/>
</a>
<a href="https://github.com/hweining" title="hweining">
<img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/>
</a>
<a href="https://github.com/infanx" title="infanx">
<img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/>
</a>
<a href="https://github.com/auroraslot" title="Tang Weize">
<img src="https://avatars.githubusercontent.com/u/48817882?v=4" width="42;" alt="Tang Weize"/>
</a>
<a href="https://github.com/joyfully-W" title="joyfully-W">
<img src="https://avatars.githubusercontent.com/u/32212924?v=4" width="42;" alt="joyfully-W"/>
</a>
<a href="https://github.com/jussker" title="jussker">
<img src="https://avatars.githubusercontent.com/u/33953356?v=4" width="42;" alt="jussker"/>
</a>
<a href="https://github.com/k983551019" title="k983551019">
<img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/>
</a>
<a href="https://github.com/kdxcxs" title="kdxcxs">
<img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/>
</a>
<a href="https://github.com/genius-kim" title="Kim同学">
<img src="https://avatars.githubusercontent.com/u/119488561?v=4" width="42;" alt="Kim同学"/>
</a>
<a href="https://github.com/kubeme" title="kubernetes for me">
<img src="https://avatars.githubusercontent.com/u/16346220?v=4" width="42;" alt="kubernetes for me"/>
</a>
<a href="https://github.com/larry-xue" title="larry">
<img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/>
</a>
<a href="https://github.com/hua03" title="hua03">
<img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/>
</a>
<a href="https://github.com/gzttcydxx" title="gzttcydxx">
<img src="https://avatars.githubusercontent.com/u/50025185?v=4" width="42;" alt="gzttcydxx"/>
</a>
<a href="https://github.com/sunny0826" title="Xudong Guo">
<img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/>
</a>
<a href="https://github.com/godotc" title="godot42">
<img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godot42"/>
</a>
<a href="https://github.com/gi-b716" title="gi-b716">
<img src="https://avatars.githubusercontent.com/u/78394473?v=4" width="42;" alt="gi-b716"/>
</a>
<a href="https://github.com/fjqz177" title="fjqz177">
<img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/>
</a>
<a href="https://github.com/fakevn" title="fakevn">
<img src="https://avatars.githubusercontent.com/u/11464386?v=4" width="42;" alt="fakevn"/>
</a>
<a href="https://github.com/cool9203" title="cool9203">
<img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/>
</a>
<a href="https://github.com/gaoxiaoduan" title="CoderDuan">
<img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="CoderDuan"/>
</a>
<a href="https://github.com/chyok" title="chyok">
<img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/>
</a>
<a href="https://github.com/zlfyuan" title="bgbgPang">
<img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/>
</a>
<a href="https://github.com/Zeng-qh" title="都一样">
<img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/>
</a>
<a href="https://github.com/binscor" title="Zheng Nai Bin">
<img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/>
</a>
<a href="https://github.com/qwxingzhe" title="行者">
<img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/>
</a>
<a href="https://github.com/HuaChan233" title="花开花落">
<img src="https://avatars.githubusercontent.com/u/75212820?v=4" width="42;" alt="花开花落"/>
</a>
<a href="https://github.com/lisheng741" title="芦荟柚子茶">
<img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/>
</a>
<a href="https://github.com/ZIDOUZI" title="ZIDOUZI">
<img src="https://avatars.githubusercontent.com/u/53157536?v=4" width="42;" alt="ZIDOUZI"/>
</a>
<a href="https://github.com/LuckyJie12" title="夜未央">
<img src="https://avatars.githubusercontent.com/u/102901105?v=4" width="42;" alt="夜未央"/>
</a>
<a href="https://github.com/lvzhenbo" title="吕振波">
<img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/>
</a>
<a href="https://github.com/zxx457" title="zxx457">
<img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx457"/>
</a>
<a href="https://github.com/zhouhw0306" title="zhouhw0306">
<img src="https://avatars.githubusercontent.com/u/82752681?v=4" width="42;" alt="zhouhw0306"/>
</a>
<a href="https://github.com/hiyms" title="yms">
<img src="https://avatars.githubusercontent.com/u/84654050?v=4" width="42;" alt="yms"/>
</a>
<a href="https://github.com/xing133" title="xing133">
<img src="https://avatars.githubusercontent.com/u/5336490?v=4" width="42;" alt="xing133"/>
</a>
<a href="https://github.com/wjjwkwindy" title="Hudson Alen">
<img src="https://avatars.githubusercontent.com/u/9508591?v=4" width="42;" alt="Hudson Alen"/>
</a>
<a href="https://github.com/wannima66" title="tmen">
<img src="https://avatars.githubusercontent.com/u/26410255?v=4" width="42;" alt="tmen"/>
</a>
<a href="https://github.com/swift-fs" title="swift">
<img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift"/>
</a>
<a href="https://github.com/suyangzuo" title="suyangzuo">
<img src="https://avatars.githubusercontent.com/u/50766353?v=4" width="42;" alt="suyangzuo"/>
</a>
<a href="https://github.com/Mowmowj" title="nexo">
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/>
</a>
<a href="https://github.com/phygerr" title="phygerr">
<img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/>
</a>
<a href="https://github.com/onewesong" title="onewesong">
<img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/>
</a>
<a href="https://github.com/miclon-dev" title="miclon-dev">
<img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/>
</a>
<a href="https://github.com/lykjjj" title="lykjjj">
<img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/>
</a>
<a href="https://github.com/liliangrong777" title="liliangrong777">
<img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/>
</a>
<a href="https://github.com/Moeyuuko" title="Moeyuuko">
<img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/>
</a>
<a href="https://github.com/malcolmyu" title="Minghao Yu">
<img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/>
</a>
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski">
<img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/>
</a>
<a href="https://github.com/likeshop-github" title="LikeShop技术社区">
<img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="LikeShop技术社区"/>
</a>
<a href="https://github.com/Lihuagreek" title="Lihuagreek">
<img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/>
</a>
<a href="https://github.com/LightQuanta" title="Light_Quanta">
<img src="https://avatars.githubusercontent.com/u/18213217?v=4" width="42;" alt="Light_Quanta"/>
</a>
<a href="https://github.com/JetSquirrel" title="JetSquirrel">
<img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/>
</a>
<a href="https://github.com/jasnzhuang" title="Jason Zhuang">
<img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/>
</a>
<a href="https://github.com/Ding-Kyoma" title="HooinKyoma">
<img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/>
</a>
<a href="https://github.com/gongyeheyu" title="GONGYE Heyu">
<img src="https://avatars.githubusercontent.com/u/85177605?v=4" width="42;" alt="GONGYE Heyu"/>
</a>
<a href="https://github.com/Fuku-L" title="Fuku-L">
<img src="https://avatars.githubusercontent.com/u/38535911?v=4" width="42;" alt="Fuku-L"/>
</a>
<a href="https://github.com/sirius-fan" title="Fan">
<img src="https://avatars.githubusercontent.com/u/25720015?v=4" width="42;" alt="Fan"/>
</a>
<a href="https://github.com/eeeeeio" title="EEEEE">
<img src="https://avatars.githubusercontent.com/u/20723545?v=4" width="42;" alt="EEEEE"/>
</a>
<a href="https://github.com/demigodliu" title="DemigodLiu">
<img src="https://avatars.githubusercontent.com/u/30372735?v=4" width="42;" alt="DemigodLiu"/>
</a>
<a href="https://github.com/dasferco" title="Dasferco">
<img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/>
</a>
<a href="https://github.com/Damao2250" title="Damao">
<img src="https://avatars.githubusercontent.com/u/19251992?v=4" width="42;" alt="Damao"/>
</a>
<a href="https://github.com/ohto-ai" title="Choo">
<img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/>
</a>
<a href="https://github.com/CharlotteZeng" title="hanchZ">
<img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/>
</a>
<a href="https://github.com/ch3nnn" title="chentong">
<img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="chentong"/>
</a>
<a href="https://github.com/Brid9e" title="Joe">
<img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Joe"/>
</a>
<a href="https://github.com/dousha0w0" title="dousha0w0">
<img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/>
</a>
<a href="https://github.com/13812700839" title="花殇">
<img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/>
</a>
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm">
<img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/>
</a>
<a href="https://github.com/y52y" title="Zyj">
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
</a>
<a href="https://github.com/Leaderzhangyi" title="ZinkCas">
<img src="https://avatars.githubusercontent.com/u/46915666?v=4" width="42;" alt="ZinkCas"/>
</a>
<a href="https://github.com/zhu0629" title="zhucong">
<img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="zhucong"/>
</a>
<a href="https://github.com/yikuaibro" title="yikuaibro">
<img src="https://avatars.githubusercontent.com/u/44493045?v=4" width="42;" alt="yikuaibro"/>
</a>
<a href="https://github.com/dfshizhiqiang" title="Zech">
<img src="https://avatars.githubusercontent.com/u/7030019?v=4" width="42;" alt="Zech"/>
</a>
<a href="https://github.com/Yo-gurts" title="Yogurt">
<img src="https://avatars.githubusercontent.com/u/44612841?v=4" width="42;" alt="Yogurt"/>
</a>
<a href="https://github.com/hi-liyan" title="李李李">
<img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="李李李"/>
</a>
<a href="https://github.com/BATTLEHAWK00" title="While True: learn()">
<img src="https://avatars.githubusercontent.com/u/45313304?v=4" width="42;" alt="While True: learn()"/>
</a>
<a href="https://github.com/whb1998a" title="WHB">
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
</a>
<a href="https://github.com/YLee9527" title="Terry Young">
<img src="https://avatars.githubusercontent.com/u/18697332?v=4" width="42;" alt="Terry Young"/>
</a>
<a href="https://github.com/Xiwin" title="Xiwin">
<img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="Xiwin"/>
</a>
<a href="https://github.com/qinxiongzhou" title="Ryan Zhou">
<img src="https://avatars.githubusercontent.com/u/33239096?v=4" width="42;" alt="Ryan Zhou"/>
</a>
<a href="https://github.com/RivailleF" title="RivailleF">
<img src="https://avatars.githubusercontent.com/u/93083015?v=4" width="42;" alt="RivailleF"/>
</a>
<a href="https://github.com/QDelta" title="QDelta">
<img src="https://avatars.githubusercontent.com/u/60222316?v=4" width="42;" alt="QDelta"/>
</a>
<a href="https://github.com/sevenleave" title="Poirot Hercule">
<img src="https://avatars.githubusercontent.com/u/24411140?v=4" width="42;" alt="Poirot Hercule"/>
</a>
<a href="https://github.com/PipecraftNet" title="Pipecraft">
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
</a>
<a href="https://github.com/Perzch" title="Perzch">
<img src="https://avatars.githubusercontent.com/u/67987641?v=4" width="42;" alt="Perzch"/>
</a>
<a href="https://github.com/PILIHU2022" title="PILIHU2022">
<img src="https://avatars.githubusercontent.com/u/100511118?v=4" width="42;" alt="PILIHU2022"/>
</a>
<a href="https://github.com/HanaNoryu" title="Noryu">
<img src="https://avatars.githubusercontent.com/u/109856546?v=4" width="42;" alt="Noryu"/>
</a>
<a href="https://github.com/NianwenDan" title="NianwenDan">
<img src="https://avatars.githubusercontent.com/u/74407127?v=4" width="42;" alt="NianwenDan"/>
</a>
<a href="https://github.com/mo3et" title="Monet Lee">
<img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/>
</a><!--GAMFC-END-->
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调"><img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调"/></a>
<a href="https://github.com/fwqaaq" title="fwqaaq"><img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fwqaaq"/></a>
<a href="https://github.com/mofelee" title="mofelee"><img src="https://avatars.githubusercontent.com/u/5069410?v=4" width="42;" alt="mofelee"/></a>
<a href="https://github.com/Country-If" title="Maylon"><img src="https://avatars.githubusercontent.com/u/62837275?v=4" width="42;" alt="Maylon"/></a>
<a href="https://github.com/zhangymPerson" title="zhangym"><img src="https://avatars.githubusercontent.com/u/40376181?v=4" width="42;" alt="zhangym"/></a>
<a href="https://github.com/aixcyi" title="砹小翼"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"/></a>
<a href="https://github.com/nangongchengfeng" title="南宫乘风"><img src="https://avatars.githubusercontent.com/u/46562911?v=4" width="42;" alt="南宫乘风"/></a>
<a href="https://github.com/h7ml" title="h7ml"><img src="https://avatars.githubusercontent.com/u/55233292?v=4" width="42;" alt="h7ml"/></a>
<a href="https://github.com/LesterChang0987" title="Steve Hartwell"><img src="https://avatars.githubusercontent.com/u/114913921?v=4" width="42;" alt="Steve Hartwell"/></a>
<a href="https://github.com/JeffersonHuang" title="Jefferson Huang"><img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson Huang"/></a>
<a href="https://github.com/Alex20180512" title="Alex"><img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/></a>
<a href="https://github.com/LufsX" title="LufsX"><img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/></a>
<a href="https://github.com/mailbaoer" title="baoer"><img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/></a>
<a href="https://github.com/expoli" title="expoli"><img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/></a>
<a href="https://github.com/k23223" title="k23223"><img src="https://avatars.githubusercontent.com/u/57606136?v=4" width="42;" alt="k23223"/></a>
<a href="https://github.com/eryajf" title="二丫讲梵"><img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/></a>
<a href="https://github.com/undefined-hestudio" title="undefined"><img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"/></a>
<a href="https://github.com/Darkiiiiiice" title="Darkiiiiiice"><img src="https://avatars.githubusercontent.com/u/3959555?v=4" width="42;" alt="Darkiiiiiice"/></a>
<a href="https://github.com/genius-kim" title="Kim同学"><img src="https://avatars.githubusercontent.com/u/119488561?v=4" width="42;" alt="Kim同学"/></a>
<a href="https://github.com/qyl27" title="秋 雨落"><img src="https://avatars.githubusercontent.com/u/53731501?v=4" width="42;" alt="秋 雨落"/></a>
<a href="https://github.com/MackDing" title="Blossom"><img src="https://avatars.githubusercontent.com/u/19878893?v=4" width="42;" alt="Blossom"/></a>
<a href="https://github.com/1250422131" title="萌新杰少"><img src="https://avatars.githubusercontent.com/u/52126790?v=4" width="42;" alt="萌新杰少"/></a>
<a href="https://github.com/chaos-cn" title="chaos"><img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/></a>
<a href="https://github.com/xia0ne" title="YuRuiH"><img src="https://avatars.githubusercontent.com/u/32591223?v=4" width="42;" alt="YuRuiH"/></a>
<a href="https://github.com/Willxup" title="Willxup"><img src="https://avatars.githubusercontent.com/u/51990395?v=4" width="42;" alt="Willxup"/></a>
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu"><img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/></a>
<a href="https://github.com/lvelvee" title="Lve Lvee"><img src="https://avatars.githubusercontent.com/u/25785753?v=4" width="42;" alt="Lve Lvee"/></a>
<a href="https://github.com/wsypower" title="魏"><img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/></a>
<a href="https://github.com/itldg" title="老大哥"><img src="https://avatars.githubusercontent.com/u/13432299?v=4" width="42;" alt="老大哥"/></a>
<a href="https://github.com/catcto" title="小武Alan"><img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="小武Alan"/></a>
<a href="https://github.com/ryanhex53" title="ryanhex53"><img src="https://avatars.githubusercontent.com/u/360426?v=4" width="42;" alt="ryanhex53"/></a>
<a href="https://github.com/partoneplay" title="partoneplay"><img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/></a>
<a href="https://github.com/pangxiaoli" title="pangxiaoli"><img src="https://avatars.githubusercontent.com/u/54620953?v=4" width="42;" alt="pangxiaoli"/></a>
<a href="https://github.com/mancuoj" title="mancuoj"><img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/></a>
<a href="https://github.com/webeautiful" title="Albert"><img src="https://avatars.githubusercontent.com/u/3364316?v=4" width="42;" alt="Albert"/></a>
<a href="https://github.com/dadatom" title="Da Da"><img src="https://avatars.githubusercontent.com/u/33886943?v=4" width="42;" alt="Da Da"/></a>
<a href="https://github.com/ljq" title="Jack Liu"><img src="https://avatars.githubusercontent.com/u/7278286?v=4" width="42;" alt="Jack Liu"/></a>
<a href="https://github.com/jasnzhuang" title="Jason Zhuang"><img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/></a>
<a href="https://github.com/Jovins" title="Jovins"><img src="https://avatars.githubusercontent.com/u/17738992?v=4" width="42;" alt="Jovins"/></a>
<a href="https://github.com/long-910" title="Small Long"><img src="https://avatars.githubusercontent.com/u/7323488?v=4" width="42;" alt="Small Long"/></a>
<a href="https://github.com/SuperDiscovery" title="SuperDiscovery"><img src="https://avatars.githubusercontent.com/u/49646863?v=4" width="42;" alt="SuperDiscovery"/></a>
<a href="https://github.com/XYZscratcher" title="XYZ"><img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/></a>
<a href="https://github.com/findnr" title="findnr"><img src="https://avatars.githubusercontent.com/u/3909023?v=4" width="42;" alt="findnr"/></a>
<a href="https://github.com/greyhao" title="greyhao"><img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/></a>
<a href="https://github.com/1834423612" title="kjch"><img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/></a>
<a href="https://github.com/yanxuplay" title="hupilan"><img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/></a>
<a href="https://github.com/hweining" title="hweining"><img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/></a>
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
<a href="https://github.com/auroraslot" title="irony"><img src="https://avatars.githubusercontent.com/u/48817882?v=4" width="42;" alt="irony"/></a>
<a href="https://github.com/jlchen5" title="jlchen5"><img src="https://avatars.githubusercontent.com/u/61578993?v=4" width="42;" alt="jlchen5"/></a>
<a href="https://github.com/joyfully-W" title="joyfully-W"><img src="https://avatars.githubusercontent.com/u/32212924?v=4" width="42;" alt="joyfully-W"/></a>
<a href="https://github.com/jqzhao7" title="jqzhao"><img src="https://avatars.githubusercontent.com/u/54694535?v=4" width="42;" alt="jqzhao"/></a>
<a href="https://github.com/jussker" title="jussker"><img src="https://avatars.githubusercontent.com/u/33953356?v=4" width="42;" alt="jussker"/></a>
<a href="https://github.com/k983551019" title="k983551019"><img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/></a>
<a href="https://github.com/kdxcxs" title="kdxcxs"><img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/></a>
<a href="https://github.com/kubeme" title="kubernetes for me"><img src="https://avatars.githubusercontent.com/u/16346220?v=4" width="42;" alt="kubernetes for me"/></a>
<a href="https://github.com/larry-xue" title="larry"><img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/></a>
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
<a href="https://github.com/hua03" title="hua03"><img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/></a>
<a href="https://github.com/gzttcydxx" title="gzttcydxx"><img src="https://avatars.githubusercontent.com/u/50025185?v=4" width="42;" alt="gzttcydxx"/></a>
<a href="https://github.com/sunny0826" title="Xudong Guo"><img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/></a>
<a href="https://github.com/nodjoy" title="gowshwah"><img src="https://avatars.githubusercontent.com/u/145280043?v=4" width="42;" alt="gowshwah"/></a>
<a href="https://github.com/godotc" title="godot42"><img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godot42"/></a>
<a href="https://github.com/gi-b716" title="Gavin"><img src="https://avatars.githubusercontent.com/u/78394473?v=4" width="42;" alt="Gavin"/></a>
<a href="https://github.com/fjqz177" title="fjqz177"><img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/></a>
<a href="https://github.com/fakevn" title="fakevn"><img src="https://avatars.githubusercontent.com/u/11464386?v=4" width="42;" alt="fakevn"/></a>
<a href="https://github.com/cool9203" title="cool9203"><img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/></a>
<a href="https://github.com/gaoxiaoduan" title="CoderDuan"><img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="CoderDuan"/></a>
<a href="https://github.com/lijc210" title="cizai"><img src="https://avatars.githubusercontent.com/u/10651081?v=4" width="42;" alt="cizai"/></a>
<a href="https://github.com/chyok" title="chyok"><img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/></a>
<a href="https://github.com/zlfyuan" title="bgbgPang"><img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/></a>
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm"><img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/></a>
<a href="https://github.com/binscor" title="Zheng Nai Bin"><img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/></a>
<a href="https://github.com/qwxingzhe" title="行者"><img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/></a>
<a href="https://github.com/HanaChan233" title="花开花落"><img src="https://avatars.githubusercontent.com/u/75212820?v=4" width="42;" alt="花开花落"/></a>
<a href="https://github.com/lisheng741" title="芦荟柚子茶"><img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/></a>
<a href="https://github.com/wangdaodao" title="王叨叨"><img src="https://avatars.githubusercontent.com/u/2317442?v=4" width="42;" alt="王叨叨"/></a>
<a href="https://github.com/HChenX" title="焕晨HChen"><img src="https://avatars.githubusercontent.com/u/123531821?v=4" width="42;" alt="焕晨HChen"/></a>
<a href="https://github.com/LebranceBW" title="落叶乌龟"><img src="https://avatars.githubusercontent.com/u/19501514?v=4" width="42;" alt="落叶乌龟"/></a>
<a href="https://github.com/ZIDOUZI" title="子斗子"><img src="https://avatars.githubusercontent.com/u/53157536?v=4" width="42;" alt="子斗子"/></a>
<a href="https://github.com/LuckyJie12" title="夜未央"><img src="https://avatars.githubusercontent.com/u/102901105?v=4" width="42;" alt="夜未央"/></a>
<a href="https://github.com/lvzhenbo" title="吕振波"><img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/></a>
<a href="https://github.com/zxx457" title="zxx457"><img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx457"/></a>
<a href="https://github.com/zhouhw0306" title="zhouhw0306"><img src="https://avatars.githubusercontent.com/u/82752681?v=4" width="42;" alt="zhouhw0306"/></a>
<a href="https://github.com/hiyms" title="yms"><img src="https://avatars.githubusercontent.com/u/84654050?v=4" width="42;" alt="yms"/></a>
<a href="https://github.com/xing133" title="xing133"><img src="https://avatars.githubusercontent.com/u/5336490?v=4" width="42;" alt="xing133"/></a>
<a href="https://github.com/wjjwkwindy" title="Hudson Alen"><img src="https://avatars.githubusercontent.com/u/9508591?v=4" width="42;" alt="Hudson Alen"/></a>
<a href="https://github.com/wannima66" title="tmen"><img src="https://avatars.githubusercontent.com/u/26410255?v=4" width="42;" alt="tmen"/></a>
<a href="https://github.com/swift-fs" title="swift"><img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift"/></a>
<a href="https://github.com/suyangzuo" title="suyangzuo"><img src="https://avatars.githubusercontent.com/u/50766353?v=4" width="42;" alt="suyangzuo"/></a>
<a href="https://github.com/Mowmowj" title="nexo"><img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/></a>
<a href="https://github.com/phygerr" title="phygerr"><img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/></a>
<a href="https://github.com/onewesong" title="onewesong"><img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/></a>
<a href="https://github.com/miclon-dev" title="miclon-dev"><img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/></a>
<a href="https://github.com/lykjjj" title="lykjjj"><img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/></a>
<a href="https://github.com/lozhu20" title="lozhu"><img src="https://avatars.githubusercontent.com/u/44923922?v=4" width="42;" alt="lozhu"/></a>
<a href="https://github.com/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></a>
<a href="https://github.com/leauny" title="leauny"><img src="https://avatars.githubusercontent.com/u/42369176?v=4" width="42;" alt="leauny"/></a>
<a href="https://github.com/y52y" title="Zyj"><img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/></a>
<a href="https://github.com/isecret" title="Mao Wang"><img src="https://avatars.githubusercontent.com/u/15724152?v=4" width="42;" alt="Mao Wang"/></a>
<a href="https://github.com/likeshop-github" title="likeshop技术社区"><img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="likeshop技术社区"/></a>
<a href="https://github.com/Lihuagreek" title="Lihuagreek"><img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/></a>
<a href="https://github.com/LightQuanta" title="Light_Quanta"><img src="https://avatars.githubusercontent.com/u/18213217?v=4" width="42;" alt="Light_Quanta"/></a>
<a href="https://github.com/JetSquirrel" title="JetSquirrel"><img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/></a>
<a href="https://github.com/jeremyjone" title="Jeremy Jone"><img src="https://avatars.githubusercontent.com/u/37676231?v=4" width="42;" alt="Jeremy Jone"/></a>
<a href="https://github.com/JavaZeroo" title="JavaZero"><img src="https://avatars.githubusercontent.com/u/71128095?v=4" width="42;" alt="JavaZero"/></a>
<a href="https://github.com/Ding-Kyoma" title="HooinKyoma"><img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/></a>
<a href="https://github.com/gongyeheyu" title="GONGYE Heyu"><img src="https://avatars.githubusercontent.com/u/85177605?v=4" width="42;" alt="GONGYE Heyu"/></a>
<a href="https://github.com/Fuku-L" title="Foozi"><img src="https://avatars.githubusercontent.com/u/38535911?v=4" width="42;" alt="Foozi"/></a>
<a href="https://github.com/sirius-fan" title="Fan"><img src="https://avatars.githubusercontent.com/u/25720015?v=4" width="42;" alt="Fan"/></a>
<a href="https://github.com/eeeeeio" title="EEEEE"><img src="https://avatars.githubusercontent.com/u/20723545?v=4" width="42;" alt="EEEEE"/></a>
<a href="https://github.com/demigodliu" title="DemigodLiu"><img src="https://avatars.githubusercontent.com/u/30372735?v=4" width="42;" alt="DemigodLiu"/></a>
<a href="https://github.com/dasferco" title="Dasferco"><img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/></a>
<a href="https://github.com/Damao2250" title="Damao"><img src="https://avatars.githubusercontent.com/u/19251992?v=4" width="42;" alt="Damao"/></a>
<a href="https://github.com/DEEMO101" title="DEEMO101"><img src="https://avatars.githubusercontent.com/u/35123091?v=4" width="42;" alt="DEEMO101"/></a>
<a href="https://github.com/ohto-ai" title="Choo"><img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/></a>
<a href="https://github.com/CharlotteZeng" title="hanchZ"><img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/></a>
<a href="https://github.com/ch3nnn" title="chentong"><img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="chentong"/></a>
<a href="https://github.com/Brid9e" title="Joe"><img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Joe"/></a>
<a href="https://github.com/BobH-Official" title="BobH"><img src="https://avatars.githubusercontent.com/u/29333228?v=4" width="42;" alt="BobH"/></a>
<a href="https://github.com/Blanket58" title="Blanket58"><img src="https://avatars.githubusercontent.com/u/39766189?v=4" width="42;" alt="Blanket58"/></a>
<a href="https://github.com/BlacAmDK" title="BlacAmDK"><img src="https://avatars.githubusercontent.com/u/10971397?v=4" width="42;" alt="BlacAmDK"/></a>
<a href="https://github.com/gitchenze" title="Aze"><img src="https://avatars.githubusercontent.com/u/13357869?v=4" width="42;" alt="Aze"/></a>
<a href="https://github.com/dousha0w0" title="dousha0w0"><img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/></a>
<a href="https://github.com/13812700839" title="花殇"><img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/></a>
<a href="https://github.com/Leaderzhangyi" title="ZinkCas"><img src="https://avatars.githubusercontent.com/u/46915666?v=4" width="42;" alt="ZinkCas"/></a>
<a href="https://github.com/zhu0629" title="zhucong"><img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="zhucong"/></a>
<a href="https://github.com/yikuaibro" title="yikuaibro"><img src="https://avatars.githubusercontent.com/u/44493045?v=4" width="42;" alt="yikuaibro"/></a>
<a href="https://github.com/dfshizhiqiang" title="Zech"><img src="https://avatars.githubusercontent.com/u/7030019?v=4" width="42;" alt="Zech"/></a>
<a href="https://github.com/Yo-gurts" title="Yogurt"><img src="https://avatars.githubusercontent.com/u/44612841?v=4" width="42;" alt="Yogurt"/></a>
<a href="https://github.com/hi-liyan" title="李李李"><img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="李李李"/></a>
<a href="https://github.com/BATTLEHAWK00" title="While True: learn()"><img src="https://avatars.githubusercontent.com/u/45313304?v=4" width="42;" alt="While True: learn()"/></a>
<a href="https://github.com/dwgeneral" title="Happy-Engineer"><img src="https://avatars.githubusercontent.com/u/8654993?v=4" width="42;" alt="Happy-Engineer"/></a>
<a href="https://github.com/whb1998a" title="Wafer"><img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="Wafer"/></a>
<a href="https://github.com/YLee9527" title="Terry Young"><img src="https://avatars.githubusercontent.com/u/18697332?v=4" width="42;" alt="Terry Young"/></a>
<a href="https://github.com/TRDSCSH" title="TRDSCSH"><img src="https://avatars.githubusercontent.com/u/125717891?v=4" width="42;" alt="TRDSCSH"/></a>
<a href="https://github.com/Xiwin" title="Xiwin"><img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="Xiwin"/></a>
<a href="https://github.com/DataEraserC" title="Sacabambaspis"><img src="https://avatars.githubusercontent.com/u/102341238?v=4" width="42;" alt="Sacabambaspis"/></a>
<a href="https://github.com/qinxiongzhou" title="Ryan Zhou"><img src="https://avatars.githubusercontent.com/u/33239096?v=4" width="42;" alt="Ryan Zhou"/></a>
<a href="https://github.com/RivailleF" title="RivailleF"><img src="https://avatars.githubusercontent.com/u/93083015?v=4" width="42;" alt="RivailleF"/></a>
<a href="https://github.com/QDelta" title="QDelta"><img src="https://avatars.githubusercontent.com/u/60222316?v=4" width="42;" alt="QDelta"/></a>
<a href="https://github.com/sevenleave" title="Poirot Hercule"><img src="https://avatars.githubusercontent.com/u/24411140?v=4" width="42;" alt="Poirot Hercule"/></a>
<a href="https://github.com/PipecraftNet" title="Pipecraft"><img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/></a>
<a href="https://github.com/Perzch" title="Perzch"><img src="https://avatars.githubusercontent.com/u/67987641?v=4" width="42;" alt="Perzch"/></a>
<a href="https://github.com/PILIHU2022" title="PILIHU2022"><img src="https://avatars.githubusercontent.com/u/100511118?v=4" width="42;" alt="PILIHU2022"/></a>
<a href="https://github.com/HanaNoryu" title="Noryu"><img src="https://avatars.githubusercontent.com/u/109856546?v=4" width="42;" alt="Noryu"/></a>
<a href="https://github.com/NianwenDan" title="NianwenDan"><img src="https://avatars.githubusercontent.com/u/74407127?v=4" width="42;" alt="NianwenDan"/></a>
<a href="https://github.com/mo3et" title="Monet Lee"><img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/></a>
<a href="https://github.com/Moeyuuko" title="Moeyuuko"><img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/></a>
<a href="https://github.com/malcolmyu" title="Minghao Yu"><img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/></a>
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a><!--GAMFC-END-->
[贡献者](https://github.com/jaywcjlove/reference/graphs/contributors)列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 根据提交次数的先后顺序自动生成
<!--rehype:style=padding-top:1rem;-->
@@ -633,6 +455,9 @@ Quick Reference
[srebro.cn](https://ref.srebro.cn)<!--rehype:target=_blank&data-info=👆每天自动同步-->
[haah.net](https://ref.haah.net)<!--rehype:target=_blank&data-info=👆每天自动同步-->
[xiechengqi.top](https://ref.xiechengqi.top)<!--rehype:target=_blank&data-info=👆每天自动同步-->
[ownit.top](https://memo.ownit.top)<!--rehype:target=_blank&data-info=👆每十分钟自动同步-->
[666666.dev](https://cheat.666666.dev)<!--rehype:target=_blank&data-info=👆每天自动同步-->
[mmoke.com](https://ref.mmoke.com)<!--rehype:target=_blank&data-info=👆每天自动同步-->
[laoleng.vip](http://bbs.laoleng.vip/reference/)<!--rehype:target=_blank-->
[dbyun.net](https://www.dbyun.net/reference/index.html)<!--rehype:target=_blank-->
[if010.com](https://quickref.if010.com/)<!--rehype:target=_blank-->
@@ -677,16 +502,45 @@ Quick Reference
[jeffjade.com](https://codehelp.jeffjade.com)<!--rehype:target=_blank-->
[okhk.net](https://ref.okhk.net)<!--rehype:target=_blank-->
[wdft.com](https://ref.wdft.com)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
[xuyiyang.vip](https://reference.xuyiyang.vip/)<!--rehype:target=_blank-->
[xiaopa.cc](https://reference.xiaopa.cc)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
[zsccodelnc.cn](https://zsccodelnc.cn/coderef/)<!--rehype:target=_blank-->
[chanlun.pro](https://ref.chanlun.pro)<!--rehype:target=_blank-->
[likui.info](https://r.likui.info)<!--rehype:target=_blank-->
[ruiange.work](https://code.ruiange.work/)<!--rehype:target=_blank-->
[denganliang.com](https://ref.denganliang.com)<!--rehype:target=_blank-->
[coderjia.cn](https://refer.coderjia.cn)<!--rehype:target=_blank-->
[ivanz.cc](https://ref.ivanz.cc)<!--rehype:target=_blank-->
[dev6.site](https://ref.dev6.site/)<!--rehype:target=_blank-->
[mingming.dev](https://ref.mingming.dev)<!--rehype:target=_blank-->
[clf.lol](https://ref.clf.lol/)<!--rehype:target=_blank-->
[zishu.me](https://ref.zishu.me/)<!--rehype:target=_blank-->
[sucan2233.cn](http://reference.sucan2233.cn)<!--rehype:target=_blank-->
[reference-bk9.pages.dev](https://reference-bk9.pages.dev/)<!--rehype:target=_blank&class=contributing&data-info=👆自动实时同步-->
[hrzweb.xyz](https://r.hrzweb.xyz)<!--rehype:target=_blank-->
[bobh.cool](https://quickref.bobh.cool)<!--rehype:target=_blank-->
[tangwudi.com](https://doc.tangwudi.com)<!--rehype:target=_blank-->
[alomerry.com](https://ref.alomerry.com)<!--rehype:target=_blank-->
[osz.icu](https://ref.osz.icu/)<!--rehype:target=_blank-->
[ylmty.cc](https://docs.ylmty.cc)<!--rehype:target=_blank-->
[g31.top](https://ref.g31.top/)<!--rehype:target=_blank-->
[9up.dev](https://devref.9up.dev)<!--rehype:target=_blank-->
[cizai.io](https://reference.cizai.io)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
[docs.willxup.top](https://docs.willxup.top)<!--rehype:target=_blank-->
[wangchunfei.com](https://ref.wangchunfei.com/)<!--rehype:target=_blank-->
[object.cool](https://r.object.cool)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
[luckyits.com](https://ref.luckyits.com/)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
[jeremyjone.com](https://ref.jeremyjone.com/)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
[gistudy.net](https://reference.gistudy.net/)<!--rehype:target=_blank-->
[maoo.me](https://note.maoo.me)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
[deyout.com](https://ref.deyout.com)<!--rehype:target=_blank-->
[xod.cc](https://ref.xod.cc)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
[reference.const.team](https://reference.const.team)<!--rehype:target=_blank-->
<!--rehype:class=home-card home-links-->
如果你有资源,可以很方便[部署 web 版](https://github.com/jaywcjlove/reference/issues/102#issue-1451649637),这非常简单,只需要克隆 [gh-pages](https://github.com/jaywcjlove/reference/tree/gh-pages) 分支代码到你的静态服务就可以了,还可以使用 [docker](https://hub.docker.com/r/wcjiang/reference) 快捷部署 web 版。
<!--rehype:ignore:start-->
## License

13
assets/bun.svg Normal file
View File

@@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 70" height="1em" width="1em">
<path d="M71.09 20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46 26.46 0 0 1 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05-11.58 0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55 65.3 30.14 69.75 42 69.75c20.68 0 37.5-13.48 37.5-30 0-7.06-3.04-13.75-8.41-19.01Z"/>
<path d="M73 35.7c0 15.21-15.67 27.54-35 27.54S3 50.91 3 35.7C3 26.27 9 17.94 18.22 13S33.18 3 38 3s8.94 4.13 19.78 10C67 17.94 73 26.27 73 35.7Z" style="fill:#fbf0df"/>
<path data-name="Bottom Shadow" d="M73 35.7a21.67 21.67 0 0 0-.8-5.78c-2.73 33.3-43.35 34.9-59.32 24.94A40 40 0 0 0 38 63.24c19.3 0 35-12.35 35-27.54Z" style="fill:#f6dece"/>
<path data-name="Light Shine" d="M24.53 11.17C29 8.49 34.94 3.46 40.78 3.45A9.29 9.29 0 0 0 38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7v1.19c6.06-21.41 17.07-23.04 21.53-25.72Z" style="fill:#fffefc"/>
<path d="M35.12 5.53A16.41 16.41 0 0 1 29.49 18c-.28.25-.06.73.3.59 3.37-1.31 7.92-5.23 6-13.14-.08-.45-.67-.33-.67.08Zm2.27 0A16.24 16.24 0 0 1 39 19c-.12.35.31.65.55.36 2.19-2.8 4.1-8.36-1.62-14.36-.29-.26-.74.14-.54.49Zm2.76-.17A16.42 16.42 0 0 1 47 17.12a.33.33 0 0 0 .65.11c.92-3.49.4-9.44-7.17-12.53-.4-.16-.66.38-.33.62Zm-18.46 10.4a16.94 16.94 0 0 0 10.47-9c.18-.36.75-.22.66.18-1.73 8-7.52 9.67-11.12 9.45-.38.01-.37-.52-.01-.63Z" style="fill:#ccbea7;fill-rule:evenodd"/>
<path d="M38 65.75C17.32 65.75.5 52.27.5 35.7c0-10 6.18-19.33 16.53-24.92 3-1.6 5.57-3.21 7.86-4.62 1.26-.78 2.45-1.51 3.6-2.19C32 1.89 35 .5 38 .5s5.62 1.2 8.9 3.14c1 .57 2 1.19 3.07 1.87 2.49 1.54 5.3 3.28 9 5.27C69.32 16.37 75.5 25.69 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05ZM38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7c0 15.19 15.7 27.55 35 27.55S73 50.89 73 35.7c0-9.08-5.69-17.57-15.22-22.7-3.78-2-6.73-3.88-9.12-5.36-1.09-.67-2.09-1.29-3-1.84C42.63 4 40.42 3 38 3Z"/><g>
<path d="M45.05 43a8.93 8.93 0 0 1-2.92 4.71 6.81 6.81 0 0 1-4 1.88A6.84 6.84 0 0 1 34 47.71 8.93 8.93 0 0 1 31.12 43a.72.72 0 0 1 .8-.81h12.34a.72.72 0 0 1 .79.81Z" style="fill:#b71422" data-name="Background"/>
<path data-name="Background" d="M34 47.79a6.91 6.91 0 0 0 4.12 1.9 6.91 6.91 0 0 0 4.11-1.9 10.63 10.63 0 0 0 1-1.07 6.83 6.83 0 0 0-4.9-2.31 6.15 6.15 0 0 0-5 2.78c.23.21.43.41.67.6Z" style="fill:#ff6164"/>
<path data-name="Outline" d="M34.16 47a5.36 5.36 0 0 1 4.19-2.08 6 6 0 0 1 4 1.69c.23-.25.45-.51.66-.77a7 7 0 0 0-4.71-1.93 6.36 6.36 0 0 0-4.89 2.36 9.53 9.53 0 0 0 .75.73Z"/>
<path data-name="Outline" d="M38.09 50.19a7.42 7.42 0 0 1-4.45-2 9.52 9.52 0 0 1-3.11-5.05 1.2 1.2 0 0 1 .26-1 1.41 1.41 0 0 1 1.13-.51h12.34a1.44 1.44 0 0 1 1.13.51 1.19 1.19 0 0 1 .25 1 9.52 9.52 0 0 1-3.11 5.05 7.42 7.42 0 0 1-4.44 2Zm-6.17-7.4c-.16 0-.2.07-.21.09a8.29 8.29 0 0 0 2.73 4.37A6.23 6.23 0 0 0 38.09 49a6.28 6.28 0 0 0 3.65-1.73 8.3 8.3 0 0 0 2.72-4.37.21.21 0 0 0-.2-.09Z"/></g><g><ellipse data-name="Right Blush" cx="53.22" cy="40.18" rx="5.85" ry="3.44" style="fill:#febbd0"/><ellipse data-name="Left Bluch" cx="22.95" cy="40.18" rx="5.85" ry="3.44" style="fill:#febbd0"/>
<path d="M25.7 38.8a5.51 5.51 0 1 0-5.5-5.51 5.51 5.51 0 0 0 5.5 5.51Zm24.77 0A5.51 5.51 0 1 0 45 33.29a5.5 5.5 0 0 0 5.47 5.51Z" style="fill-rule:evenodd"/>
<path d="M24 33.64a2.07 2.07 0 1 0-2.06-2.07A2.07 2.07 0 0 0 24 33.64Zm24.77 0a2.07 2.07 0 1 0-2.06-2.07 2.07 2.07 0 0 0 2.04 2.07Z" style="fill:#fff;fill-rule:evenodd"/></g></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

5
assets/chatgpt.svg Normal file
View File

@@ -0,0 +1,5 @@
<svg width="1em" height="1em" viewBox="0 0 41 41" fill="none" xmlns="http://www.w3.org/2000/svg" stroke-width="1.5"
class="h-6 w-6">
<path d="M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z"
fill="currentColor"></path>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 640 512" height="1em" width="1em">
<path d="M349.9 236.3h-66.1v-59.4h66.1v59.4zm0-204.3h-66.1v60.7h66.1V32zm78.2 144.8H362v59.4h66.1v-59.4zm-156.3-72.1h-66.1v60.1h66.1v-60.1zm78.1 0h-66.1v60.1h66.1v-60.1zm276.8 100c-14.4-9.7-47.6-13.2-73.1-8.4-3.3-24-16.7-44.9-41.1-63.7l-14-9.3-9.3 14c-18.4 27.8-23.4 73.6-3.7 103.8-8.7 4.7-25.8 11.1-48.4 10.7H2.4c-8.7 50.8 5.8 116.8 44 162.1 37.1 43.9 92.7 66.2 165.4 66.2 157.4 0 273.9-72.5 328.4-204.2 21.4.4 67.6.1 91.3-45.2 1.5-2.5 6.6-13.2 8.5-17.1l-13.3-8.9zm-511.1-27.9h-66v59.4h66.1v-59.4zm78.1 0h-66.1v59.4h66.1v-59.4zm78.1 0h-66.1v59.4h66.1v-59.4zm-78.1-72.1h-66.1v60.1h66.1v-60.1z"/>
</svg>

After

Width:  |  Height:  |  Size: 713 B

5
assets/elasticsearch.svg Normal file
View File

@@ -0,0 +1,5 @@
<svg viewBox="0 0 256 288" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" height="1em" width="1em">
<path d="M0 143.82c0 12.44 1.744 24.441 4.71 35.956h175.067c19.856 0 35.955-16.1 35.955-35.956 0-19.865-16.1-35.955-35.955-35.955H4.71C1.744 119.371 0 131.38 0 143.82" fill="#343741"/>
<path d="M242.013 68.863c5.025-4.629 9.7-9.6 13.987-14.93C229.636 21.079 189.213 0 143.82 0 87 0 38.101 33.052 14.775 80.9h196.559c11.38 0 22.319-4.324 30.678-12.037" fill="#FEC514"/>
<path d="M211.334 206.742H14.774c23.336 47.839 72.226 80.9 129.045 80.9 45.393 0 85.816-21.088 112.18-53.933a136.604 136.604 0 0 0-13.987-14.94c-8.36-7.721-19.299-12.027-30.678-12.027" fill="#00BFB3"/>
</svg>

After

Width:  |  Height:  |  Size: 703 B

1
assets/elixir.svg Normal file
View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711950965872" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4680" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M519.381333 967.722667c-164.693333 0-298.24-155.306667-298.24-346.88 0-156.928 118.314667-348.672 209.749334-465.493334 43.264-55.296 125.013333-99.072 125.013333-99.072s-41.898667 223.530667 71.808 312.277334c100.949333 78.805333 175.189333 181.333333 175.189333 271.488 0 180.565333-118.784 327.68-283.52 327.68z" fill="currentColor" p-id="4681"></path></svg>

After

Width:  |  Height:  |  Size: 694 B

12
assets/erlang.svg Normal file
View File

@@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 256 225">
<g fill="none" fill-rule="evenodd">
<path fill="#A90533" fill-rule="nonzero" d="M44.3399607 159.659089C25.536634 139.734178 14.5349706 112.207841 14.5628518 79.365069 14.5368716 50.3198413 23.6628914 25.3541383 39.3517627 6.35691059L39.3264162 6.36641554 6.35057459 6.36641554 6.35057459 159.662257 44.3165152 159.662257 44.3399607 159.659089 44.3399607 159.659089ZM218.009347 159.671762C226.109466 150.996277 233.367446 140.779089 239.944238 129.094336L203.445228 110.844831C190.626852 131.684119 171.881188 150.865742 145.959287 150.993742 108.232872 150.865742 93.4102182 118.60594 93.4916246 77.0832472L234.469386 77.0832472C234.657584 72.3954056 234.657584 70.2156037 234.469386 67.9591284 235.389466 43.2557621 228.842456 22.4912472 216.932753 6.32079178L216.871287 6.36704921 248.612753 6.36704921 248.612753 159.662891 217.940278 159.662891 218.009347 159.671762 218.009347 159.671762Z"/>
<path fill="#A90533" fill-rule="nonzero" d="M95.7737825,41.4967126 C97.3344954,22.6971878 112.156515,10.0543363 129.535367,10.0163165 C147.032713,10.0543363 159.674931,22.6971878 160.103287,41.4967126 L95.7737825,41.4967126 L95.7737825,41.4967126 Z"/>
<polygon fill="currentColor" fill-rule="nonzero" points="26.426 185.668 26.426 179.281 6.807 179.281 6.807 217.149 26.426 217.149 26.426 210.761 14.107 210.761 14.107 200.724 25.969 200.724 25.969 194.337 14.107 194.337 14.107 185.668"/>
<path fill="currentColor" fill-rule="nonzero" d="M59.7310102,201.179881 C64.6216241,200.453703 67.3070894,195.607446 67.4870498,190.686416 C67.3070894,182.635723 62.088238,179.304555 54.7123964,179.280475 L44.6751687,179.280475 L44.6751687,217.148198 L51.9749706,217.148198 L51.9749706,202.092356 L61.0997231,217.148198 L70.2244756,217.148198 L59.7310102,201.179881 L59.7310102,201.179881 Z M51.974337,185.212198 L52.8868122,185.212198 C56.8693865,185.361743 59.8583766,186.270416 59.7303766,191.143287 C59.8583766,195.608079 56.9707726,196.819644 52.8868122,196.618139 L51.974337,196.618139 L51.974337,185.212198 L51.974337,185.212198 Z"/>
<polygon fill="currentColor" fill-rule="nonzero" points="93.036 179.281 85.737 179.281 85.737 217.149 103.529 217.149 103.529 210.761 93.036 210.761"/>
<path fill="currentColor" fill-rule="nonzero" d="M140.940674,209.392158 L144.134337,217.148198 L151.890377,217.148198 L137.74701,178.368 L131.815921,178.368 L116.76008,217.148198 L124.515485,217.148198 L127.709783,209.392158 L140.940674,209.392158 L140.940674,209.392158 Z M139.115723,203.461703 L129.990971,203.461703 L134.097109,189.318337 L139.115723,203.461703 L139.115723,203.461703 Z"/>
<polygon fill="currentColor" fill-rule="nonzero" points="165.578 217.149 173.334 217.149 173.334 191.6 193.409 218.061 198.883 218.061 198.883 179.281 191.127 179.281 191.127 204.83 171.052 178.368 165.578 178.368"/>
<path fill="currentColor" fill-rule="nonzero" d="M230.820119,197.073743 L230.820119,203.004832 L239.032396,203.004832 C238.861307,207.771248 234.960476,211.809584 230.363882,211.673347 C223.104634,211.809584 219.507327,204.794297 219.414179,198.442455 C219.507327,192.175525 223.053941,184.856713 230.363882,184.755327 C234.20008,184.856079 237.443169,187.480713 239.032396,190.686416 L245.419723,187.492753 C242.610693,181.575604 236.936238,178.294495 230.363882,178.368 C219.051089,178.295129 211.806416,187.632792 211.658139,198.442455 C211.806416,208.982812 218.848951,218.371168 229.907644,218.516911 C241.850931,218.371168 247.373307,208.831366 247.244674,197.986218 L247.244674,197.073743 L230.820119,197.073743 L230.820119,197.073743 L230.820119,197.073743 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

7
assets/figma.svg Normal file
View File

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 7.678 7.68" height="1em" width="1em">
<path d="M2.56 7.68A1.28 1.28 0 0 0 3.84 6.4V5.12H2.56a1.28 1.28 0 0 0 0 2.56z" fill="#0acf83"/>
<path d="M1.28 3.84a1.28 1.28 0 0 1 1.28-1.28h1.28v2.56H2.56a1.28 1.28 0 0 1-1.28-1.28z" fill="#a259ff"/>
<path d="M1.28 1.28A1.28 1.28 0 0 1 2.559 0h1.28v2.56H2.56a1.28 1.28 0 0 1-1.28-1.28z" fill="#f24e1e"/>
<path d="M3.84 0h1.28a1.28 1.28 0 0 1 0 2.56H3.84z" fill="#ff7262"/>
<path d="M6.4 3.84a1.28 1.28 0 0 1-2.56 0 1.28 1.28 0 0 1 2.56 0z" fill="#1abcfe"/>
</svg>

After

Width:  |  Height:  |  Size: 568 B

1
assets/finder.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 465 512"><path fill="currentColor" d="M248.872 63.164H0v381.678h261.91c-5.933-22.006-9.425-44.83-10.382-68.447c-68.347 4.003-133.766-13.78-180.387-34.21l8.366-19.544c57.24 24.51 114.676 35.3 171.812 32.432c.446-20.1 2.592-40.72 6.53-61.851h-80.66c-1.25-89.57 29.694-162.884 71.683-230.058m-134.6 60.62h21.255v51.408h-21.256z"/><path fill="currentColor" d="M275.335 353.01c37.076-4.358 73.997-14.42 110.621-30.343l8.48 19.491c-39.404 17.135-79.134 27.89-119.027 32.342c.925 24.412 4.796 47.862 11.426 70.342h177.716V63.164H277.265c-48.15 73.047-72.046 138.577-75.561 206.144h85.683c-4.489 18.091-10.965 48.315-12.052 83.702m60.787-177.818h-21.256v-51.407h21.256zM277.265 63.164c10.43-15.824 21.947-31.984 34.7-48.613L292.992 0c-16.643 21.701-31.247 42.669-44.12 63.164zm-15.378 381.678c6.312 23.342 15.365 45.765 27.28 67.158l20.893-11.635c-9.876-17.731-17.584-36.272-23.275-55.523z"/></svg>

After

Width:  |  Height:  |  Size: 968 B

1
assets/neo4j.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" fill="#4581C3" role="img" viewBox="0 0 24 24"><title>Neo4j</title><path d="M9.629 13.227c-.593 0-1.139.2-1.58.533l-2.892-1.976a2.61 2.61 0 0 0 .101-.711 2.633 2.633 0 0 0-2.629-2.629A2.632 2.632 0 0 0 0 11.073a2.632 2.632 0 0 0 2.629 2.629c.593 0 1.139-.2 1.579-.533L7.1 15.145c-.063.226-.1.465-.1.711 0 .247.037.484.1.711l-2.892 1.976a2.608 2.608 0 0 0-1.579-.533A2.632 2.632 0 0 0 0 20.639a2.632 2.632 0 0 0 2.629 2.629 2.632 2.632 0 0 0 2.629-2.629c0-.247-.037-.485-.101-.711l2.892-1.976c.441.333.987.533 1.58.533a2.633 2.633 0 0 0 2.629-2.629c0-1.45-1.18-2.629-2.629-2.629ZM16.112.732c-4.72 0-7.888 2.748-7.888 8.082v3.802a3.525 3.525 0 0 1 3.071.008v-3.81c0-3.459 1.907-5.237 4.817-5.237s4.817 1.778 4.817 5.237v8.309H24V8.814C24 3.448 20.832.732 16.112.732Z"/></svg>

After

Width:  |  Height:  |  Size: 837 B

6
assets/nvm.svg Normal file
View File

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" fill="currentColor" height="1em" width="1em">
<g>
<path d="M499.8 990c-12.6 0-25.2-3.4-36.4-10.1l-115.9-71c-17.3-10-8.8-13.6-3.2-15.6 23.1-8.3 30-12.4 54.6-26.9 2.6-1.5 6-.9 8.7.7l86.9 51.4c3.2 1.9 7.8 1.9 10.8 0l339.5-201.8c3.2-1.9 5.3-5.8 5.3-9.7V298.5c0-4-2.1-7.9-5.4-9.9L505.3 81.5c-3.2-2-7.5-2-10.7 0L155.5 288.6c-3.4 2-5.5 5.9-5.5 9.8V707c0 4 2.1 7.7 5.4 9.6l87.3 52.4c51.6 26.7 82.2-.4 82.2-32V335.3c0-5.8 4.5-10.3 10.1-10.3h49.9c5.5 0 10.1 4.5 10.1 10.3v401.8c0 71.2-42.3 112.1-107.6 112.1-20 0-35.9 0-80-22.5l-91-54.2C93.9 759.1 80 734 80 707.1V292.6c0-26.9 13.9-52 36.5-65.4L463.6 19.6c21.9-12.9 51.1-12.9 72.9 0l347 207.5c22.5 13.5 36.5 38.6 36.5 65.4V707c0 26.9-13.9 52-36.5 65.5l-347 207.3c-11.1 6.6-23.7 10.1-36.5 10.1l-.2.1z" />
<path d="M607.1 710c-141.3 0-183.8-69.1-183.8-129.7 0-5.8 4.5-10.3 10-10.3h44.9c5 0 9.2 3.7 10 8.8 6.7 47.3 36.6 68.1 118.8 68.1 73.1 0 103-22.6 103-62.7 0-23.2-7.6-40.3-121.2-51.8-95-9.7-153.8-31.4-153.8-110 0-72.5 59.1-114.8 158-114.8 100.9 0 167.3 30.6 173.2 111.2.2 2.9-.8 5.8-2.7 8-1.9 2.1-4.5 3.3-7.3 3.3h-45c-4.7 0-8.8-3.4-9.8-8.1-9.6-37.1-37.1-51.2-108.4-51.2-79.8 0-89.1 27.9-89.1 49.5 0 26.2 11 33.8 118.8 48.5C729.3 483.2 780 503.9 780 581.4c0 78.3-63.1 128.6-172.9 128.6z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

3
assets/phpstorm.svg Normal file
View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 256 256">
<defs><linearGradient id="IconifyId18e425c03bba7dc7a0" x1="40.196%" x2="55.577%" y1="64.058%" y2="47.965%"><stop offset="0%" stop-color="#AF1DF5"/><stop offset="21%" stop-color="#BC20E4"/><stop offset="63%" stop-color="#DD29B8"/><stop offset="100%" stop-color="#FF318C"/></linearGradient><linearGradient id="IconifyId18e425c03bba7dc7a1" x1="42.885%" x2="63.378%" y1="78.603%" y2="-4.057%"><stop offset="2%" stop-color="#6B57FF"/><stop offset="42%" stop-color="#B74AF7"/><stop offset="75%" stop-color="#FF318C"/></linearGradient><linearGradient id="IconifyId18e425c03bba7dc7a2" x1="73.258%" x2="32.049%" y1="102.209%" y2="-3.688%"><stop offset="0%" stop-color="#293896"/><stop offset="8%" stop-color="#3B3AA2"/><stop offset="29%" stop-color="#6740C0"/><stop offset="49%" stop-color="#8A44D8"/><stop offset="68%" stop-color="#A347E9"/><stop offset="86%" stop-color="#B249F3"/><stop offset="100%" stop-color="#B74AF7"/></linearGradient><linearGradient id="IconifyId18e425c03bba7dc7a3" x1="62.87%" x2="39.747%" y1="72.446%" y2="45.568%"><stop offset="2%" stop-color="#6B57FF"/><stop offset="78%" stop-color="#B74AF7"/></linearGradient></defs><path fill="url(#IconifyId18e425c03bba7dc7a0)" d="M141.307 45.013L132.773 19.2L43.68 0L0 49.413l48 24.56v-28.96z"/><path fill="url(#IconifyId18e425c03bba7dc7a1)" d="m48 61.813l-48-12.4l24.4 146.56l23.52-.186z"/><path fill="url(#IconifyId18e425c03bba7dc7a2)" d="M208 45.013h-83.493L158.053 15.2l64.64 12L256 109.973l-47.973 47.654z"/><path fill="url(#IconifyId18e425c03bba7dc7a3)" d="M208.053 108.88L208 205.013H70.56l3.547 20.907L160.4 256l95.6-57.227z"/><path d="M47 43.771h162v162H47z"/><path fill="#FFF" d="M67.947 175.093h60v10h-60zm52.32-58.133l7.813-9.6a27.573 27.573 0 0 0 17.973 7.307c5.334 0 8.694-2.16 8.694-5.68v-.16c0-1.364-.343-2.46-1.422-3.451l-.242-.211a7.3 7.3 0 0 0-.557-.414l-.315-.204a11.058 11.058 0 0 0-.522-.302l-.382-.2a15.25 15.25 0 0 0-.201-.1l-.425-.198a20.305 20.305 0 0 0-.454-.198l-.484-.199a27.087 27.087 0 0 0-.254-.1l-.531-.198a34.56 34.56 0 0 0-.278-.1l-.58-.201l-.303-.101l-.63-.203l-.667-.205l-.702-.208c-.12-.035-.242-.07-.365-.104l-.758-.212l-.795-.215l-2.44-.633l-.766-.205l-1.126-.31l-.368-.105l-.728-.212l-.714-.215a67.125 67.125 0 0 1-.351-.11l-.694-.222l-.68-.226a50.843 50.843 0 0 1-.334-.116l-.658-.235l-.643-.24a23.119 23.119 0 0 1-.316-.124l-.622-.251l-.606-.259c-6.286-2.757-10.049-6.826-10.165-14.88l-.002-.573c0-10.792 8.59-17.981 20.68-18.131l.386-.003a34.667 34.667 0 0 1 22.347 7.654l-6.88 9.973a28.107 28.107 0 0 0-15.653-5.92c-5.067 0-7.734 2.32-7.734 5.333v.187c0 2.23.852 3.644 3.457 4.932l.414.197c.143.066.29.131.443.196l.472.195l.502.195l.533.195l.563.196l.596.198l.629.199l.662.202l1.057.308l1.137.318l1.219.328l1.303.341c.287.075.572.151.853.228l.836.232c.275.078.548.157.817.237l.8.242c.131.04.262.082.392.123l.772.25l.754.256c.372.13.737.262 1.096.397l.707.273c7.675 3.042 11.938 7.422 12.063 15.448l.003.554c0 11.947-9.12 18.667-22.106 18.667a38.27 38.27 0 0 1-25.52-9.627M68 65.333h24.533c14.15 0 22.786 8.312 22.958 20.354l.002.526c0 13.867-10.8 21.067-24.24 21.067h-9.92v17.973H68zm23.627 30.214c6.586 0 10.453-3.92 10.453-9.067v-.16c0-5.92-4.107-9.093-10.667-9.093h-10.08v18.32z"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

1
assets/pinia.svg Normal file
View File

@@ -0,0 +1 @@
<svg viewBox="0 0 256 331" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em"><defs><linearGradient id="a" x1="55.342%" x2="42.817%" y1="0%" y2="42.863%"><stop offset="0%" stop-color="#52CE63"/><stop offset="100%" stop-color="#51A256"/></linearGradient><linearGradient id="b" x1="55.349%" x2="42.808%" y1="0%" y2="42.863%"><stop offset="0%" stop-color="#52CE63"/><stop offset="100%" stop-color="#51A256"/></linearGradient><linearGradient id="c" x1="50%" x2="50%" y1="0%" y2="58.811%"><stop offset="0%" stop-color="#8AE99C"/><stop offset="100%" stop-color="#52CE63"/></linearGradient><linearGradient id="d" x1="51.378%" x2="44.585%" y1="17.473%" y2="100%"><stop offset="0%" stop-color="#FFE56C"/><stop offset="100%" stop-color="#FFC63A"/></linearGradient></defs><path fill="url(#a)" d="M67.56 173.328c30.366-2.985 41.08-27.648 44.735-64.823 3.654-37.175-21.174-70.814-31.502-69.799-10.328 1.015-43.15 40.322-46.805 77.497-3.654 37.175 3.205 60.11 33.572 57.125Z" transform="rotate(-38 72.877 106.136)"/><path fill="url(#b)" d="M184.454 186.277c30.367 2.986 36.394-20.032 32.74-57.207-3.655-37.175-35.645-76.4-45.973-77.415-10.328-1.015-35.989 32.542-32.334 69.717 3.654 37.175 15.201 61.92 45.567 64.905Z" transform="rotate(52 178.34 119.085)"/><path fill="url(#c)" d="M129.232 151.601c27.341 0 34.878-26.184 34.878-67.013 0-40.83-25.579-80.843-34.878-80.843S93.605 43.758 93.605 84.588c0 40.829 8.286 67.013 35.627 67.013Z" transform="rotate(7 128.858 77.673)"/><path fill="url(#d)" d="M113.386 330.307c56.896 0 103.038-16.528 103.038-91.482 0-74.955-46.142-136.462-103.038-136.462-56.897 0-103.002 61.507-103.002 136.462 0 74.954 46.105 91.482 103.002 91.482Z"/><ellipse cx="165.427" cy="216.677" fill="#EAADCC" rx="14.717" ry="6.845"/><ellipse cx="57.273" cy="212.57" fill="#EAADCC" rx="14.717" ry="6.845" transform="rotate(7 57.273 212.57)"/><path d="M96.266 210.285a2.054 2.054 0 1 0-3.406 2.295c3.151 4.676 7.997 7.39 14.373 8.119 6.348.725 12.016-.902 16.877-4.852a2.054 2.054 0 1 0-2.59-3.187c-3.999 3.249-8.563 4.559-13.82 3.958-5.23-.598-8.986-2.7-11.434-6.333ZM65.818 178.63a14.672 14.672 0 0 1 10.551 3.945 14.67 14.67 0 0 1 4.672 10.25 14.671 14.671 0 0 1-3.945 10.55 14.672 14.672 0 0 1-10.25 4.672 14.67 14.67 0 0 1-10.551-3.945 14.672 14.672 0 0 1-4.67-10.25 14.67 14.67 0 0 1 3.944-10.55 14.67 14.67 0 0 1 10.249-4.672Z"/><path fill="#FFF" d="M66.59 190.932a4.792 4.792 0 1 0-9.578.336 4.792 4.792 0 0 0 9.579-.336Z"/><path d="M154.99 182.366a14.671 14.671 0 0 1 10.552 3.944 14.67 14.67 0 0 1 4.67 10.25 14.672 14.672 0 0 1-3.944 10.551 14.67 14.67 0 0 1-10.25 4.671 14.671 14.671 0 0 1-10.55-3.945 14.671 14.671 0 0 1-4.672-10.25 14.67 14.67 0 0 1 3.945-10.55 14.671 14.671 0 0 1 10.25-4.671Z"/><path fill="#FFF" d="M65.71 175.552c9.824-.343 18.066 7.342 18.409 17.165.343 9.824-7.342 18.065-17.166 18.408-9.824.343-18.064-7.342-18.407-17.166-.343-9.823 7.341-18.064 17.164-18.407Zm12.252 17.38c-.224-6.423-5.613-11.448-12.037-11.223-6.422.224-11.447 5.612-11.222 12.035.224 6.424 5.612 11.448 12.035 11.224 6.423-.224 11.448-5.612 11.224-12.036ZM154.883 179.287c9.824-.343 18.065 7.342 18.408 17.165.343 9.824-7.342 18.065-17.165 18.408-9.824.343-18.065-7.342-18.408-17.165-.343-9.824 7.342-18.065 17.165-18.408Zm12.251 17.38c-.224-6.423-5.612-11.447-12.036-11.223-6.423.224-11.448 5.613-11.223 12.036.224 6.423 5.612 11.448 12.035 11.224 6.424-.225 11.448-5.613 11.224-12.037Z"/><path fill="#FFF" d="M155.763 194.668a4.792 4.792 0 1 0-9.578.335 4.792 4.792 0 0 0 9.578-.335Z"/><path fill="#ECB732" d="m38.083 243.16 22.33 23.235 16.022-17.044a3.765 3.765 0 0 1 5.486 5.157l-16.283 17.324 23.1 24.036a3.765 3.765 0 1 1-5.43 5.218l-22.834-23.761-10.725 11.41a3.765 3.765 0 1 1-5.486-5.158l10.986-11.688-22.595-23.511a3.765 3.765 0 1 1 5.43-5.218ZM188.04 243.16a3.765 3.765 0 1 1 5.429 5.218l-22.596 23.511 10.988 11.688a3.765 3.765 0 0 1-.042 5.201l-.123.121a3.765 3.765 0 0 1-5.322-.165l-10.725-11.41-22.834 23.762a3.765 3.765 0 0 1-5.197.222l-.127-.116a3.765 3.765 0 0 1-.105-5.324l23.1-24.036-16.284-17.324a3.765 3.765 0 0 1 .042-5.2l.123-.121a3.765 3.765 0 0 1 5.321.164l16.021 17.044 22.331-23.235Z"/><path fill="#FFC73B" d="M136.602 126.74a3.765 3.765 0 0 1 0 5.323l-17.53 17.531 10.684 10.686a3.765 3.765 0 0 1 .12 5.2l-.12.125a3.765 3.765 0 0 1-5.324 0l-10.686-10.686-10.686 10.686a3.765 3.765 0 1 1-5.324-5.325l10.685-10.686-17.53-17.53a3.765 3.765 0 0 1-.12-5.2l.12-.125a3.765 3.765 0 0 1 5.324 0l17.531 17.53 17.531-17.53a3.765 3.765 0 0 1 5.325 0Z"/></svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

12
assets/pnpm.svg Normal file
View File

@@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 156 156">
<g fill="none" fill-rule="evenodd">
<polygon fill="#F9AD00" fill-rule="nonzero" points="155.808 48.684 107.027 48.684 107.027 -.097 155.808 -.097"/>
<polygon fill="#F9AD00" fill-rule="nonzero" points="102.139 48.684 53.358 48.684 53.358 -.097 102.139 -.097"/>
<polygon fill="#F9AD00" fill-rule="nonzero" points="48 48.684 0 48.684 0 -.097 48 -.097"/>
<polygon fill="#F9AD00" fill-rule="nonzero" points="155.808 102.344 107.027 102.344 107.027 53.562 155.808 53.562"/>
<polygon fill="#4E4E4E" fill-rule="nonzero" points="102.139 102.344 53.358 102.344 53.358 53.562 102.139 53.562"/>
<polygon fill="#4E4E4E" fill-rule="nonzero" points="102.139 156.003 53.358 156.003 53.358 107.222 102.139 107.222"/>
<polygon fill="#4E4E4E" fill-rule="nonzero" points="155.808 156.003 107.027 156.003 107.027 107.222 155.808 107.222"/>
<polygon fill="#4E4E4E" fill-rule="nonzero" points="48 156.003 0 156.003 0 107.222 48 107.222"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1015 B

1
assets/r.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4.29c-5.5 0-10 3-10 6.71c0 3.28 3.56 6 8.24 6.58v2.13h3.41v-2.12c.85-.09 1.64-.25 2.39-.48l1.38 2.6h3.86l-2.32-3.91C20.83 14.58 22 12.87 22 11c0-3.71-4.5-6.71-10-6.71m1.53 2.62c4.2 0 7.3 1.4 7.3 4.59c0 1.71-.92 2.91-2.42 3.65c-.09-.05-.17-.1-.22-.15c-.36-.16-.96-.34-.96-.34s2.98-.22 2.98-3.19c0-2.97-3.12-3.02-3.12-3.02h-6.85v7.16c-2.55-.74-4.31-2.31-4.31-4.11c0-2.54 3.4-4.59 7.6-4.59m.15 3.98h2.07s.95-.05.95.94c0 .97-.95.97-.95.97h-2.07zm-.03 4.41h.92c.18 0 .27.05.43.2c.13.1.27.29.39.46c-.55.07-1.13.1-1.74.1z"/></svg>

After

Width:  |  Height:  |  Size: 641 B

27
assets/rxjs.svg Normal file
View File

@@ -0,0 +1,27 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 255 255">
<defs>
<linearGradient id="a" x1="11.935%" x2="62.881%" y1="90.18%" y2="37.177%">
<stop offset="0%" stop-color="#E01D84"/>
<stop offset="40.1%" stop-color="#DF1D85"/>
<stop offset="77%" stop-color="#932C87"/>
<stop offset="100%" stop-color="#5D2F88"/></linearGradient>
<linearGradient id="c" x1="-.146%" x2="99.946%" y1="49.99%" y2="49.99%">
<stop offset="0%" stop-color="#E01D84"/>
<stop offset="23.8%" stop-color="#DA1E85"/>
<stop offset="65.8%" stop-color="#C72085"/>
<stop offset="99.9%" stop-color="#B52284"/></linearGradient>
<radialGradient id="b" cx="77.558%" cy="33.251%" r="77.293%" fx="77.558%" fy="33.251%" gradientTransform="matrix(.7343 .0024 -.00176 1 .207 -.002)">
<stop offset="0%" stop-color="#E01D84"/>
<stop offset="13.9%" stop-color="#DE1E85"/>
<stop offset="28.5%" stop-color="#D62085"/>
<stop offset="43.4%" stop-color="#C92386"/>
<stop offset="58.6%" stop-color="#B72786"/>
<stop offset="73.9%" stop-color="#9D2B87"/>
<stop offset="89.1%" stop-color="#7C2E88"/>
<stop offset="100%" stop-color="#5D2F88"/></radialGradient></defs>
<g fill="none" transform="translate(1 2)">
<path fill="#E32286" d="M14.6140689,158.580855 C9.41406892,142.380855 7.91406892,125.280855 10.9140689,107.680855 C12.2140689,100.380855 14.2140689,93.3808546 16.4140689,86.2808546 C16.4140689,86.2808546 30.2140689,40.9808546 76.9140689,20.2808546 C76.9140689,20.2808546 93.0140689,11.7808546 117.214069,11.1808546 C117.214069,11.1808546 113.914069,7.98085459 111.814069,6.58085459 C100.414069,-1.01914541 83.4140689,-3.51914541 73.1140689,7.18085459 C70.0140689,10.3808546 67.4140689,13.8808546 64.5140689,17.0808546 C61.2140689,20.6808546 57.2140689,23.6808546 52.6140689,25.3808546 C48.6140689,26.8808546 44.6140689,26.5808546 40.5140689,27.2808546 C36.3140689,27.9808546 32.0140689,29.4808546 28.6140689,32.1808546 C24.9140689,35.1808546 23.4140689,39.1808546 23.0140689,43.7808546 C22.6140689,47.3808546 22.7140689,51.0808546 22.5140689,54.6808546 C22.0140689,65.2808546 18.6140689,68.2808546 11.0140689,74.1808546 C7.81406892,76.5808546 5.11406892,79.7808546 3.11406892,83.1808546 C-2.88593108,93.7808546 6.71406892,104.780855 7.21406892,115.480855 C7.31406892,117.680855 7.11406892,119.880855 6.31406892,121.980855 C5.51406892,124.280855 3.91406892,125.780855 2.61406892,127.680855 C0.814068923,130.180855 -0.385931077,133.180855 0.114068923,136.280855 C0.614068923,139.380855 2.21406892,142.280855 3.71406892,144.980855 C6.61406892,149.780855 10.2140689,154.080855 14.0140689,158.180855 C14.2140689,158.180855 14.4140689,158.380855 14.6140689,158.580855"/>
<path fill="url(#a)" d="M205.414069,196.980855 C228.414069,186.980855 238.214069,169.680855 238.214069,169.680855 C259.714069,140.380855 252.414069,109.480855 252.414069,109.480855 C238.714069,139.280855 226.214069,147.480855 226.214069,147.480855 C259.914069,96.1808546 226.414069,65.1808546 226.414069,65.1808546 C240.114069,94.3808546 221.914069,129.980855 221.914069,129.980855 C206.614069,162.180855 184.914069,173.680855 184.914069,173.680855 C209.114069,178.180855 226.914069,161.880855 226.914069,161.880855 C192.214069,199.380855 154.614069,197.580855 154.614069,197.580855 C170.414069,215.280855 194.114069,213.780855 194.114069,213.780855 C163.114069,221.080855 134.014069,210.780855 110.114069,190.880855 C105.614069,187.180855 101.314069,183.180855 97.3140689,178.880855 C97.3140689,178.880855 93.7140689,175.080855 93.0140689,174.080855 L92.9140689,173.980855 C92.4140689,192.480855 111.714069,209.680855 111.714069,209.680855 C87.5140689,199.680855 76.4140689,177.980855 76.4140689,177.980855 C76.4140689,177.980855 60.1140689,150.180855 71.9140689,118.480855 C83.7140689,86.7808546 119.414069,79.9808546 119.414069,79.9808546 C148.914069,94.2808546 173.914069,98.7808546 173.914069,98.7808546 C226.614069,107.580855 223.614069,81.7808546 223.614069,81.7808546 C224.114069,59.5808546 190.614069,35.9808546 190.614069,35.9808546 C130.914069,-8.31914541 76.9140689,20.2808546 76.9140689,20.2808546 C30.2140689,40.9808546 16.4140689,86.2808546 16.4140689,86.2808546 C14.2140689,93.3808546 12.2140689,100.380855 10.9140689,107.680855 C5.81406892,137.380855 13.5140689,165.480855 30.2140689,190.480855 C56.2140689,229.280855 98.4140689,242.680855 98.4140689,242.680855 C160.914069,263.880855 203.614069,232.680855 203.614069,232.680855 C242.914069,205.680855 250.814069,174.480855 250.814069,174.480855 C219.114069,199.280855 205.414069,196.980855 205.414069,196.980855 Z M156.614069,51.0808546 C159.614069,51.0808546 162.014069,53.4808546 162.014069,56.4808546 C162.014069,59.4808546 159.614069,61.8808546 156.614069,61.8808546 C153.614069,61.8808546 151.214069,59.4808546 151.214069,56.4808546 C151.214069,53.4808546 153.614069,51.0808546 156.614069,51.0808546 Z"/>
<path fill="url(#b)" d="M223.514069,81.6808546 C224.014069,59.4808546 190.514069,35.8808546 190.514069,35.8808546 C130.814069,-8.31914541 76.8140689,20.2808546 76.8140689,20.2808546 C30.1140689,40.9808546 16.3140689,86.2808546 16.3140689,86.2808546 C13.6140689,93.9808546 11.2140689,105.780855 11.2140689,105.780855 C8.31406892,120.580855 9.61406892,134.280855 9.61406892,134.280855 C10.8140689,147.380855 13.7140689,156.180855 13.7140689,156.180855 C16.7140689,165.580855 18.1140689,168.480855 18.1140689,168.480855 C18.0140689,168.180855 17.5140689,165.980855 17.5140689,165.980855 C17.5140689,165.980855 13.3140689,145.780855 17.2140689,126.380855 C17.2140689,126.380855 20.6140689,106.180855 34.4140689,90.5808546 C34.4140689,90.5808546 56.8140689,58.6808546 98.5140689,71.1808546 C98.5140689,71.1808546 107.514069,74.3808546 110.614069,75.9808546 C113.714069,77.4808546 119.114069,79.7808546 119.114069,79.7808546 C148.614069,94.0808546 173.614069,98.5808546 173.614069,98.5808546 C226.514069,107.480855 223.514069,81.6808546 223.514069,81.6808546 L223.514069,81.6808546 Z M156.614069,61.9808546 C153.614069,61.9808546 151.214069,59.5808546 151.214069,56.5808546 C151.214069,53.5808546 153.614069,51.1808546 156.614069,51.1808546 C159.614069,51.1808546 162.014069,53.5808546 162.014069,56.5808546 C162.014069,59.5808546 159.614069,61.9808546 156.614069,61.9808546 Z"/>
<path fill="url(#c)" d="M122.414069,41.4808546 L88.3140689,30.8808546 C88.1140689,30.8808546 87.1140689,30.3808546 85.3140689,30.8808546 C85.3140689,30.8808546 65.2140689,35.9808546 68.7140689,46.9808546 C68.7140689,46.9808546 70.8140689,53.8808546 76.5140689,60.5808546 L114.014069,58.7808546 L122.414069,41.4808546 Z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

3
assets/springboot.svg Normal file
View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" height="1em" width="1em">
<path d="M20.205 16.392c-2.469 3.289-7.741 2.179-11.122 2.338 0 0-.599.034-1.201.133 0 0 .228-.097.519-.198 2.374-.821 3.496-.986 4.939-1.727 2.71-1.388 5.408-4.413 5.957-7.555-1.032 3.022-4.17 5.623-7.027 6.679-1.955.722-5.492 1.424-5.493 1.424a5.28 5.28 0 0 1-.143-.076c-2.405-1.17-2.475-6.38 1.894-8.059 1.916-.736 3.747-.332 5.818-.825 2.208-.525 4.766-2.18 5.805-4.344 1.165 3.458 2.565 8.866.054 12.21zm.042-13.28a9.212 9.212 0 0 1-1.065 1.89 9.982 9.982 0 0 0-7.167-3.031C6.492 1.971 2 6.463 2 11.985a9.983 9.983 0 0 0 3.205 7.334l.22.194a.856.856 0 1 1 .001.001l.149.132A9.96 9.96 0 0 0 12.015 22c5.278 0 9.613-4.108 9.984-9.292.274-2.539-.476-5.763-1.752-9.596" />
</svg>

After

Width:  |  Height:  |  Size: 790 B

1
assets/stylex.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 151 180"><g fill="none"><path fill="#5BD3F3" d="M123.054863 93.4254443C124.041858 95.7626109 128.450105 105.044084 129.355779 107.321152 123.84289 116.561307 122.549601 118.95899 111.024753 133.60593 64.1232983 182.705627 27.9371992 190.639891 5.76263041 167.701852 3.59627766 165.361764 1.67512566 162.319274 0 158.574382.471825684 159.433291 1.09514745 160.379843 1.86996531 161.414039L2.15025371 161.78256C2.19772524 161.844746 2.24602235 161.906931 2.29473227 161.969534L2.59359648 162.349323 2.90484457 162.735791 3.22888933 163.12977 3.56531797 163.530845 3.91454328 163.939431 4.27615246 164.355113 4.65014553 164.77789 5.03734806 165.208179 5.23549007 165.426036 5.64126842 165.867176 5.84890474 166.090459 6.2732589 166.542451 6.49038953 166.771159C33.8818726 191.84228 61.2048315 170.332834 98.3027967 128.773838 103.902786 122.190123 112.153337 110.407464 123.054863 93.4254443ZM137.380118 14.1032604C154.739423 29.1884191 154.739423 52.5968124 141.717364 86.0295639 140.719637 83.5713654 136.323774 73.7444144 135.221609 71.226952 145.472981 42.8320467 145.710752 29.3332399 130.967334 15.8715774 122.485617 8.12762615 116.462513 7.80876984 104.995043 9.69477985L104.244168 9.82123726C104.118678 9.84252217 103.992775 9.86464178 103.866872 9.8867614L103.107328 10.0236526 102.342004 10.1663867 101.956866 10.2402579 92.9145722 12.0507273 92.9145722 12.0340333 93.1139526 11.9605794C111.260459 5.27670019 126.843916 4.74249067 137.380118 14.1032604L137.380118 14.1032604Z"/><path fill="#D573DE" d="M125.890167,63.5141248 C153.449324,115.583313 155.188797,143.75817 146.009025,163.468062 C142.702042,170.570383 134.455253,175.478804 130.907687,177.387749 C122.003636,182.178957 103.568032,179.793293 87.0876824,174.955283 L84.6173661,173.901615 C92.8984649,176.570162 110.89548,180.056296 120.598168,177.387749 C152.463016,168.623747 148.671973,130.669324 116.64467,71.0621007 C84.6173661,11.4548774 49.5757474,-4.8960329 21.9537585,6.3426811 C19.3015581,7.42161421 16.9891503,8.8960871 15,10.7226111 L15.212887,10.4952275 L15.6399012,10.0462588 L15.853615,9.82508786 L16.282696,9.38854448 C19.3635641,6.29215141 22.5576963,3.87542408 25.8493845,2.76294257 C50.8282672,-5.6788289 93.7099159,2.71324123 125.890167,63.5141248 Z"/></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

6
assets/tauri.svg Normal file
View File

@@ -0,0 +1,6 @@
<svg viewBox="0 0 256 289" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" height="1em" width="1em">
<path d="M178.497 104.93c0 15.155-12.285 27.44-27.44 27.44-15.153 0-27.438-12.285-27.438-27.44 0-15.153 12.285-27.438 27.439-27.438s27.439 12.285 27.439 27.439Z" fill="#FFC131"/>
<circle fill="#24C8DB" transform="rotate(180 104.91 183.505)" cx="104.911" cy="183.505" r="27.439"/>
<path d="M207.93 192.86a104.766 104.766 0 0 1-36.168 14.717 73.586 73.586 0 0 0 3.617-33.176c29.953-10.472 49.82-38.964 49.292-70.69-.53-31.727-21.336-59.542-51.622-69.008-30.286-9.467-63.23 1.546-81.733 27.324a122.227 122.227 0 0 0-40.16 11.723C64.86 29.536 105.956-.445 152.244.005c46.288.45 86.794 31.224 99.636 75.697 12.841 44.473-5.026 92.103-43.95 117.157ZM52.404 92.832l25.693 3.118a73.586 73.586 0 0 1 3.243-14.593 104.766 104.766 0 0 0-28.936 11.475Z" fill="#FFC131"/>
<path d="M47.913 95.577a104.766 104.766 0 0 1 36.419-14.842 73.46 73.46 0 0 0-4.116 33.3c-29.847 10.619-49.549 39.148-48.906 70.822.642 31.673 21.484 59.38 51.738 68.78 30.253 9.399 63.127-1.62 81.604-27.352a122.227 122.227 0 0 0 40.16-11.6c-13.736 44.169-54.812 74.1-101.064 73.645-46.252-.453-86.733-31.184-99.602-75.612-12.87-44.427 4.92-92.037 43.768-117.141Zm155.528 100.026-.5.25.5-.25Z" fill="#24C8DB"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

3
assets/twitter.svg Normal file
View File

@@ -0,0 +1,3 @@
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
<path d="M283.02655555 307.55600001c140.717 72.074 260.839 66.925 260.839 66.92499999s-44.617-157.87599999 94.384-228.234c138.998-70.359 236.816 48.048 236.816 48.048s24.025-6.863 42.901-13.728 44.617-18.87599999 44.61700001-18.876l-42.90100001 77.222 66.92500001-6.863s-8.579 12.014-34.31900001 36.038c-25.741 24.025-37.754 37.754-37.754 37.754s10.297 190.483-90.95 338.062c-99.53 147.58000001-229.952 235.099-417.002 253.973-187.05 18.87599999-310.606-58.347-310.606-58.347s82.37-5.149 133.852-24.025c51.483-20.592 126.99-73.79 126.99-73.79s-106.397-32.605-145.866-70.35899999-48.048-60.062-48.048-60.06200001l106.397-1.716s-111.542-60.062-142.433-106.397c-30.89-46.333-36.038-92.666-36.038-92.666l80.656 32.605s-66.925-92.666-77.222-163.025c-10.297-72.074 12.014-109.826 12.014-109.826s36.038 65.21 176.752 137.283z"></path>
</svg>

After

Width:  |  Height:  |  Size: 944 B

View File

@@ -105,17 +105,17 @@ $ adb pull /sdcard/test.txt pulledTest.txt
`adb shell wm size WxH` | 将分辨率设置为 WxH
`adb shell pm list packages` | 列出所有已安装的应用包
`adb shell pm list packages -3` | 列出所有已安装的第三方的应用包
`adb shell monkey -p app.package.name` | 启动指定包名的应用程序
`adb shell monkey -p app.package.name <count>` | 启动指定包名的应用程序, 并执行测试
<!--rehype:className=style-list-arrow-->
### 包安装
:-- | --
:-- | --
`adb shell install <apk>` | 安装应用程序
`adb shell install <path>` | 从手机路径安装应用
`adb shell install -r <path>` | 从手机路径安装应用(允许覆盖安装)
`adb shell uninstall <name>` | 卸载应用程序
`adb install <apk>` | 安装应用程序
`adb install <path>` | 从手机路径安装应用
`adb install -r <path>` | 从手机路径安装应用(允许覆盖安装)
`adb uninstall <name>` | 卸载应用程序
<!--rehype:className=left-align code-nowrap-->
### Paths
@@ -127,10 +127,10 @@ $ adb pull /sdcard/test.txt pulledTest.txt
`/data/data/<package>/shared_prefs/` | 共享偏好设置
`/data/app` | 用户安装的 APK
`/system/app` | 系统预装的 APK 文件
`/mmt/asec` | 加密的应用程序App2SD
`/mmt/emmc` | 内部 SD 卡
`/mmt/adcard` | 外部/内部 SD 卡
`/mmt/adcard/external_sd` | 外置 SD 卡
`/mnt/asec` | 加密的应用程序App2SD
`/mnt/emmc` | 内部 SD 卡
`/mnt/sdcard` | 外部/内部 SD 卡
`/mnt/sdcard/external_sd` | 外置 SD 卡
<!--rehype:className=style-list-arrow-->
---
@@ -165,14 +165,17 @@ $ adb pull /sdcard/test.txt pulledTest.txt
:-- | --
:-- | --
`adb shell list packages` | 列出包名称
`adb shell list packages -r` | 列出包名 + apks 的路径
`adb shell list packages -3` | 列出第三方包名称
`adb shell list packages -s` | 仅列出系统包
`adb shell list packages -u` | 列出包名称 + 已卸载
`adb shell pm list packages` | 列出包名称
`adb shell pm list packages -f` | 列出包名 + apks 的路径
`adb shell pm list packages -3` | 列出第三方包名称
`adb shell pm list packages -s` | 仅列出系统包
`adb shell pm list packages -u` | 列出出包和未安装包
`adb shell pm list packages -i` | 列出包名称 + 安装来源
`adb shell pm list packages -e` | 列出启用的包
`adb shell pm list packages -d` | 列出禁用的包
`adb shell dumpsys package packages` | 列出所有应用程序的信息
`adb shell dump <name>` | 列出一个包的信息
`adb shell path <package>` | 列出 APK 文件的路径
`adb shell dumpsys package <name>` | 列出一个包的信息
`adb shell pm path <package>` | 列出 APK 文件的路径
<!--rehype:className=style-list-arrow-->
### 设备相关命令
@@ -232,13 +235,13 @@ $ adb pull /sdcard/Download/example.apk
### 从主机安装 APK 到 Android 设备
```bash
$ adb shell install example.apk
$ adb install example.apk
```
### 从 Android 设备存储安装 APK
```bash
$ adb shell install /sdcard/Download/example.apk
$ adb install /sdcard/Download/example.apk
```
### 设置网络代理
@@ -330,7 +333,7 @@ $ adb shell pm path com.example.myapp
### 通过名称查找应用的包名
```bash
$ adb shell pm list package | grep app_name
$ adb shell pm list packages | grep app_name
```
### 从设备提取 APK 到您的计算机

View File

@@ -140,7 +140,7 @@ $ ansible target -m copy -a "src=/tmp/seq dest=/tmp/seq"
### Ansible 命令帮助
<!--rehype:wrap-class=col-span-2 row-span-3-->
```bash
```shell
$ ansible
$ ansible <host-pattern> [options]
```
@@ -171,6 +171,7 @@ $ ansible <host-pattern> [options]
`--vault-password-file=VAULT_PASSWORD_FILE` | 保险库密码文件
`-v`, `--verbose` | 详细模式(-vvv 更多,-vvvv 启用连接调试)
`--version` | 显示程序的版本号并退出
<!--rehype:className=left-align-->
控制谁以及如何连接到主机,连接选项:
@@ -182,24 +183,26 @@ $ ansible <host-pattern> [options]
`-c CONNECTION`, `--connection=CONNECTION` | 要使用的连接类型 (default=smart)
`-T TIMEOUT`, `--timeout=TIMEOUT` | 以秒为单位覆盖连接超时 (default=10)
`--ssh-common-args=SSH_COMMON_ARGS` | 指定要传递给 sftp/scp/ssh 的常用参数 (e.g. ProxyCommand)
`--sftp-extra-args=SFTP_EXTRA_ARGS` | 指定仅传递给 sftp 的额外参数 (e.g. -f, -l)
`--sftp-extra-args=SFTP_EXTRA_ARGS` | 指定仅传递给 `sftp` 的额外参数 (e.g. -f, -l)
`--scp-extra-args=SCP_EXTRA_ARGS` | 指定仅传递给 `scp` 的额外参数 (e.g. -l)
`--ssh-extra-args=SSH_EXTRA_ARGS` | 指定仅传递给 `ssh` 的额外参数 (e.g. -R)
<!--rehype:className=left-align-->
控制您成为目标主机上的用户的方式和用户,特权升级选项:
:- | -
:- | -
`-s`, `--sudo` | 使用 sudo (nopasswd) 运行操作(已弃用,使用 become)
`-U SUDO_USER`, `--sudo-user=SUDO_USER` | 所需的 sudo 用户(默认=root)(已弃用,使用 become)
`-S`, `--su` | 使用 su 运行操作(已弃用,使用 become)
`-R SU_USER`, `--su-user=SU_USER` | 以该用户身份使用 su 运行操作(默认 = root)(已弃用,使用 become)
~~`-s`~~, ~~`--sudo`~~ | 使用 sudo (nopasswd) 运行操作(已弃用,使用 become)
~~`-U SUDO_USER`~~, ~~`--sudo-user=SUDO_USER`~~ | 所需的 sudo 用户(默认=root)(已弃用,使用 become)
~~`-S`~~, ~~`--su`~~ | 使用 su 运行操作(已弃用,使用 become)
~~`-R SU_USER`~~, ~~`--su-user=SU_USER`~~ | 以该用户身份使用 su 运行操作(默认 = root)(已弃用,使用 become)
`-b`, `--become` | 使用 become 运行操作(不暗示密码提示)
`--become-method=BECOME_METHOD` | 要使用的权限提升方法(默认=sudo),有效选择:[ sudo | su | pbrun | pfexec | runas | doas | dzdo ]
`--become-method=BECOME_METHOD` | 要使用的权限提升方法(默认=sudo),有效选择:\[ `sudo` \| `su` \| `pbrun` \| `pfexec` \| `runas` \| `doas` \| `dzdo` \]
`--become-user=BECOME_USER` | 以该用户身份运行操作(默认=root)
`--ask-sudo-pass` | 询问 sudo 密码(已弃用,使用 become)
`--ask-su-pass` | 询问 su 密码(已弃用,使用 become)
~~`--ask-sudo-pass`~~ | 询问 sudo 密码(已弃用,使用 become)
~~`--ask-su-pass`~~ | 询问 su 密码(已弃用,使用 become)
`-K`, `--ask-become-pass` | 要求提权密码
<!--rehype:className=left-align-->
### Ansible Galaxy 工具
@@ -409,6 +412,38 @@ $ ansible-pull -U <repository> [options]
<!-- ### ansible-playbook -->
<!-- todo -->
### ansible常用模块
<!--rehype:wrap-class=col-span-3 -->
`Ansible` 的模块已经高达 `3000+` 之多。但是个人在日常工作中,比较常见的大约 `20` 多个
```bash
$ ansible-doc --list #查询所有模块
$ ansible <host-pattern> [options] # 标准使用方式
```
---
| :- | - | - |
| ---------------- | ------------------------------------------------ | ------------------------------------------------------------ |
| ping | 检查指定节点机器是否还能连通 | `ansible all -m ping` |
| command | 用于在各受控端节点运行指定的命令 | `ansible all -m command -a 'hostname'` |
| shell | shell模块可以特殊字符而command是不支持 | `ansible all -m shell -a 'hostname && date'` |
| hostname | 修改远程受控节点的主机名的模块 | `ansible -i /opt/hosts xx -m hostname -a 'name=ansible-client-199'` |
| copy | 在远程主机执行复制操作文件 | `ansible all -m copy -a 'src=/etc/hosts dest=/opt/hosts backup=yes'` |
| fetch | 从远程主机获取文件到管理节点,但是不支持目录操作 | `ansible all -m fetch -a "src=/etc/yum.repos.d/epel.repo dest=/usr/local/src"` |
| script | 管理端一个脚本,然后在远程服务器上执行 | `ansible all -m script -a '/root/time.sh'` |
| file | 主要用于远程主机上的文件和目录操作 | `ansible all -m file -a "path=/root/rsync.password mode=600 state=touch"` |
| cron | 管理执行任务计划模块(增删改查) | `ansible all -m cron -a "name='test a job' user=root job='/bin/sh /server/scripts/test.sh' minute=* hour=* day=* month=* weekday=*"` |
| yum | RedHat和CentOS的软件包安装和管理 | 安装<br />`ansible all -m yum -a "name=httpd state=present"`<br/>`ansible all -m yum -a "name=httpd state=installed"`<br />卸载<br />`ansible all -m yum -a "name=httpd state=absent"`<br/>`ansible all -m yum -a "name=httpd state=removed"` |
| `service``systemd` | 用于管理远程主机的服务 | `ansible all -m systemd -a "name=httpd state=started enabled=yes"`<br />`ansible all -m systemd -a "name=httpd state=restarted"` |
| user | useradd, userdel, usermod | `ansible all -m user -a 'name=haha remove=no state=absent'` |
| group | groupadd, groupdel, groupmod | `ansible all -m group -a 'name=mygroup state=absent'` |
| setup | 可收集远程主机的facts变量的信息 | `ansible all -m setup -a 'filter=ansible_default_ipv4'` |
| authorized_key | 为特定的用户账号添加或删除 SSH authorized keys | `ansible all -m authorized_key -a "user=root key='{{lookup('file','/root/.ssh/id_rsa.pub')}}' path=/root/.ssh/authorized_keys manage_dir=no"` |
| replace | 和 sed 命令比较类似,用于正则匹配和替换 | `ansible all -m replace -a "path=/etc/fstab regexp=^(UUID.*) replace='#\1'"` |
| lineinfile | 正则匹配,更改某个关键参数值 | `ansible all -m lineinfile -a "path=/etc/selinux/config regexp='^SELINUX=' line='SELINUX=disabled'"` |
<!--rehype:className=left-align-->
另见
---

View File

@@ -61,6 +61,7 @@ bash 注释
`$@` | 所有参数,从第一个开始
`$-` | 当前选项
`$_` | 上一个命令的最后一个参数
<!--rehype:className=left-align-->
见:[特殊参数](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables)
@@ -152,6 +153,7 @@ Bash 参数扩展
`${FOO:=val}` | 如果未设置,则将 `$FOO` 设置为 `val`
`${FOO:+val}` | `val` 如果设置了`$FOO`
`${FOO:?message}` | 如果 `$FOO` 未设置,则显示消息并退出
<!--rehype:className=code-nowrap left-align-->
### 替代 Substitution
@@ -195,15 +197,21 @@ echo ${name:0:length} # => Jo
SRC="/path/to/foo.cpp"
```
---
```bash
BASEPATH=${SRC##*/}
echo $BASEPATH # => "foo.cpp"
```
---
```bash
DIRPATH=${SRC%$BASEPATH}
echo $DIRPATH # => "/path/to/"
```
### Transform
### 转换
```bash
STR="HELLO WORLD!"
@@ -265,7 +273,7 @@ for e in "${Fruits[@]}"; do
done
```
#### With index
#### 有索引
```bash
for i in "${!Fruits[@]}"; do
@@ -348,12 +356,12 @@ Bash 条件句
条件 | 描述
:- | -
`[[ NUM -eq NUM ]]` | 等于 <yel>Eq</yel>ual |
`[[ NUM -ne NUM ]]` | 不等于 <yel>N</yel>ot <yel>e</yel>qual |
`[[ NUM -lt NUM ]]` | 小于 <yel>L</yel>ess <yel>t</yel>han |
`[[ NUM -le NUM ]]` | 小于等于 <yel>L</yel>ess than or <yel>e</yel>qual |
`[[ NUM -gt NUM ]]` | 大于 <yel>G</yel>reater <yel>t</yel>han |
`[[ NUM -ge NUM ]]` | 大于等于 <yel>G</yel>reater than or <yel>e</yel>qual |
`[[ NUM -eq NUM ]]` | 等于 <yel>Eq</yel>ual
`[[ NUM -ne NUM ]]` | 不等于 <yel>N</yel>ot <yel>e</yel>qual
`[[ NUM -lt NUM ]]` | 小于 <yel>L</yel>ess <yel>t</yel>han
`[[ NUM -le NUM ]]` | 小于等于 <yel>L</yel>ess than or <yel>e</yel>qual
`[[ NUM -gt NUM ]]` | 大于 <yel>G</yel>reater <yel>t</yel>han
`[[ NUM -ge NUM ]]` | 大于等于 <yel>G</yel>reater than or <yel>e</yel>qual
`(( NUM < NUM ))` | 小于
`(( NUM <= NUM ))` | 小于或等于
`(( NUM > NUM ))` | 比...更大
@@ -448,10 +456,10 @@ fi
条件 | 描述
:- | -
`[[ -o noclobber ]]` | 如果启用 OPTION
`[[ ! EXPR ]]` | 不是 Not
`[[ X && Y ]]` | 和 And
`[[ X \|\| Y ]]` | 或者 Or
`[[ -o noclobber ]]` | 如果启用 <pur>OPTION</pur>
`[[ ! EXPR ]]` | 不是 <pur>Not</pur>
`[[ X && Y ]]` | 和 <pur>And</pur>
`[[ X \|\| Y ]]` | 或者 <pur>Or</pur>
### 逻辑和,或
@@ -536,10 +544,10 @@ done
```bash
for number in $(seq 1 3); do
if [[ $number == 2 ]]; then
# Skip entire rest of loop.
# 跳过整个循环的其余部分。
break;
fi
# This will only print 1
# 这只会打印 1
echo "$number"
done
```
@@ -558,7 +566,7 @@ done
```bash
while true; do
# here is some code.
# 下面是一些代码
done
```
@@ -566,7 +574,7 @@ done
```bash
while :; do
# here is some code.
# 下面是一些代码
done
```
@@ -589,8 +597,9 @@ myfunc() {
}
```
同上(替代语法)
```bash
# 同上(替代语法)
function myfunc() {
echo "hello $1"
}
@@ -635,42 +644,61 @@ Bash 选项
### 选项
避免覆盖文件
```bash
# 避免覆盖文件
# (echo "hi" > foo)
set -o noclobber
```
# 用于出错时退出
# 避免级联错误
用于出错时退出,避免级联错误
```bash
set -o errexit
```
# 揭示隐藏的失败
揭示隐藏的失败
```bash
set -o pipefail
```
# 公开未设置的变量
公开未设置的变量
```bash
set -o nounset
```
### 全局选项
不匹配的 glob 被删除
```bash
# 不匹配的 glob 被删除
# ('*.foo' => '')
shopt -s nullglob
shopt -s nullglob # ('*.foo' => '')
```
# 不匹配的 glob 抛出错误
不匹配的 glob 抛出错误
```bash
shopt -s failglob
```
# 不区分大小写的球体
不区分大小写的球体
```bash
shopt -s nocaseglob
```
# 通配符匹配点文件
# ("*.sh" => ".foo.sh")
shopt -s dotglob
通配符匹配点文件
# 允许 ** 进行递归匹配
# ('lib/**/*.rb' => 'lib/a/b/c.rb')
shopt -s globstar
```bash
shopt -s dotglob # ("*.sh" => ".foo.sh")
```
允许 ** 进行递归匹配
```bash
shopt -s globstar # ('lib/**/*.rb' => 'lib/a/b/c.rb')
```
Bash 历史
@@ -682,8 +710,9 @@ Bash 历史
命令 | 描述
:- | -
`history` | 显示历史
`sudo !!` | 使用 sudo 运行上一个命令
`sudo !!` | 使用 `sudo` 运行上一个命令
`shopt -s histverify` | 不要立即执行扩展结果
<!--rehype:className=left-align-->
### 表达式
@@ -694,6 +723,7 @@ Bash 历史
`!-n` | 展开第 `n` 个最近的命令
`!n` | 展开历史中的第 `n` 个命令
`!<command>` | 展开最近调用的命令 `<command>`
<!--rehype:className=left-align-->
### 操作
@@ -704,6 +734,7 @@ Bash 历史
`!!:gs/<FROM>/<TO>/` | 在最近的命令中将所有出现的 `<FROM>` 替换为 `<TO>`
`!$:t` | 仅从最近命令的最后一个参数扩展基本名称
`!$:h` | 仅从最近命令的最后一个参数展开目录
<!--rehype:className=left-align-->
`!!` 和 `!$` 可以替换为任何有效的扩展。
@@ -716,34 +747,35 @@ Bash 历史
`!$` | 从最近的命令中展开最后一个标记
`!!:n-m` | 从最近的命令扩展令牌范围
`!!:n-$` | 从最近的命令中将第 `n` 个标记展开到最后
<!--rehype:className=left-align-->
`!!` 可以替换为任何有效的扩展,即 `!cat`、`!-2`、`!42` 等。
杂项
-------------
---
### 数值计算
```bash
$((a + 200)) # Add 200 to $a
$((a + 200)) # $a 加 200
```
```bash
$(($RANDOM%200)) # Random number 0..199
$(($RANDOM%200)) # 随机数 0..199
```
### 子 shell
```bash
(cd somedir; echo "I'm now in $PWD")
pwd # still in first directory
pwd # 仍然在第一个目录
```
### 检查命令
```bash
command -V cd
#=> "cd is a function/alias/whatever"
#=> "cd 是一个函数/别名/其他"
```
### 重定向
@@ -964,11 +996,11 @@ END
### 转到上一个目录
```bash
pwd # /home/user/foo
pwd # /home/user/foo
cd bar/
pwd # /home/user/foo/bar
pwd # /home/user/foo/bar
cd -
pwd # /home/user/foo
pwd # /home/user/foo
```
### 读取输入
@@ -1020,7 +1052,7 @@ echo "${args[@]}"
$ bash -x myscript.sh
```
在bash脚本中打开调试(针对部分内容打印调试信息)
bash 脚本中打开调试(针对部分内容打印调试信息)
```bash
#!/bin/bash
@@ -1037,10 +1069,6 @@ Bash 颜色
您可以通过为其输出着色来使您的 BASH 脚本更漂亮,使用以下模板编写彩色文本:
```bash
echo -e "\e[COLORm文字变色了\e[0m"
```
#### 示例
```bash
@@ -1098,35 +1126,36 @@ m # 设置图形模式
`5` | 缓慢闪烁
`6` | 快速闪烁
`7` | 反显
`8` | 隐藏 | 未广泛支持
`8` | 隐藏 | 未广泛支持
`9` | 划除
<!--rehype:className=left-align-->
### ANSI — 颜色转义码
颜色 | 前景色 | 背景色 | 示例
:- | -- | -- | --
`Black` 黑色 | 30 | 40 | ``<!--rehype:style=background:#000;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Red` 红色 | 31 | 41 | ``<!--rehype:style=background:#c23621;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Green` 绿色 | 32 | 42 | ``<!--rehype:style=background:#25bc26;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Yellow` 黄色 | 33 | 43 | ``<!--rehype:style=background:#cdcd00;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Blue` 蓝色 | 34 | 44 | ``<!--rehype:style=background:#0000ee;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Purple` 紫色 | 35 | 45 | ``<!--rehype:style=background:#cd00cd;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Cyan` 青色 | 36 | 46 | ``<!--rehype:style=background:#00AAAA;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`White` 白色 | 37 | 47 | ``<!--rehype:style=background:#e5e5e5;padding:0.2rem 1.2rem;border: 1px solid #333;-->
颜色 | 名称 | 前景色 | 背景色 | 示例
:- | --| -- | -- | --
`Black` | 黑色 | 30 | 40 | `黑`<!--rehype:style=background:#000;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Red` | 红色 | 31 | 41 | `红`<!--rehype:style=background:#c23621;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Green` | 绿色 | 32 | 42 | `绿`<!--rehype:style=background:#25bc26;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Yellow` | 黄色 | 33 | 43 | `黄`<!--rehype:style=background:#cdcd00;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Blue` | 蓝色 | 34 | 44 | `蓝`<!--rehype:style=background:#0000ee;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Purple` | 紫色 | 35 | 45 | `紫`<!--rehype:style=background:#cd00cd;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Cyan` | 青色 | 36 | 46 | `青`<!--rehype:style=background:#00AAAA;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`White` | 白色 | 37 | 47 | `白`<!--rehype:style=background:#e5e5e5;padding:0.2rem 1.2rem;border: 1px solid #333;-->
<!--rehype:className=show-header left-align-->
### ANSI — 颜色转义码(亮色)
颜色 | 前色 | 背色 | 示例
颜色 | 前色 | 背色 | 示例
:- | -- | -- | --
`Bright Black(Gray)` 灰色 | 90 | 100 | ``<!--rehype:style=background:#555555;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Red` 亮红色 | 91 | 101 | ``<!--rehype:style=background:#FF5555;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Green` 亮绿色 | 92 | 102 | ``<!--rehype:style=background:#55FF55;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Yellow` 亮黄色 | 93 | 103 | ``<!--rehype:style=background:#FFFF55;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Blue` 亮蓝色 | 94 | 104 | ``<!--rehype:style=background:#5555FF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Magenta` 亮紫色 | 95 | 105 | ``<!--rehype:style=background:#FF55FF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Cyan` 亮青色 | 96 | 106 | ``<!--rehype:style=background:#55FFFF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright White` 浅灰 | 97 | 107 | ``<!--rehype:style=background:#ffffff;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`BrightBlack(Gray)` 灰色 | 90 | 100 | `90`<!--rehype:style=background:#555555;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Red` 亮红色 | 91 | 101 | `91`<!--rehype:style=background:#FF5555;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Green` 亮绿色 | 92 | 102 | `92`<!--rehype:style=background:#55FF55;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Yellow` 亮黄色 | 93 | 103 | `93`<!--rehype:style=background:#FFFF55;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Blue` 亮蓝色 | 94 | 104 | `94`<!--rehype:style=background:#5555FF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Magenta` 亮紫色 | 95 | 105 | `95`<!--rehype:style=background:#FF55FF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright Cyan` 亮青色 | 96 | 106 | `96`<!--rehype:style=background:#55FFFF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
`Bright White` 浅灰 | 97 | 107 | `97`<!--rehype:style=background:#ffffff;padding:0.2rem 1.2rem;border: 1px solid #333;-->
<!--rehype:className=show-header left-align-->
### 可用功能
@@ -1153,6 +1182,7 @@ m # 设置图形模式
`6n` | DSR 设备状态报告 | 以 `ESC[n;mR` (就像在键盘上输入)向应用程序报告光标位置(CPR),其中 `n`是行, `m` 是列
`s` | SCP 保存光标位置 | 保存光标的当前位置
`u` | RCP 恢复光标位置 | 恢复保存的光标位置
<!--rehype:className=left-align-->
另见
----

262
docs/bun.md Normal file
View File

@@ -0,0 +1,262 @@
Bun 备忘清单
===
这是一份 [`Bun`](https://bun.sh/) 软件包管理器备忘单,其中列出了 `Bun` 常用命令使用清单
入门
---
### 安装 Bun
```bash
curl -fsSL https://bun.sh/install | bash
```
### Bun 与 npm/Yarn 命令比较
<!--rehype:wrap-class=col-span-2 row-span-3-->
npm | Yarn | Bun | 说明
:- | :- | :- | :-
`npm install` | `yarn add` | `bun add` | 安装依赖
`npm init` | `yarn init` | `bun init` | 创建 `package.json` 文件
`npm install -g` | `yarn global add` | `bun global add` | 全局安装包
`npm run` | `yarn run` | `bun run` | 运行脚本
`npm uninstall` | `yarn remove` | `bun remove` | 移除包
`npm update` | `yarn upgrade` | `bun upgrade` | 更新包
`npm cache clean` | `yarn cache clean` | `bun cache clean` | 清理缓存目录
<!--rehype:className=left-align-->
参考备忘清单: [npm](./npm.md)、[yarn](./yaml.md)、[pnpm](./pnpm.md)
### 创建项目
```bash
bun create <template> <project-name>
```
示例:
```bash
bun create react my-react-app
```
### 查看已安装包
```bash
bun ls
```
### 安装依赖
<!--rehype:wrap-class=row-span-2-->
```bash
bun add <package>
```
选项:
```bash
--dev, -D # 安装到 devDependencies
--global, -g # 全局安装包
--exact, -E # 将包安装为精确版本
--tilde, -T # 安装有相同次要版本的包的最新版本
```
### 运行脚本
<!--rehype:wrap-class=row-span-3-->
`package.json` 中定义脚本:
```json
"scripts": {
"start": "node index.js",
"test": "jest"
}
```
运行脚本:
```bash
bun run <script>
```
例如:
```bash
bun run start
```
### 移除依赖
```bash
bun remove <package>
```
### 更新依赖
```bash
bun upgrade
```
选项:
```bash
--latest # 更新到最新版本
```
### 清理缓存
```bash
bun cache clean
```
### 安装全局包
```bash
bun global add <package>
```
### 移除全局包
```bash
bun global remove <package>
```
### Bun 提供的其他命令
```bash
bun bunfile # 管理 Bunfile
bun dev # 运行开发服务器
bun test # 运行测试
bun completions # 生成 shell 补全脚本
```
包管理器
---
### bin 目录的路径
要打印本地项目的 `bin` 目录的路径
```bash
bun pm bin
# /path/to/current/pro/node_modules/.bin
```
全局 bin 目录
```bash
bun pm bin -g
# <$HOME>/.bun/bin
```
### 打印依赖项
```bash
bun pm ls --all
# /path/to/project node_modules (135)
# ├── @eslint-community/eslint-utils@4.4.0
# ├── @eslint-community/regexpp@4.5.0
# ├── @eslint/eslintrc@2.0.2
# ├── @eslint/js@8.38.0
# ├── ...
```
打印所有已安装的依赖项,包括 `n` 阶依赖项。
### 打印已安装及已解决依赖项
```bash
bun pm ls
# /path/to/project node_modules (135)
# ├── eslint@8.38.0
# ├── react@18.2.0
# ├── react-dom@18.2.0
# ├── typescript@5.0.4
# └── zod@3.21.4
```
打印当前项目中已安装依赖项及其已解决版本的列表,不包括其依赖项
### 全局模块缓存的路径
```bash
bun pm cache
```
要打印 Bun 的全局模块缓存的路径
### 清除全局模块缓存
```bash
bun pm cache rm
```
### 列出全局安装
列出所有全局安装的软件包:
```bash
bun pm ls -g
```
列出所有全局安装的软件包,包括 n 阶依赖项:
```bash
bun pm ls -g --all
```
示例
---
### 安装包
<!--rehype:wrap-class=row-span-2-->
```bash
# 将包添加到 dependencies
$ bun add <package>
# 将包添加到 devDependencies
$ bun add -D <package>
# 将包安装为精确版本
$ bun add -E <package>
# 全局安装包
$ bun global add <package>
```
### 移除包
```bash
$ bun remove <package>
```
从所有类型的依赖项中删除包
### 查看包
```bash
# 列出已安装的软件包
$ bun ls
```
### 清除缓存
```bash
$ bun cache clean
```
清理缓存目录
### 运行脚本
```bash
$ bun run <script>
```
`package.json` 中定义的脚本将被执行
另见
---
- [Bun 官方文档](https://bun.sh/docs)
- [Bun GitHub 仓库](https://github.com/oven-sh/bun)
- [Bun 快速上手](https://bun.sh/docs/quickstart)

View File

@@ -38,7 +38,10 @@ $ ./hello
int myNum = 15;
int myNum2; // 声明变量 myNum2
myNum2 = 15; // 变量声明后第一次赋值我们称为初始化,如果 初始化 和 赋值 在同一行,那么我们可以直接称为 定义变量 myNum2
// 变量声明后第一次赋值我们称为初始化
// 如果 初始化 和 赋值 在同一行
// 那么我们可以直接称为 定义变量 myNum2
myNum2 = 15;
int myNum3 = 15; // myNum3 值为 15
myNum3 = 10; // 现在 myNum3 值为 10
@@ -749,7 +752,8 @@ Carole 和 Debra: 我们爱你!
```c
#include <stdio.h>
#define tokenpaster(n) printf ("token" #n " = %d", token##n)
#define tokenpaster(n) \
printf ("token" #n " = %d", token##n)
int main(void){
int token34 = 40;
@@ -768,8 +772,9 @@ int main(void){
#endif
int main(void) {
printf("Here is the message: %s\n", MESSAGE);
return 0;
printf("信息如下: %s\n", \
MESSAGE);
return 0;
}
```
@@ -794,8 +799,9 @@ int square(int x) {
#define MAX(x,y) ((x) > (y) ? (x) : (y))
int main(void) {
printf("Max between 20 and 10 is %d\n", MAX(10, 20));
return 0;
printf("20 到 10 之间的最大值是 %d\n", \
MAX(10, 20));
return 0;
}
```

596
docs/chatgpt.md Normal file
View File

@@ -0,0 +1,596 @@
ChatGPT
===
ChatGPT是OpenAI开发的人工智能聊天机器人程序利用强化学习训练能够进行复杂的语言任务如文本生成、问答和编程支持。
入门指南
---
### ChatGPT 介绍
ChatGPT全称聊天生成预训练转换器英语Chat Generative Pre-trained Transformer是 OpenAI 开发的人工智能聊天机器人程序于2022年11月推出。
- 网址: <https://chatgpt.com/>
该程序使用基于GPT-3.5、GPT-4、GPT-4o架构的大型语言模型并以强化学习训练。ChatGPT目前仍以文字方式交互而除了可以用人类自然对话方式来交互还可以用于甚为复杂的语言工作包括自动生成文本、自动问答、自动摘要等多种任务。如在自动文本生成方面ChatGPT可以根据输入的文本自动生成类似的文本剧本、歌曲、企划等在自动问答方面ChatGPT可以根据输入的问题自动生成答案。还有编写和调试计算机程序的能力。
### 国内类似的平台
- [文心一言(百度)](https://yiyan.baidu.com/) _baidu.com_
- [通义千问(阿里)](https://tongyi.aliyun.com/) _aliyun.com_
- [混元(腾讯)](https://hunyuan.tencent.com/) _tencent.com_
- [豆包(字节跳动)](https://www.doubao.com/) _doubao.com_
- [天工Ai](https://www.tiangong.cn/) _tiangong.cn_
- [讯飞星火](https://xinghuo.xfyun.cn/) _xfyun.cn_
### 通用
<!--rehype:wrap-class=row-span-2-->
为你的公司或创意命名
```
你能为我的科技初创公司建议一个创意的名字吗?
帮我想一个有吸引力的名字,适合我的面包店生意。
```
为课程或培训项目创建大纲
```
请为初学者网页开发课程创建一个大纲。
能为客户服务研讨会制定一个培训计划大纲吗?
```
为特定职位提供面试问题
```
我在面试软件工程师职位,你能给我一些面试问题吗?
请为市场经理角色提供一些常见的面试问题。
```
为商业伙伴、客户或客户提供礼物想法
```
我需要给我的客户准备礼物,你能帮忙吗?
给我的商业伙伴们一些独特的礼物建议?
```
从名单或电子邮件中随机选择竞赛获奖者
```
我想从100个名字中选择一个获奖者你可以帮忙吗
从1000封电子邮件列表中随机选择5个作为赠品竞赛的获奖者可以吗
```
### 编程
<!--rehype:wrap-class=row-span-3-->
解释代码为什么不工作
```
为什么这段代码不起作用?
var x = 5;
var y = 0;
console.log(x/y);
```
解释代码的含义
```
这段代码是做什么的?
function addNumbers(a, b) {
return a + b;
}
```
用指定的语言重写代码
```
把这段代码翻译成Python
function addNumbers(a, b) {
return a + b;
}
```
编写整个软件程序
```
编写一个计算给定数字阶乘的程序?
如何在JavaScript中发出HTTP请求
```
生成正则表达式regex
```
创建一个匹配所有电子邮件地址的正则表达式?
生成一个匹配8位密码的正则表达式。
```
为代码库添加注释
```
为这段代码添加注释:
function addNumbers(a, b) {
return a + b;
}
```
更改一行代码的CSS
```
更新这行代码的CSS将字体颜色更改为蓝色
<p class="example">Hello, Reference!</p>
```
更改一行代码的HTML
```
给这个标题标签添加一个"class"为"header"的类?
<h1>Hello, Reference!</h1>
```
### 电子邮件
<!--rehype:wrap-class=row-span-2-->
创建电子邮件活动
```
发送邀请小弟调调参加周末晚宴的电子邮件
为我们的新客户入职流程创建电子邮件序列
```
格式化和校对电子邮件
```
校对并格式化我刚写的这封电子邮件:
Hello, do you have any actual tips or tricks for ChatGPT please?
```
<!--rehype:className=wrap-text-->
提供有效电子营销的提示
```
给我一些关于如何提高电子邮件营销开启率和点击率的建议。
请提供一些使我的电子邮件内容对订阅者更具吸引力和相关性的建议。
```
<!--rehype:className=wrap-text-->
自动化电子邮件回复
```
通过电子邮件告知他,"这是一个好建议,很快就会实现"
Hello, do you have any actual tips or tricks for ChatGPT please?
```
<!--rehype:className=wrap-text-->
从文本中提取电子邮件地址
```
为我从下面的文本中提取所有的电子邮件地址:
Sed sit amet sodales tom@gmail.com, at jack@cheatsheets.zip enim. 18261@outlook.com ut eros
```
<!--rehype:className=wrap-text-->
### 电子表格
帮助创建电子表格公式
```
你能帮我创建一个计算A1到A10单元格求和的公式吗
```
解释公式的含义
```
你能简单解释一下 =SUM(A1:A10) 这个公式的含义吗?
```
为占位符创建虚拟数据
```
你能为我生成一些用作电子表格占位符的虚拟数据吗?
```
帮助创建复杂的宏
```
我需要创建一个宏计算B1到B10单元格的平均值并将结果插入到C1单元格中。你能帮我吗
```
<!--rehype:className=wrap-text-->
提供提高电子表格效率的提示
```
你能给我一些提高电子表格效率的建议吗?
```
### 社交媒体
为任何主题提供模板创意
```
你能给我提供一些关于[主题]的模板创意吗?
```
为任何主题的帖子提供互动关联的想法
```
我想创建一个关于[主题]的帖子,能帮我想些创意吗,能吸引我的粉丝参与。
```
<!--rehype:className=wrap-text-->
生成标签和标题
```
我需要一些标签和一段风景日落图片的标题。你能为我生成一些吗?
```
<!--rehype:className=wrap-text-->
提供答复建议
```
我刚收到一条询问[主题]项目状态的消息。你能为我建议一条回复吗?
```
<!--rehype:className=wrap-text-->
### 阅读
总结长文选
```
你能为我总结一下这篇文章吗?[你的文本]
```
翻译外语
```
你能把这句话翻译成中文吗?[你的文本]
```
类似于另一本书的书籍推荐
```
你能推荐一些类似于《饥饿游戏》的书吗?
```
### 设计
为您创建一个AI设计提示
```
能帮我生成一个关于新体育品牌logo设计的设计提示吗
```
缩略图建议用于博客或视频
```
能推荐一些吸引人的缩略图设计吗,用于我最新的视频,内容是健康饮食?
```
<!--rehype:className=wrap-text-->
字体搭配
```
能为旅行博客标题设计建议字体搭配吗?
```
颜色搭配
```
能为婚纱摄影网站推荐一个色彩搭配方案吗?
```
### 数据分析
从大段文本中提取数字
```
请从这段文本中提取所有的数字:[你的文本]
```
根据提供的文本或数据创建表格
```
能根据这些数据创建一个表格吗?:[你的数据]
```
从大列表中筛选数据
```
请根据特定标准筛选这个列表:[你的列表]
```
### 付费广告
提供广告创意建议
```
为新产品发布提供广告创意建议。
```
审核跟踪代码是否有错误(标签管理器等)
```
审查我的标签管理器代码,看看是否有错误。
```
提供广告文案建议
```
请提供一家[主题]公司的广告文案。
```
微博受众建议
```
为服装品牌广告活动推荐一个微博受众。
```
为您的广告创建正文、标题和/或行动号召
```
为新的[主题]计划广告创建标题、正文和行动号召。
```
### SEO
<!--rehype:wrap-class=col-span-2 row-span-2-->
生成或查找关键词
```
为 [主题] 生成一组相关连的关键词
识别 [主题] 内容优化的长尾关键词
查找 [主题] 的热门关键词
为 [主题] 生成一组LSI关键词
查找 [主题] 相关度低的关键词
创建 [主题] 关键词的同义词列表
查找 [主题] PPC广告活动的最佳关键词
查找 [主题] 语音搜索优化的最佳关键词
列出 [主题] 特色片段的最佳关键词
为 [主题] 视频优化找到最佳关键词
查找 [主题] 的最佳关键词
查找 [主题] AMP优化的最佳关键词
查找 [主题] 社交媒体优化的最佳关键词
```
更多关于 SEO 的 ChatGPT 提示
```
为 [主题] 创建元描述和标题标签
查找与 [主题] 相关的内部链接
为 [主题] 的博客文章和文章主题生成创意
研究行业特定术语以用于 [主题] 内容
查找权威网站以获取 [主题] 内容的反向链接
创建与 [主题] 相关的XML站点地图示例
研究 [主题] 的最佳元标签
研究 [主题] 内容的最佳内部链接结构
生成关于 [主题] 的常见问题列表
为与 [主题] 相关的图像创建最佳Alt标签列表
创建与 [主题] 相关的子主题列表
查找发布与 [主题] 相关内容的最佳时间
研究与 [主题] 相关的最佳外部链接策略
查找用于 [主题] SEO 的最受欢迎工具
创建与 [主题] 相关的潜在影响者列表
研究与 [主题] 相关的最佳Schema标记
查找 [主题] 内容的最佳标题标签
创建与 [主题] 相关的潜在链接建设机会列表
研究与 [主题] 反向链接相关的最佳锚文本
创建与 [主题] 相关的潜在客座博客机会列表
研究与 [主题] 相关的最佳本地SEO策略
研究用于 [主题] 网站性能的最佳分析工具
创建与 [主题] 相关的潜在合作伙伴列表
研究用于 [主题] 移动优化的最佳策略
研究用于 [主题] 电子商务优化的最佳策略。提供关键词群集。
创建与 [主题] 相关的潜在联盟营销机会列表
什么是与 [主题] 相关的最佳联盟营销网站?
什么是 [主题] 国际SEO的最佳策略
创建与 [主题] 相关的潜在播客或播客客座机会列表
查找与 [主题] 相关的热门内容主题
研究用于 [主题] SEO 的最佳策略,并提供可操作步骤
创建与 [主题] 相关的潜在视频系列或网络研讨会想法列表
研究与 [主题] 相关的竞争者策略
查找与 [主题] 相关的规范标签示例
为 [主题] 制定一个示例关键词列表,以定位多个地理位置
生成针对 [主题] 客户购买漏斗不同阶段的关键词想法
识别与 [主题] 相关的行业标签
```
### 写作/博客
<!--rehype:wrap-class=row-span-2-->
为您的创意写作项目创建标题
```
我的短篇小说集的标题:[你的文章]
```
创建大纲
```
一篇关于运动的论文大纲。
```
生成内容创意
```
关于[主题]博客的创意?
```
总结您提供的任何文本
```
总结这篇关于可再生能源的文章?[你的文章]
```
撰写完整的博客文章
```
关于【财务规划】的博客文章?
```
扩展句子、段落或长文本选择
```
扩展这句关于爵士音乐的话?[你的句子]
```
改变写作的语气
```
将这份报告的语气改为对话式?[你的文章]
```
校对或编辑您的写作
```
校对这篇文章?[你的文章]
```
使用标题格式化文本(非常适合博客文章)
```
为我的博客文章格式化标题?[你的文章]
```
检查任何文本的偏见
```
检查这篇文章是否有偏见?[你的文章]
```
检测任何文本的抄袭
```
检测这篇论文是否有抄袭?[你的论文]
```
为您提供域名主意
```
为我的【园艺博客】提供一个域名?
```
### 撰写商业内容
撰写或重新撰写您的产品描述
```
请帮我为最新的商品撰写一个新的引人注目的产品描述。
```
撰写或重新撰写申诉信
```
请帮助重新撰写我的申诉信,使其更具说服力。
```
撰写或重新撰写供应商联络邮件
```
能帮我写一封有效的电子邮件,以联系潜在供应商吗?
```
帮助您找到可以打包销售的商品
```
请推荐一些适合我们客户的商品组合。
```
组织产品和定价数据
```
能帮我将产品和定价信息整理成一个整洁易管理的电子表格吗?
```
<!--rehype:className=wrap-text-->
### 教师/课程创建者
将事实或统计数据列表转换为多选测验
```
能将这份关于世界历史事实的列表转换成多选测验吗?[你的列表]
```
<!--rehype:className=wrap-text-->
特定主题的作业创意
```
我需要一些有关[主题]的历史作业的创意。你能建议一些吗?
```
<!--rehype:className=wrap-text-->
根据学生名单创建分组
```
我班上有30名学生名单。你能帮忙将他们分成6人一组做小组项目吗
```
<!--rehype:className=wrap-text-->
基于考试成绩创建曲线
```
我需要根据他们的考试成绩为我的班级创建一个分数曲线。能帮忙吗?
```
<!--rehype:className=wrap-text-->
评分作业
```
能为这篇历史论文打分并提供改进意见吗?
```
### 视频
从剧本中创建时间戳
```
能为这篇播客剧本创建时间戳吗?[视频地址]
```
将视频转换为带格式的博客文章
```
能将这个关于烹饪的视频转换为带有标题和项目符号的博客文章吗?[视频链接]
```
<!--rehype:className=wrap-text-->
提出视频大纲或剧本
```
我需要一个关于冥想益处的视频大纲。你能帮忙吗?
```
回复评论
```
能为我的视频上的这条负面评论写一个有思想的礼貌回复吗?
```
<!--rehype:className=wrap-text-->
为您的缩略图提供创意
```
我需要一些关于"DIY家居装"的创意?
```
### 研究
帮助研究2021年之前发生的任何事情
```
以简单的术语解释量子计算
有没有关于10岁生日的创意想法
如何在JavaScript中发起HTTP请求
可以告诉我导致火山喷发的事件吗?
可以告诉我关于印刷机发明的信息吗?
可以总结一下奥林匹克运动会的历史吗?
可以给我关于文艺复兴的相关信息吗?
我对拜占庭帝国的历史很感兴趣。你能帮我了解更多吗?
等等...
```
## 参考资料
- [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts)
- [原始资料](https://github.com/Fechin/reference/blob/main/source/_posts/chatgpt.md)
- [ChatGPT](https://chatgpt.com/)

View File

@@ -73,6 +73,11 @@ int a = 5, b = 10;
std::swap(a, b);
// 输出: a=10, b=5
std::cout << "a=" << a << ", b=" << b;
// 整数交换的奇技淫巧
(x ^= y), (y ^= x), (x ^= y);
// 注意! 以下操作会造成 undefined behavior
x ^= y ^= x ^= y;
```
### 注释
@@ -502,6 +507,16 @@ for (int i = 0, j = 2; i < 3; i++, j--){
// 输出: i=0,j=2;i=1,j=1;i=2,j=0;
```
### auto
```cpp
std:: string s = "hello world";
for(auto c: s){
std:: cout << c << " ";
}
// 输出: h e l l o w o r l d
```
C++ 函数
------------
@@ -703,7 +718,7 @@ std::this_thread::yield();
```
### 锁
<!--rehype:wrap-class=row-span-3-->
<!--rehype:wrap-class=row-span-5-->
> `#include <mutex>`
@@ -860,7 +875,7 @@ cond.wait(lock, predicate);
唤醒所有调用 `wait` 的线程。
### 获取线程的运行结果
<!--rehype:wrap-class=row-span-2-->
<!--rehype:wrap-class=row-span-5-->
> `#include <future>`
@@ -947,14 +962,106 @@ else if (status ==
#### 多个返回值
如果要多次获取结果,可以使用`std::shared_future`,其会返回结果的一个**拷贝**。
```cpp
std::shared_future<T> result;
```
如果要多次获取结果,可以使用`std::shared_future`,其会返回结果的一个**拷贝**。
对于不可拷贝对象,可以在`std::shared_future`中存储对象的指针,而非指针本身。
### 创建线程
```cpp
void threadFunction() {
// 线程函数体
std::cout << "From thread" << std::endl;
}
int main() {
// 创建线程并开始执行线程函数
std::thread t(threadFunction);
// 等待线程执行完毕
t.join();
return 0;
}
```
### 传递参数给线程函数
```cpp
void threadFunction(int value) {
// 线程函数体
std::cout << "Received value: " << value << std::endl;
}
int main() {
int data = 42;
std::thread t(threadFunction, data);
t.join();
return 0;
}
```
### 使用Lambda表达式创建线程
```cpp
int main() {
int data = 42;
std::thread t([data]() {
// Lambda 表达式作为线程函数
std::cout << "Received value: " << data << std::endl;
});
t.join();
return 0;
}
```
### **处理线程间的同步:**
```cpp
#include <mutex>
std::mutex mtx;
void threadFunction() {
std::lock_guard<std::mutex> lock(mtx);
std::cout << "Thread safe output." << std::endl;
}
int main() {
std::thread t1(threadFunction);
std::thread t2(threadFunction);
t1.join();
t2.join();
return 0;
}
```
### **使用`std::async`启动异步任务:**
```cpp
#include <future>
int taskFunction() {
// 异步任务
return 42;
}
int main() {
// 启动异步任务
std::future<int> fut = std::async(std::launch::async, taskFunction);
// 获取异步任务的结果
int result = fut.get();
std::cout << "Result: " << result << std::endl;
return 0;
}
```
C++ 预处理器
------------

1205
docs/cs.md

File diff suppressed because it is too large Load Diff

View File

@@ -184,10 +184,84 @@ print(3 >= 3); // 打印: true - 大于或等于
print(2 <= 3); // 打印: true - 小于或等于
```
### 运算符优先级示例
```dart
// 括号可以提高可读性。
if ((n % i == 0) && (d % i == 0)) ...
// 虽然难以阅读,但等效。
if (n % i == 0 && d % i == 0) ...
```
### 位运算符和移位运算符
操作符 | 含义
:-|-
`&` | 与AND
`\|` | 或OR
`^` | 异或XOR
`~expr` | 一元位补码<br>_(0 变为 11 变为 0)_
`<<` | 左移
`>>` | 右移
`>>>` | 无符号右移
<!--rehype:className=left-align-->
----
```dart
final value = 0x22;
final bitmask = 0x0f;
// 与AND
assert((value & bitmask) == 0x02);
// 非与AND NOT
assert((value & ~bitmask) == 0x20);
// 或OR
assert((value | bitmask) == 0x2f);
// 异或XOR
assert((value ^ bitmask) == 0x2d);
assert((value << 4) == 0x220); // 左移
assert((value >> 4) == 0x02); // 右移
```
### 级联表示法
级联 (.., ?..) 允许您对同一对象进行一系列操作。除了访问实例成员之外,您还可以调用同一对象的实例方法。这通常可以节省您创建临时变量的步骤,并允许您编写更流畅的代码。考虑以下代码:
```dart
var paint = Paint()
..color = Colors.black
..strokeCap = StrokeCap.round
..strokeWidth = 5.0;
```
示例相当于以下代码:
```dart
var paint = Paint();
paint.color = Colors.black;
paint.strokeCap = StrokeCap.round;
paint.strokeWidth = 5.0;
```
`?...`开头可确保不会对该空对象进行任何级联操作。
```dart
querySelector('#confirm') // 获取一个对象
?..text = 'Confirm' // 使用它的成员
..classes.add('important')
..onClick.listen((e) => {
window.alert('Confirmed!')
})
..scrollIntoView();
```
控制流:条件
------
### if 和 else if
<!--rehype:wrap-class=row-span-2-->
```dart
if(age < 18){
@@ -200,11 +274,12 @@ if(age < 18){
```
### switch case
<!--rehype:wrap-class=row-span-2-->
```dart
enum Pet {dog, cat}
Pet myPet = Pet.dog;
switch(myPet){
switch(myPet) {
case Pet.dog:
print('My Pet is Dog.');
break;
@@ -217,6 +292,25 @@ switch(myPet){
// 打印: My Pet is Dog.
```
### 三元操作符
```dart
int age = 20;
String message = age >= 18 ? "成人" : "儿童";
print("年龄类别: $message");
// 输出: 年龄类别: 成人
```
### 三元操作符嵌套使用
```dart
int x = 10;
int y = 5;
int result = x > y ? x : y > 0 ? y : 0;
print("Result: $result");
// 输出: Result: 10
```
控制流:循环
-----
@@ -778,8 +872,50 @@ userObject?.userName?.toString()
// 如果 userObject 或 userObject.userName 为 null则前面的代码返回 null 并且从不调用 toString()
```
### 扩展运算符 (...)
```dart
// 将多个值插入到集合中
var list = [1, 2, 3];
var list2 = [0, ...list];
print(list2.length); // 打印: 4
```
### enum
<!--rehype:wrap-class=col-span-2 row-span-2-->
定义enum"enumeration"的缩写)是一种特殊的数据类型,可使变量成为一组预定义的常量。枚举用于定义只能从一小组可能值中选择一个的变量。通过为这些值集提供有意义的名称,枚举有助于提高代码的可读性,减少出错率。
```dart
// 定义枚举类型
enum TrafficLight {
red,
yellow,
green
}
// 根据交通灯状态打印消息的函数
void printTrafficLightMessage(TrafficLight light) {
switch (light) {
case TrafficLight.red:
print('Stop!');
break;
case TrafficLight.yellow:
print('Get ready...');
break;
case TrafficLight.green:
print('Go!');
break;
}
}
void main() {
// 枚举类型的示例用法
TrafficLight currentLight = TrafficLight.green;
// 打印当前交通灯状态的消息
printTrafficLightMessage(currentLight);
}
```
### 级联符号 (..)
<!--rehype:wrap-class=row-span-2-->
```dart
// 允许您对同一对象进行一系列操作
@@ -795,15 +931,6 @@ var user = User()
..age = 24;
```
### 扩展运算符 (...)
```dart
// 将多个值插入到集合中
var list = [1, 2, 3];
var list2 = [0, ...list];
print(list2.length); // 打印: 4
```
### 延迟初始化
```dart
@@ -812,7 +939,7 @@ late String token;
void main(List<String> args) {
/// print(token);
/// Field 'token' has not been initialized
/// 字段 "token "尚未初始化
/// 在初始化前调用就会报错
token = "tokenContent";
print(token);

660
docs/docker-compose.md Normal file
View File

@@ -0,0 +1,660 @@
Docker Compose 备忘清单
===
这是 [docker-compose](https://docs.docker.com/compose/) 的快速参考备忘单。你可以在这里找到最常见的 Docker Compose 使用方式。
入门
---
### Docker Compose 是什么?
- `Docker-compsoe` 是一个开源项目,用于定义和运行多容器 `Docker` 应用程序的工具。由 `Docker` 社区维护。
- 通过一个 `YAML` 文件来配置应用程序的服务,以便可以使用一个命令启动、停止和重启整个应用程序。
- [Docker Compose 开源地址](https://github.com/docker/compose)
- [Docker Compose 发行地址](https://github.com/docker/compose/releases) _github.com_
### 基本概念
- **服务 (services):** 一个服务指的是一个容器,即一个应用程序的一个实例。
- **容器 (container):** `Docker` 容器,其中运行着应用程序的一个实例。
- **镜像 (image):** `Docker` 镜像,用于创建容器的模板。
- **Docker-Compose 文件:** 一个 `YAML` 文件,描述了应用程序的各个服务以及它们之间的关系、配置等信息。
### Docker-Compose 文件结构
- `version`: _Docker-Compose_ 文件的版本。
- `services`: 定义了各个服务,每个服务都有自己的配置项,如镜像、端口映射、依赖等。
- `networks`: 定义了应用程序使用的网络,可以自定义网络以控制服务之间的通信。
- `volumes`: 定义了应用程序使用的卷,用于持久化数据或与主机共享文件。
### 安装
<!--rehype:wrap-class=row-span-2-->
对于 Ubuntu 和 Debian运行
```bash
sudo apt-get update
sudo apt-get install docker-compose-plugin
```
对于基于 RPM 的发行版,运行:
```bash
sudo yum update
sudo yum install docker-compose-plugin
```
通过检查版本来验证 Docker Compose 是否正确安装
```sh
docker compose version
# Docker Compose version v2.17.3
docker --version
# Docker version 23.0.5, build bc4487a
docker version
# Client: Docker Engine - Community
# Cloud integration: v1.0.31
# Version: 23.0.5
# API version: 1.42
# <...>
```
### 独立安装 Compose
```sh
curl -SL https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
```
<!--rehype:className=wrap-text-->
如果命令 `docker-compose` 安装失败,请检查你的路径。你也可以创建一个符号链接,指向 `/usr/bin` 或路径中的任何其他目录。例如
```sh
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
```
<!--rehype:className=wrap-text-->
### 更新 Compose
对于 Ubuntu 和 Debian运行
```sh
sudo apt-get update
sudo apt-get install docker-compose-plugin
```
对于基于 RPM 的发行版,运行:
```sh
sudo yum update
sudo yum install docker-compose-plugin
```
### 卸载 Docker Compose
<!--rehype:wrap-class=col-span-2-->
Ubuntu, Debian:
```sh
sudo apt-get remove docker-compose-plugin
```
基于 RPM 的发行版
```sh
sudo yum remove docker-compose-plugin
```
如果您使用curl安装Compose CLI插件要卸载它请运行
```sh
rm $DOCKER_CONFIG/cli-plugins/docker-compose
```
为所有用户删除,或者,如果您已为所有用户安装 Compose请运行
```sh
rm /usr/local/lib/docker/cli-plugins/docker-compose
```
### 检查 Compose 的安装位置
<!--rehype:wrap-class=col-span-3-->
```sh
docker info --format '{{range .ClientInfo.Plugins}}{{if eq .Name "compose"}}{{.Path}}{{end}}{{end}}'
```
### 常用命令
<!--rehype:wrap-class=col-span-2-->
| docker compose命令 | 说明 | 常见参数说明 |
| ------------------------ | ---------------- | -------------------- |
| `docker compose up` | 启动容器 | `-d` 后台运行容器 |
| `docker compose down` | 停止容器 | `-v` 删除容器和卷 |
| `docker compose logs` | 查看容器日志 | `-f` 跟随日志输出 |
| `docker compose exec` | 进入容器 | `-it` 启动交互式终端 |
| `docker compose pull` | 拉取镜像 | |
| `docker compose build` | 构建镜像 | |
| `docker compose images` | 列出镜像 | |
| `docker compose push` | 推送镜像 | |
| `docker compose config` | 显示配置信息 | |
| `docker compose version` | 查看版本信息 | |
<!--rehype:className=left-align-->
### 常用运维命令
| docker compose命令 | 说明 |
| ------------------------ | ---------------- |
| `docker compose stop` | 停止容器 |
| `docker compose start` | 启动容器 |
| `docker compose rm` | 删除容器 |
| `docker compose restart` | 重启容器 |
| `docker compose run` | 运行一个临时容器 |
| `docker compose ps` | 查看容器状态 |
<!--rehype:className=left-align-->
Docker Compose 配置
---
### 示例配置文件
<!--rehype:wrap-class=col-span-2-->
`docker-compose` 的配置文件是一个 `YAML` 文件,用于定义和运行多容器 Docker 应用程序。通常命名为 `docker-compose.yml`,它使用单一的 YAML 文件来定义多个容器的集合,以及它们之间的依赖关系和服务。以下是一份 `docker-compose.yml` 文件的配置模板,包含了常用配置项和解释:
```yml
name: myapp
version: '3' # 已过时
services: # 定义一个或多个服务
service1: # 服务名称
image: nginx:latest # 使用的 Docker 镜像,这里是 Nginx 的最新版本
# 或者使用构建指令来从 Dockerfile 构建镜像
build:
context: ./path/to/Dockerfile # Dockerfile 所在的目录
dockerfile: Dockerfile-alternative # 可选的 Dockerfile 名称,默认是 Dockerfile
# 容器启动时执行的命令,覆盖默认的命令
command:
- "nginx"
- "-g"
- "daemon off;" # 以数组形式指定,防止 shell 解析
ports: # 容器端口与主机端口映射
- "80:80" # 主机 80 端口映射到容器的 80 端口
volumes: # 数据卷挂载
- ./nginx.conf:/etc/nginx/nginx.conf:ro # 将主机上的 nginx.conf
# 挂载到容器的 /etc/nginx/nginx.conf只读
- ./logs:/var/log/nginx # 将 logs 目录挂载到容器的 /var/log/nginx
environment: # 设置环境变量
- MYSQL_HOST=database # 可以引用其他服务,这里假设有一个名为 database 的服务
- MYSQL_PORT=3306
depends_on: # 服务启动顺序,这里表明 service1 依赖于 database 服务
- database
networks: # 定义网络
- my_network # 参与名为 my_network 的网络
service2: # 另一个服务示例
# ... 类似地定义其他服务
networks: # 定义网络
my_network: # 网络名称
driver: bridge # 网络驱动,通常是 bridge 模式
volumes: # 定义数据卷
nginx_logs: # 卷名称
```
备忘录事项
- 使用 Docker-Compose 可以简化多容器应用程序的部署和管理,但需要注意容器之间的依赖关系和通信。
- 配置文件中的缩进必须使用空格,不能使用制表符。
- 可以使用环境变量来动态设置配置项,如数据库密码。
- 当你修改了 `docker-compose.yml` 文件后,需要重新运行 `docker-compose up` 来使改动生效。
- 使用 `docker-compose build` 仅重建镜像,而不启动容器。
- 使用 `docker-compose restart` 重启容器。
- 记得清理不再需要的容器和镜像,以避免磁盘空间不足。
### 使用环境变量
`docker run -e VARIABLE=VALUE ...` 相同
```yml
web:
environment:
- DEBUG=1
```
您可以选择不设置值并将环境变量从 shell 直接传递到容器。它的工作方式与 `docker run -e VARIABLE ...` 相同:
```yml
web:
environment:
- DEBUG
web:
environment:
- DEBUG=${DEBUG}
```
`env_file` 属性允许您在 Compose 应用程序中使用多个 `.env` 文件。
它的工作方式与 `docker run --env-file=FILE ...` 相同。
```yml
web:
env_file:
- web-variables.env
```
#### 额外的信息
```yml
env_file:
- path: ./default.env
required: true # default
- path: ./override.env
required: false
```
- 如果指定了多个文件,则它们将按顺序进行评估,可以覆盖先前文件中设置的值。
-`.env` 文件中声明的环境变量不能在 Compose 文件中单独再次引用。
- 如果同时使用 `env_file``environment` 属性,则由 `environment` 设置的环境变量优先级更高。
-`env_file` 属性中指定的 `.env` 文件的路径是相对于 compose.yml 文件的位置的。
- `.env` 文件中的值可以通过使用 `docker compose run -e` 命令行来从命令行覆盖。
- 如果使用 `--env-file` 替换了另一个 `.env`,则您的 `.env` 文件可以被另一个 `.env` 文件覆盖。
- 从 Docker Compose 版本 2.24.0 开始,您可以通过使用 `required` 字段将 `.env` 文件设置为可选项。当 `required` 设置为 `false``.env` 文件丢失时Compose 将静默忽略该条目
### image
```yml
image: redis
image: redis:5
image: redis@sha256:0ed5d5928d473745...
image: library/redis
image: docker.io/library/redis
image: my_private.registry:5000/redis
```
### ports 端口
<!--rehype:wrap-class=col-span-2 row-span-2-->
```yml
ports:
# 将容器的端口 3000 映射到主机的随机端口
- "3000"
# 将容器的端口范围从 3000 到 3005 映射到主机的相同端口范围
- "3000-3005"
# 将容器的端口 8000 映射到主机的端口 8000
- "8000:8000"
# 将容器的端口范围从 8080 到 8081 映射到主机的端口范围从 9090 到 9091
- "9090-9091:8080-8081"
# 将容器的端口 22SSH端口映射到主机的端口 49100
- "49100:22"
# 将容器的端口范围从 8000 到 9000 映射到主机的端口 80
- "8000-9000:80"
# 将容器的端口 8001 映射到主机的 127.0.0.1 地址的端口 8001
- "127.0.0.1:8001:8001"
# 将容器的端口范围从 5000 到 5010 映射到主机的 127.0.0.1 地址的相同端口范围
- "127.0.0.1:5000-5010:5000-5010"
# 将容器的 UDP 端口 6060 映射到主机的端口 6060
- "6060:6060/udp"
```
暴露容器端口
### platform 平台
```yml
platform: darwin
platform: windows/amd64
platform: linux/arm64/v8
```
定义了服务容器运行的目标平台。值必须符合 [OCI Image Spec](https://github.com/opencontainers/image-spec/blob/v1.0.2/image-index.md) 使用的约定
### command
<!--rehype:wrap-class=col-span-2-->
会覆盖容器镜像声明的默认命令,例如 Dockerfile 的 CMD。
```yml
command: bundle exec thin -p 3000
```
该值也可以是一个列表,其方式类似于 Dockerfile
```yml
command: [ "bundle", "exec", "thin", "-p", "3000" ]
```
如果该值为 null则使用映像中的默认命令。如果值为 [](空列表)或 ''(空字符串),则忽略图像声明的默认命令,即覆盖为空。
### depends_on
```yml
services:
web:
build: .
depends_on:
- db
- redis
redis:
image: redis
db:
image: postgres
```
服务之间的启动和关闭依赖关系。
### volumes
<!--rehype:wrap-class=col-span-2-->
下面的示例显示了双服务设置,其中数据库的数据目录作为名为 db-data 的卷与另一个服务共享,以便定期备份。
```yml
services:
backend:
image: example/database
volumes:
- db-data:/etc/data
backup:
image: backup-service
volumes:
- db-data:/var/lib/backup/data
volumes:
db-data:
```
db-data 卷安装在 `/var/lib/backup/data``/etc/data` 容器路径中,分别用于备份和后端。如果卷尚不存在,则运行 `docker compose up` 会创建该卷。否则,如果在 Compose 外部手动删除现有卷,则会使用并重新创建现有卷。
#### driver
指定应使用哪个卷驱动程序。如果驱动程序不可用Compose 将返回错误并且不会部署应用程序。
```yml
volumes:
db-data:
driver: foobar
```
#### driver_opts
指定一个选项列表,作为键值对传递给此卷的驱动程序。这些选项取决于驾驶员。
```yml
volumes:
example:
driver_opts:
type: "nfs"
o: "addr=10.40.0.199,nolock,soft,rw"
device: ":/docker/example"
```
#### external
```yml
services:
backend:
image: example/database
volumes:
- db-data:/etc/data
volumes:
db-data:
external: true
```
在示例中Compose 不会尝试创建名为 `{project_name}_db-data` 的卷,而是查找名为 `db-data` 的现有卷,并将其挂载到后端服务的容器中。
#### labels
标签用于将元数据添加到卷中。您可以使用数组或字典。
```yml
volumes:
db-data:
labels:
com.example.description: "Database volume"
com.example.department: "IT/Ops"
com.example.label-with-empty-value: ""
```
```yml
volumes:
db-data:
labels:
- "com.demo.description=Database volume"
- "com.demo.department=IT/Ops"
- "com.demo.label-with-empty-value"
```
#### name
设置卷的自定义名称。名称字段可用于引用包含特殊字符的卷。该名称按原样使用,并且不受堆栈名称的限制。
```yml
volumes:
db-data:
name: "my-app-data"
```
这使得可以将此查找名称作为 Compose 文件的参数,以便卷的模型 ID 被硬编码,但平台上的实际卷 ID 是在部署期间在运行时设置的。例如,如果 `.env` 文件中的 `DATABASE_VOLUME=my_volume_001`
```yml
volumes:
db-data:
name: ${DATABASE_VOLUME}
```
它还可以与外部属性结合使用。这意味着用于在平台上查找实际卷的卷名称与用于在 Compose 文件中引用它的名称分开设置:
```yml
volumes:
db-data:
external:
name: actual-name-of-volume
```
### networks
<!--rehype:wrap-class=row-span-3-->
```yml
services:
some-service:
networks:
- some-network
- other-network
```
#### aliases
声明网络上服务的替代主机名。同一网络上的其他容器可以使用服务名称或别名来连接到服务的容器之一
```yml
services:
some-service:
networks:
some-network:
aliases:
- alias1
- alias3
other-network:
aliases:
- alias2
```
在以下示例中,服务前端能够通过主机名 `backend` 或者 `back-tier` 网络上的数据库来访问 `backend` 服务。服务 `monitoring` 能够在 admin 网络上通过主机名 `backend` 或者 `mysql` 来访问相同的 `backend` 服务。
```yml
services:
frontend:
image: example/webapp
networks:
- front-tier
- back-tier
monitoring:
image: example/monitoring
networks:
- admin
backend:
image: example/backend
networks:
back-tier:
aliases:
- database
admin:
aliases:
- mysql
networks:
front-tier:
back-tier:
admin:
```
#### ipv4_address, ipv6_address
加入网络时为服务容器指定静态IP地址。
```yml
services:
frontend:
image: example/webapp
networks:
front-tier:
ipv4_address: 172.16.238.10
ipv6_address: 2001:3984:3989::10
networks:
front-tier:
ipam:
driver: default
config:
- subnet: "172.16.238.0/24"
- subnet: "2001:3984:3989::/64"
```
#### link_local_ips
指定了链接本地IP的列表。链路本地IP是属于知名子网的特殊IP纯粹由运营商管理通常取决于部署它们的架构。
```yml
services:
app:
image: busybox
command: top
networks:
app_net:
link_local_ips:
- 57.123.22.11
- 57.123.22.13
networks:
app_net:
driver: bridge
```
#### mac_address
设置服务容器连接特定网络时使用的 MAC 地址。
#### priority 优先级
将服务的容器连接到其网络的顺序。如果未指定,默认值为 0。在以下示例中应用服务首先连接到 `app_net_1`,因为它具有最高优先级。然后它连接到 `app_net_3`,然后是 `app_net_2`,后者使用默认优先级值 0。
```yml
services:
app:
image: busybox
command: top
networks:
app_net_1:
priority: 1000
app_net_2:
app_net_3:
priority: 100
networks:
app_net_1:
app_net_2:
app_net_3:
```
### expose
```yml
expose:
- "3000"
- "8000"
- "8080-8085/tcp"
```
定义 Compose 从容器公开的(传入)端口或端口范围。这些端口必须可供链接服务访问,并且不应发布到主机。只能指定内部容器端口。
### links
```yml
web:
links:
- db
- db:database
- redis
```
定义到另一个服务中的容器的网络链接。同时指定服务名称和链接别名 (SERVICE:ALIAS),或者仅指定服务名称。
### pids_limit
```yml
pids_limit: 10
```
调整容器的 PID 限制。设置为 -1 以获取无限 PID。
### devices
```yml
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"
- "/dev/sda:/dev/xvda:rwm"
```
定义已创建容器的设备映射列表
```sh
HOST_PATH:CONTAINER_PATH[:CGROUP_PERMISSIONS]
```
### dns
```yml
dns: 8.8.8.8
dns:
- 8.8.8.8
- 9.9.9.9
```
定义在容器网络接口配置上设置的自定义 DNS 服务器。它可以是单个值或列表。
### dns_opt
```yml
dns_opt:
- use-vc
- no-tld-query
```
列出要传递给容器的 DNS 解析器Linux 上的 /etc/resolv.conf 文件)的自定义 DNS 选项。
### dns_search
```yml
dns_search: example.com
dns_search:
- dc1.example.com
- dc2.example.com
```
定义在容器网络接口配置上设置的自定义 DNS 搜索域。它可以是单个值或列表。

View File

@@ -9,6 +9,13 @@ Docker 备忘清单
### 入门
#### 安装
```shell
curl -sSL https://get.docker.com/ | sh
sudo chmod 777 /var/run/docker.sock
```
在后台创建和运行容器
```shell
@@ -169,55 +176,16 @@ Docker 网络
----
<!--rehype:body-class=cols-2-->
### 操作
获取容器连接的网络
```shell
docker inspect MyContainer | grep Network
```
删除网络
```shell
docker network rm MyOverlayNetwork
```
列出网络
```shell
docker network ls
```
获取有关网络的信息
```shell
docker network inspect MyOverlayNetwork
```
将正在运行的容器连接到网络
```shell
docker network connect MyOverlayNetwork nginx
```
启动时将容器连接到网络
```shell
docker run -it -d --network=MyOverlayNetwork nginx
```
断开容器与网络的连接
```shell
docker network disconnect MyOverlayNetwork nginx
```
### 创建网络
```shell
docker network create -d overlay MyOverlayNetwork
docker network create -d bridge MyBridgeNetwork
```
自定义网络子网和网关
```shell
docker network create -d overlay \
--subnet=192.168.0.0/16 \
--subnet=192.170.0.0/16 \
@@ -231,19 +199,82 @@ docker network create -d overlay \
MyOverlayNetwork
```
### 操作
<!--rehype:wrap-class=row-span-3-->
获取容器连接的网络
```shell
docker inspect MyContainer | grep Network
```
获取有关网络的信息
```shell
docker network inspect <network_name>
```
将正在运行的容器连接到网络
```shell
docker network connect <network_name> <container_name>
```
启动时将容器连接到网络
```shell
docker run -it -d --network=<network_name> <container_name>
```
断开容器与网络的连接
```shell
docker network disconnect <network_name> <container_name>
```
### 删除网络
```bash
docker network rm <network_name>
```
### 列出网络
```shell
docker network ls
```
Docker 快捷键
----
<!--rehype:body-class=cols-2-->
### 退出
需要特别注意的是,退出快捷键中的删除容器实例,只对于使用 `docker attach` 进入的容器生效,使用 `docker exec` 进入容器后,使用上面的快捷键后将隔离容器,且不会删除容器实例。
### 退出 - 关闭容器
| Docker 快捷键 | 说明 |
|------------|------|
`ctrl+c` | 将关闭容器,并删除当前的容器实例
`ctrl+d` | 将保留容器并退出到Docker主机的命令行界面
`ctrl+p+q` | 将容器分离,保留容器,但是不退出
`ctrl` `c` | 将关闭容器
<!--rehype:className=shortcuts-->
需要特别注意的是,上面的退出快捷键中的删除容器实例只对于使用`docker attach`进入的容器生效,使用`docker exec`进入容器后使用上面的快捷键后将隔离容器且不会删除容器实例
将关闭容器, 并删除当前的容器实例
### 退出 - 保留容器
| Docker 快捷键 | 说明 |
|------------|------|
`ctrl` `d` | 保留容器
<!--rehype:className=shortcuts-->
将保留容器并退出到Docker主机的命令行界面
### 退出 - 容器分离
| Docker 快捷键 | 说明 |
|------------|------|
`ctrl` `p` `q` | 容器分离
<!--rehype:className=shortcuts-->
将容器分离,保留容器,但是不退出
各种各样的
----
@@ -251,15 +282,15 @@ Docker 快捷键
### Docker Hub
| Docker 语法 | 说明 |
|------------|------|
`docker search search_word` | 在 docker hub 中搜索镜像
`docker pull user/image` | 从 docker hub 下载镜像
`docker login` | 向 docker hub 进行身份验证
`docker push user/image` | 将镜像上传到 docker hub
```bash
$ docker search search_word # 在 docker hub 中搜索镜像
$ docker pull user/image # 从 docker hub 下载镜像
$ docker login # 向 docker hub 进行身份验证
$ docker push user/image # 将镜像上传到 docker hub
```
### 镜像仓库命令
<!--rehype:wrap-class=row-span-3-->
<!--rehype:wrap-class=row-span-2-->
登录到镜像仓库
@@ -303,23 +334,22 @@ $ docker push eon01/nginx localhost:5000/myadmin/nginx
`docker stop -f $(docker ps -a -q)` | 停止所有容器
`docker rm -f $(docker ps -a -q)` | 删除所有容器
`docker rmi -f $(docker images -q)` | 删除所有镜像
`docker volume prune` | 删除所有未使用的Docker Volume
`docker network prune` | 删除所有未使用的Docker网络
`docker system prune` | 清理所有空闲或与任何Docker容器无关的资源
`docker image prune` | 删除悬空的Docker镜像
`docker container prune` | 删除所有未使用的Docker 容器
<!--rehype:className=left-align-->
### 卷 volume
检查卷
```shell
$ docker volume ls
```
清理未使用的卷
```shell
$ docker volume prune
$ docker volume ls # 检查卷
$ docker volume prune # 清理未使用的卷
```
### Docker Compose
<!--rehype:wrap-class=col-span-2-->
<!--rehype:wrap-class=row-span-2-->
:- | :-
:- | :-
@@ -334,6 +364,7 @@ $ docker volume prune
`docker-compose scale <service_name>=<replica>` | 为服务指定容器个数
`docker-compose top` | 显示正在运行的进程
`docker-compose run -rm -p 2022:22 web bash` | 启动 Web 服务并运行 bash 作为其命令,删除旧容器
<!--rehype:className=left-align-->
### Docker Services
@@ -348,6 +379,7 @@ $ docker volume prune
<!--rehype:className=left-align-->
### Docker Stack
<!--rehype:wrap-class=col-span-2-->
:- | :-
:- | :-
@@ -380,6 +412,7 @@ $ docker volume prune
<!--rehype:className=left-align-->
### docker 主要命令
<!--rehype:wrap-class=row-span-3-->
:- | :-
:- | :-
@@ -425,8 +458,66 @@ $ docker volume prune
`wait` | 阻塞直到一个或多个容器停止,然后打印它们的退出代码
<!--rehype:className=left-align-->
### docker 管理命令
:- | :-
:- | :-
`docker builder` | 管理构建
`docker buildx*` | Docker BuildxDocker Inc.v0.7.1
`docker compose*` | Docker ComposeDocker Inc.v2.2.3
`docker config` | 管理 Docker 配置
`docker container` | 管理容器
`docker context` | 管理上下文
`docker image` | 管理镜像
`docker manifest` | 管理 Docker 镜像清单和清单列表
`docker network` | 管理网络
`docker node` | 管理 Swarm 节点
`docker plugin` | 管理插件
`docker scan*` | Docker 扫描Docker Inc.v0.16.0
`docker secret` | 管理 Docker 机密
`docker service` | 管理服务
`docker stack` | 管理 Docker 堆栈
`docker swarm` | 管理群
`docker system` | 管理 Docker
`docker trust` | 管理对 Docker 映像的信任
`docker volume` | 管理卷
<!--rehype:className=left-align-->
### docker 全局参数
```bash
--config string # 客户端配置文件的位置(默认“~/.docker”
-c, --context string # 用于连接到守护程序的上下文的名称(
# 覆盖 DOCKER_HOST 环境变量和使用
# “docker context use” 设置的默认上下文)
-D, --debug # 启用调试模式
-H, --host list # 要连接的守护进程套接字
-l, --log-level string # 设置日志级别
# 默认“info” ("debug"|"info"|"warn"|"error"|"fatal")
--tls # 使用 TLS 由 --tlsverify 暗示
--tlscacert string # 仅由该 CA 签署的信任证书
#(默认为“~/.docker/ca.pem”
--tlscert string # TLS证书文件路径
#(默认“~/.docker/cert.pem”
--tlskey string # TLS 密钥文件的路径
#(默认为“~/.docker/key.pem”
--tlsverify # 使用 TLS 并验证远程
-v, --version # 打印版本信息并退出
```
### docker images
```bash
-a, --all 显示所有镜像(默认隐藏中间镜像)
--digests 显示摘要
-f, --filter filter 根据提供的条件过滤输出
--format string 使用 Go 模板打印漂亮的镜像
--no-trunc 不要截断输出
-q, --quiet 仅显示镜像 ID
```
### docker run/create
<!--rehype:wrap-class=row-span-3-->
<!--rehype:wrap-class=col-span-2-->
```bash
--add-host list # 添加自定义主机到 IP 映射 (host:ip)
@@ -436,11 +527,11 @@ $ docker volume prune
--cap-add list # 添加 Linux 功能
--cap-drop list # 放弃 Linux 功能
--cgroup-parent string # 容器的可选父 cgroup
--cgroupns string # 要使用的 Cgroup 命名空间(主机|私有)
# 'host': 在 Docker 主机的 cgroup 命名空间中运行容器
# 'private': 在自己的私有 cgroup 命名空间中运行容器
# '': 使用由守护进程上的
# default-cgroupns-mode 选项配置的 cgroup 命名空间(默认)
--cgroupns string # 要使用的 Cgroup 命名空间(主机|私有)
# 'host': 在 Docker 主机的 cgroup 命名空间中运行容器
# 'private': 在自己的私有 cgroup 命名空间中运行容器
# '': 使用由守护进程上的
# default-cgroupns-mode 选项配置的 cgroup 命名空间(默认)
--cidfile string # 将容器 ID 写入文件
--cpu-period int # 限制 CPU CFS完全公平调度器周期
--cpu-quota int # 限制 CPU CFS完全公平调度器配额
@@ -530,60 +621,62 @@ $ docker volume prune
`run`/`create` 大部分参数一致
### docker 全局参数
### 修改Docker镜像拉取地址
您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
```bash
--config string # 客户端配置文件的位置(默认“~/.docker”)
-c, --context string # 用于连接到守护程序的上下文的名称(
# 覆盖 DOCKER_HOST 环境变量和使用“docker context use”设置的默认上下文
-D, --debug # 启用调试模式
-H, --host list # 要连接的守护进程套接字
-l, --log-level string # 设置日志级别("debug"\|"info"\|"warn"\|"error"\|"fatal") 默认“info”
--tls # 使用 TLS 由 --tlsverify 暗示
--tlscacert string # 仅由该 CA 签署的信任证书(默认为“~/.docker/ca.pem”
--tlscert string # TLS证书文件路径默认“~/.docker/cert.pem”
--tlskey string # TLS 密钥文件的路径(默认为“~/.docker/key.pem”
--tlsverify # 使用 TLS 并验证远程
-v, --version # 打印版本信息并退出
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://1ojaslt1.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
```
### docker 管理命令
### 修改 Docker 数据存储路径
<!--rehype:wrap-class=row-span-2-->
:- | :-
:- | :-
`docker builder` | 管理构建
`docker buildx*` | Docker BuildxDocker Inc.v0.7.1
`docker compose*` | Docker ComposeDocker Inc.v2.2.3
`docker config` | 管理 Docker 配置
`docker container` | 管理容器
`docker context` | 管理上下文
`docker image` | 管理镜像
`docker manifest` | 管理 Docker 镜像清单和清单列表
`docker network` | 管理网络
`docker node` | 管理 Swarm 节点
`docker plugin` | 管理插件
`docker scan*` | Docker 扫描Docker Inc.v0.16.0
`docker secret` | 管理 Docker 机密
`docker service` | 管理服务
`docker stack` | 管理 Docker 堆栈
`docker swarm` | 管理群
`docker system` | 管理 Docker
`docker trust` | 管理对 Docker 映像的信任
`docker volume` | 管理卷
- 停止 Docker 服务:
### docker images
```bash
sudo systemctl stop docker
```
- 将现有的 Docker 数据移动到新的目录:
```bash
sudo mv /var/lib/docker /new/path/docker
```
- 更新 Docker 的配置文件 `/etc/docker/daemon.json`,添加或修改 `data-root` 选项:
```json
{ "data-root": "/new/path/docker" }
```
- 重新启动 Docker 服务:
```bash
sudo systemctl start docker
```
<!--rehype:className=style-timeline-->
⚠️注意:当你执行此操作时,旧的容器和镜像可能无法正常工作,因为它们的路径已更改。建议在部署 Docker 时执行此操作,以避免这些问题。如有必要,重新启动容器或重新创建它们,以确保它们的配置指向新的路径。
### Docker降级版本的方法
```bash
-a, --all 显示所有镜像(默认隐藏中间镜像)
--digests 显示摘要
-f, --filter filter 根据提供的条件过滤输出
--format string 使用 Go 模板打印漂亮的镜像
--no-trunc 不要截断输出
-q, --quiet 仅显示镜像 ID
yum downgrade --setopt=obsoletes=0 \
-y docker-ce-${version} docker-ce-selinux-${version}
```
Docker 示例
`${version}` 指定要降级的版本
Docker 常用示例
---
<!--rehype:body-class=cols-2-->
@@ -599,6 +692,433 @@ $ docker run -d --name portainer \
portainer/portainer-ee:latest
```
### Nginx
<!--rehype:wrap-class=row-span-2-->
```bash
docker run -itd -p 80:80 --restart=always --name Nginx \
-v $HOME/nginx_data/html:/usr/share/nginx/html \
-v $HOME/nginx_data/conf:/etc/nginx/conf.d \
-v $HOME/nginx_data/nginx.conf:/etc/nginx/nginx.conf \
nginx
```
#### 参数解释
- `-itd`: 启动容器并保持后台运行
- `-p 80:80`: 将主机的 80 端口映射到容器的 80 端口,用于访问 Nginx 站点页面
- `--name Nginx`: 给容器指定一个名称为 "Nginx"
- `--restart=always`: 在容器退出时,总是重新启动容器
#### 持久化解释
-- | --
:-- | --
`-v $HOME/nginx_data/html:/usr/share/nginx/html`| 将容器中的 Nginx 站点页面路径映射到本地
`-v $HOME/nginx_data/conf:/etc/nginx/conf.d`| 将容器中的 Nginx 虚拟主机配置文件路径映射到本地 *(需要提前准备好文件)*
`-v $HOME/nginx_data/nginx.conf:/etc/nginx/nginx.conf`| 将容器中的 Nginx 主配置文件路径映射到本地 *(需要提前准备好文件)*
<!--rehype:className=style-list-arrow-->
### Tomcat
```bash
docker run -itd -p 8080:8080 --restart=always \
--name Tomcat \
-v $HOME/Tomcat_data/webapps:/usr/local/tomcat/webapps/ROOT \
tomcat
```
#### 参数解释
- `-itd`: 以后台运行的方式启动容器并分配一个伪终端pseudo-TTY和保持 STDIN 打开
- `-p 8080:8080`: 将主机的端口 8080 映射到容器的 8080 端口,用于访问 Tomcat 站点页面
- `--name Tomcat`: 为容器指定名称为 "Tomcat"
- `--restart=always`: 当容器退出时,总是重新启动容器
#### 持久化解释
将容器中的 `/usr/local/tomcat/webapps/ROOT` 路径挂载到宿主机中的 `$HOME/Tomcat_data/webapps` 目录下。
### Weblogic
<!--rehype:style=background:#d7a100;-->
```bash
docker run -itd \
-p 7001:7001 \
-p 7002:7002 \
-p 5556:5556 \
--restart=always --name Weblogic ismaleiva90/weblogic12
```
注意:`ismaleiva90/weblogic12` 是非官方或认证的 `Docker` 镜像!
#### 参数解释
- `-itd`: 后台运行容器,保持 STDIN 打开
- `-p 7001:7001`: 映射主机 7001 端口到容器 7001 端口,访问 Weblogic 控制台页面
- `-p 7002:7002`: 映射主机 7002 端口到容器 7002 端口,访问 Weblogic 站点页面
- `-p 5556:5556`: 映射主机 5556 端口到容器 5556 端口,访问 Weblogic 站点页面
- `--name Weblogic`: 容器名称为 "Weblogic"
- `--restart=always`: 容器退出时,总是重新启动容器
### MySQL
<!--rehype:wrap-class=row-span-2-->
```bash
docker run -d -it -p 3306:3306 --name MySQL --restart=always \
-v $HOME/MySQL_Data/data:/var/lib/mysql \
-v $HOME/MySQL_Data/conf:/etc/mysql/conf.d \
--privileged=true \
-e MYSQL_DATABASE='test_db' \
-e MYSQL_ROOT_PASSWORD='abc$123' \
-e MYSQL_USER='testuser' -e MYSQL_PASSWORD='abc$123' \
mysql:8.0.31 \
--character-set-server=utf8mb4 \
--collation-server=utf8mb4_unicode_ci
```
#### 参数解释
-- | --
:-- | --
`-d` | 表示以后台运行的方式启动容器
`-it` | 分别表示分配一个伪终端pseudo-TTY并保持 STDIN 打开
`-p 3306:3306` | 将主机的端口映射到容器的端口,这里是将主机的 3306 端口映射到容器的 3306 端口,用于访问 MySQL 数据库
`--name MySQL` | 为容器指定一个名称,这里是 "MySQL"
`--restart=always` | 表示当容器退出时,总是重新启动容器
`--privileged=true` | 若不加字段--privileged=true可能会报权限错误
`--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci` | 这两个选项参数是改变所有表的默认编码和排序规则以使用 UTF-8 (utf8mb4)
<!--rehype:className=style-list-arrow-->
#### 持久化解释
-- | --
:-- | --
`-v $HOME/MySQL_Data/data:/var/lib/mysql` | 将容器中的 MySQL 数据库数据存储到本地,以确保在容器重启时数据得以保留。
`-v $HOME/MySQL_Data/conf:/etc/mysql/conf.d` | 将容器中的 MySQL 自定义配置文件路径映射到本地,以方便自定义配置。*请确保提前准备好文件,否则可能会启动失败*。
<!--rehype:className=style-list-arrow-->
#### 环境变量解释
-- | --
:-- | --
`MYSQL_ROOT_PASSWORD` *【必填】* | 必需的变量,用于指定 MySQL 的 root 超级用户帐户的密码。如果设置了 *`MYSQL_RANDOM_ROOT_PASSWORD=yes`* ,则会随机生成一个密码,并打印到 stdout。
`MYSQL_USER` *【可选】* | 可选变量,用于创建新用户。此用户将被授予指定数据库的超级用户权限。需要同时设置 `MYSQL_PASSWORD` 变量。
`MYSQL_PASSWORD` *【可选】* | 可选变量,用于创建新用户并设置密码。此用户将被授予指定数据库的超级用户权限。需要同时设置 `MYSQL_USER` 变量。
`MYSQL_DATABASE` *【可选】* | 可选变量,允许在容器启动时指定要创建的数据库的名称。如果设置了 `MYSQL_USER` 和 `MYSQL_PASSWORD`,则该用户将被授予对此数据库的超级用户访问权限。
<!--rehype:className=style-list-arrow-->
### Oracle
```bash
docker run -d -it -p 1521:1521 --name Oracle_11g --restart=always \
--mount source=oracle_vol,target=/home/oracle/app/oracle/oradata \
registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
```
注意registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g 是非官方或认证的Docker镜像
#### 参数解释
-- | --
:-- | --
`-d` | 表示以后台运行的方式启动容器
`-it` | 分别表示分配一个伪终端pseudo-TTY并保持 STDIN 打开
`-p 1521:1521` | 将主机的端口映射到容器的端口,这里是将主机的 1521 端口映射到容器的 1521 端口,用于访问 Oracle 数据库
`--name Oracle_11g` | 为容器指定一个名称,这里是 "Oracle_11g"
`--restart=always` | 表示当容器退出时,总是重新启动容器
<!--rehype:className=style-list-arrow-->
#### 持久化解释
-- | --
:-- | --
`--mount source=oracle_vol,target=/home/oracle/app/oracle/oradata` | 将名为 "oracle_vol" 的 Docker 卷挂载到容器中的 "/home/oracle/app/oracle/oradata" 路径。这样做的目的是将 Oracle 数据库的数据存储在持久化的卷中,以便数据在容器重启时得以保留
<!--rehype:className=style-list-arrow-->
### PostgreSQL
```bash
docker run -d -p 5432:5432 --restart=always --name PostgreSQL \
-e POSTGRES_USER='postgres' \
-e POSTGRES_PASSWORD='abc$123' \
-e POSTGRES_DB='test' \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-v $HOME/Postgres_Data:/var/lib/postgresql/data \
-d postgres
```
#### 参数解释
-- | --
:-- | --
`-d` | 表示以后台运行的方式启动容器
`-it` | 分别表示分配一个伪终端pseudo-TTY并保持 STDIN 打开
`-p 5432:5432` | 将主机的端口映射到容器的端口,这里是将主机的 5432 端口映射到容器的 5432 端口,用于访问 Postgre 数据库
`--name PostgreSQL` | 为容器指定一个名称,这里是 "PostgreSQL"
`--restart=always` | 表示当容器退出时,总是重新启动容器
<!--rehype:className=auto-wrap left-align-->
#### 持久化解释
-- | --
:-- | --
`-v $HOME/Postgres_Data:/var/lib/postgresql/data` | 将到容器中的 "/var/lib/postgresql/data" 路径映射挂载到 宿主机中的 ”$HOME/Postgres_Data“目录下,这样做的目的是将 Postgre 数据库的数据存储在本地中,以便数据在容器重启时得以保留
<!--rehype:className=style-list-arrow-->
#### 环境变量解释
-- | --
:-- | --
`POSTGRES_PASSWORD` *【必填】* | PostgreSQL 映像所需的环境变量。设置 PostgreSQL 超级用户的密码。不能为空或未定义。
`POSTGRES_USER` *【可选】* | 可选环境变量,用于创建用户及其密码。创建具有超级用户权限的指定用户和同名的数据库。默认用户是 "postgres"。
`POSTGRES_DB` *【可选】* | 可选环境变量,用于定义首次启动映像时创建的默认数据库的名称。默认值是 `POSTGRES_USER` 的值,如果未设置,则默认为 "postgres"。
`PGDATA` *【可选】* | 默认为 `/var/lib/postgresql/data`。如果使用的数据卷是文件系统挂载点或无法被用户 chowned 的远程文件夹,则需要设置此环境变量以包含数据。
<!--rehype:className=style-list-arrow-->
### 达梦
```bash
docker run -d -p 5236:5236 --restart=always --name DaMengDB \
--privileged=true \
-e PAGE_SIZE=16 \
-e LD_LIBRARY_PATH=/opt/dmdbms/bin \
-e EXTENT_SIZE=32 \
-e BLANK_PAD_MODE=1 \
-e LOG_SIZE=1024 \
-e UNICODE_FLAG=1 \
-e LENGTH_IN_CHAR=1 \
-e INSTANCE_NAME=dm8_test \
-v $HOME/DaMeng_Data:/opt/dmdbms/data \
if010/dameng
```
注意if010/dameng 是从官网下载上传至 Docker Hub 的镜像!
#### 参数解释
-- | --
:-- | --
`-d` | 表示以后台运行的方式启动容器
`-it` | 分别表示分配一个伪终端pseudo-TTY并保持 STDIN 打开
`-p 5236:5236` | 将主机的端口映射到容器的端口,这里是将主机的 5236 端口映射到容器的 5236 端口,用于访问达梦数据库
`--name DaMengDB` | 为容器指定一个名称,这里是 "DaMengDB"
`--restart=always` | 表示当容器退出时,总是重新启动容器
<!--rehype:className=auto-wrap left-align-->
#### 持久化解释
-- | --
:-- | --
`-v $HOME/DaMeng_Data:/opt/dmdbms/data` | 将容器中的达梦数据库数据存储路径 "/opt/dmdbms/data" 映射到本地主机的 "$HOME/DaMeng_Data" 目录,以确保在容器重启时数据得以保留
<!--rehype:className=style-list-arrow-->
### 人大金仓
```bash
docker run -idt -p 5432:54321 --restart=always \
--name Kingbase --privileged=true \
-e DB_MODE=oracle \
-e NEED_START=yes \
-e DB_USER=kingbase \
-e DB_PASSWORD=abc123 \
-e ENABLE_CI=yes \
-v $HOME/Kingbase_Data:/home/kingbase/userdata \
if010/kingbase:v009r001c001b0025 /usr/sbin/init
```
注意:`if010/kingbase:v009r001c001b0025` 是从官网下载上传至 Docker Hub 的镜像,官网提供了两个下载版本,一个是 `v008r006c008b0014`,另一个是 `v009r001c001b0025`,可以拉取对应的 `tag` 镜像进行测试使用!
#### 参数解释
-- | --
:-- | --
`-itd` | 以后台方式启动容器,保持 STDIN 打开
`-p 5432:54321` | 将主机的 5432 端口映射到容器的 5432 端口,访问数据库
`--name Kingbase` | 给容器指定名称为 "Kingbase"
`--restart=always` | 容器退出时,总是重新启动容器
<!--rehype:className=auto-wrap left-align-->
#### 持久化解释
-- | --
:-- | --
`-v $HOME/Kingbase_Data:/home/kingbase/userdata` | 将容器中的人大金仓数据库数据存储路径 "/home/kingbase/userdata" 映射到本地主机的 "$HOME/Kingbase_Data" 目录,以确保在容器重启时数据得以保留
<!--rehype:className=style-list-arrow-->
#### 环境变量解释
-- | --
:-- | --
`DB_USER` *【可选】* | 设置用户及其密码,默认为 "system"
`DB_PASSWORD` *【可选】* | 设置用户密码,默认为 "123456"
`DB_MODE` *【可选】* | 设置数据库模式,支持的模式有 oracle、pg、mysql
`NEED_START` *【可选】* | 设置进入容器后是否启动数据库,默认为 "yes"
`ENABLE_CI` *【可选】* | 设置是否需要配置大小写敏感,默认为 "yes"
<!--rehype:className=auto-wrap left-align-->
### Redis
```bash
docker run -d -p 6379:6379 --restart=always --name Redis \
-v $HOME/Redis_Data/conf:/usr/local/etc/redis \
-v $HOME/Redis_Data/data:/data \
redis redis-server /usr/local/etc/redis/redis.conf
```
#### 参数解释
-- | --
:-- | --
`-d` | 表示以后台运行的方式启动容器
`-it` | 分别表示分配一个伪终端pseudo-TTY并保持 STDIN 打开
`-p 6379:6379` | 将主机的端口映射到容器的端口,这里是将主机的 6379 端口映射到容器的 6379 端口,用于访问 Redis 数据库
`--name Redis` | 为容器指定一个名称,这里是 "Redis"
`--restart=always` | 表示当容器退出时,总是重新启动容器
<!--rehype:className=style-list-arrow-->
#### 持久化解释
-- | --
:-- | --
`-v $HOME/Redis_Data/conf:/usr/local/etc/redis` | *(需提前准备好文件,否则可能会启动失败)* 将到容器中的 "/usr/local/etc/redis" 路径映射挂载到 宿主机中的"$HOME/Redis_Data/conf"目录下,这样子做的目的是可以自定义Redis的配置文件
`-v $HOME/Redis_Data/data:/data` | 将到容器中的 "/data" 路径映射挂载到 宿主机中的"$HOME/Redis_Data/data"目录下,这样做的目的是将 Redis 数据库的数据存储在本地中,以便数据在容器重启时得以保留
<!--rehype:className=style-list-arrow-->
#### 关于启动命令
-- | --
:-- | --
`redis-server /usr/local/etc/redis/redis.conf` | 容器内部执行该命令是为了按照我们自定义的配置文件启动,这个不是必须的!!!
<!--rehype:className=style-list-arrow-->
### Memcache
```bash
docker run -d -p 11211:11211 --name Memcached \
--restart=always memcached memcached -m 64
```
#### 参数解释
- `-d`: 以后台方式启动容器。
- `-it`: 分配一个伪终端pseudo-TTY并保持 STDIN 打开。
- `-p 11211:11211`: 将主机的 11211 端口映射到容器的 11211 端口,用于访问 Memcached 消息队列的 web 管理界面。
- `--name Memcached`: 容器的名称为 "Memcached"。
- `--restart=always`: 容器退出时,总是重新启动容器。
#### 命令执行解释
- `memcached -m 64` 这会将 Memcached 服务器设置为使用 64 MB 进行存储
### MongoDB
<!--rehype:wrap-class=row-span-2-->
```bash
docker run -d -p 27017:27017 --restart=always --name MongoDB \
-e MONGO_INITDB_ROOT_USERNAME=mongoadmin \
-e MONGO_INITDB_ROOT_PASSWORD=abc123 \
-v $HOME/MongoDB_Data/data:/data/db \
-v $HOME/MongoDB_Data/conf:/etc/mongo \
mongo --config /etc/mongo/mongod.conf --wiredTigerCacheSizeGB 1.5
```
#### 参数解释
-- | --
:-- | --
`-d` | 表示以后台运行的方式启动容器
`-it` | 分别表示分配一个伪终端pseudo-TTY并保持 STDIN 打开
`-p 27017:27017` | 将主机的端口映射到容器的端口,这里是将主机的 27017 端口映射到容器的 27017 端口,用于访问 MongoDB 数据库
`--name MongoDB` | 为容器指定一个名称,这里是 "MongoDB"
`--restart=always` | 表示当容器退出时,总是重新启动容器
`--config /etc/mongo/mongod.conf` | 指定配置文件路径 (这个不是必须的设置此选项之前需准备好mongod.conf文件映射到Docker内部)
`--wiredTigerCacheSizeGB 1.5` | 设置WiredTiger缓存大小限制为1.5G
<!--rehype:className=style-list-arrow-->
#### 持久化解释
-- | --
:-- | --
`-v $HOME/MongoDB_Data/conf:/etc/mongo` | 将到容器中的 "/etc/mongo" 路径映射挂载到 宿主机中的"$HOME/MongoDB_Data/conf"目录下,这样子做的目的是可以自定义MongoDB的配置文件 *(需提前准备好文件,否则可能会启动失败)*
`-v $HOME/Redis_Data/data:/data` | 将到容器中的 "/data/db" 路径映射挂载到 宿主机中的"$HOME/MongoDB_Data/data"目录下,这样做的目的是将 MongoDB 数据库的数据存储在本地中,以便数据在容器重启时得以保留
<!--rehype:className=style-list-arrow-->
#### 环境变量解释
-- | --
:-- | --
`MONGO_INITDB_ROOT_USERNAME` *【可选】* | 该变量是创建管理员用户,该用户是在 admin 身份验证数据库中创建的,并被赋予角色 root这是一个"超级用户"角色。
`MONGO_INITDB_ROOT_PASSWORD` *【可选】* | 该变量是为创建管理员用户设置密码,需配合 `MONGO_INITDB_ROOT_USERNAME` 变量参数使用
<!--rehype:className=style-list-arrow-->
### RabbitMQ
```bash
docker run -itd -p 15672:15672 --name RabbitMQ \
--hostname rmq-test \
-e RABBITMQ_DEFAULT_VHOST=rmq-test \
-e RABBITMQ_DEFAULT_USER=admin \
-e RABBITMQ_DEFAULT_PASS=abc123 \
rabbitmq:3-management
```
#### 参数解释
-- | --
:-- | --
`-itd` | 表示以后台运行的方式启动容器,并分配一个伪终端pseudo-TTY和保持 STDIN 打开
`-p 15672:15672` | 将主机的端口映射到容器的端口,这里是将主机的 15672 端口映射到容器的 15672 端口,用于访问 RabbitMQ 控制台页面内部除了该端口外还开了4369/tcp、5671-5672/tcp、15671/tcp、15691-15692/tcp、25672/tcp
`--name RabbitMQ` | 为容器指定一个名称,这里是 "RabbitMQ"
`--restart=always` | 表示当容器退出时,总是重新启动容器
`--hostname` | 设置容器主机名称
<!--rehype:className=style-list-arrow-->
#### 环境变量解释
-- | --
:-- | --
`RABBITMQ_DEFAULT_VHOST` *【可选】* | 该变量是可选的,是设置 RabbitMQ 的主机名称
`RABBITMQ_DEFAULT_USER` *【可选】* | 该变量是可选的,是设置 RabbitMQ 的账户
`RABBITMQ_DEFAULT_PASS` *【可选】* | 该变量是可选的,是设置 RabbitMQ 的密码
<!--rehype:className=auto-wrap left-align-->
### 远程协助工具 Guacd
<!--rehype:wrap-class=row-span-3-->
```bash
docker run -d -p 4822:4822 --privileged=true \
--restart=always --name Guacd \
-e LANG=zh_CN.UTF-8 \
-v /docker_data/Guacd/rdp-rec:/rdp-rec \
-v /docker_data/Guacd/rdp-file:/rdp-file \
guacamole/guacd
```
#### 参数解释
-- | --
:-- | --
`-d` | 表示以后台运行的方式启动容器
`-it` | 分别表示分配一个伪终端pseudo-TTY并保持 STDIN 打开
`-p 4822:4822` | 将主机的端口映射到容器的端口,这里是将主机的 4822 端口映射到容器的 4822 端口,用于访问 Guacd远程的API接口
`--name Guacd` | 为容器指定一个名称,这里是 "Guacd"
`--restart=always` | 表示当容器退出时,总是重新启动容器
`--privileged=true` | 若不加字段--privileged=true可能会报权限错误
<!--rehype:className=style-list-arrow-->
#### 持久化解释
-- | --
:-- | --
`-v /docker_data/Guacd/rdp-rec:/rdp-rec` | 代码内固定配置guacd服务rdp录屏文件存放路径
`-v /docker_data/Guacd/rdp-file:/rdp-file` | 代码内固定配置guacd服务rdp远程磁盘文件存放路
<!--rehype:className=style-list-arrow-->
#### 环境变量解释
- `LANG` 设置字符编码格式
### 在线代码编辑器 Code Server
```bash
@@ -612,47 +1132,6 @@ $ docker run -it --name code-server \
codercom/code-server:latest
```
### MySQL
```bash
$ docker run --name mysql \
-p 3306:3306 \
-v $HOME/mysql/conf.d:/etc/mysql/conf.d \
-v $HOME/mysql/data:/var/lib/mysql \
-v /etc/localtime:/etc/localtime:ro \
-e MYSQL_ROOT_PASSWORD=123456 \
-d mysql:5.7.23
```
### Redis
```bash
$ docker run -d --name myredis \
-v $HOME/redis/conf:/usr/local/etc/redis \
-v /etc/localtime:/etc/localtime:ro \
redis redis-server /usr/local/etc/redis/redis.conf
```
### Nginx
```bash
$ docker run --name my-nginx \
-v "$HOME/nginx/nginx.conf:/etc/nginx/nginx.conf:ro" \
-v "$HOME/nginx/html:/usr/share/nginx/html:ro" \
-p 8080:80 \
-d nginx
```
### PostgreSQL
```bash
$ docker run --name my-postgres \
-e POSTGRES_PASSWORD=mysecretpassword \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-v $HOME/nginx/mount:/var/lib/postgresql/data \
-d postgres
```
### 媒体管理工具 Dim
```bash
@@ -686,3 +1165,4 @@ $ docker run -d --name gitlab \
- [Dockerfile 备忘清单](./dockerfile.md) *(github.io)*
- [Docker 官方入门教程](https://docs.docker.com/get-started/) *(docker.com)*
- [Docker入门学习笔记](https://jaywcjlove.github.io/docker-tutorial) *(github.io)*
- [快速安装Docker及配置及Docker配置、Docker常用命令](https://www.loganjin.cn/article/docker-install/)

View File

@@ -28,7 +28,7 @@ FROM [--platform=<platform>] <image> [AS <name>]
示例
```dockerfile
FROM ruby:3.2.2
FROM ruby:3.3.0
FROM golang:1.20-alpine3.16 AS build-env
```

606
docs/elasticsearch.md Normal file
View File

@@ -0,0 +1,606 @@
Elasticsearch 备忘清单
===
这是 [Elasticsearch](https://www.elastic.co/guide/index.html) 的官方文档。 你可以在这里找到 elasticsearch 的所有文档。
入门
---
### 入门
<!--rehype:wrap-class=row-span-2-->
Elasticsearch 是一个基于 Lucene 库的搜索引擎。它提供了一个分布式、支持多租户的全文搜索引擎具有HTTP Web接口和无模式JSON文档。
#### 下载
注意: `${VERSION}` 需替换为指定版本,官方包有的功能只能试用,完整功能需要付费,请仔细阅读官网文档。
#### Windows
```
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}-windows-x86_64.zip
```
<!--rehype:className=wrap-text-->
#### linux
```shell
$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}-linux-x86_64.tar.gz
$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}-linux-x86_64.tar.gz.sha512
$ shasum -a 512 -c elasticsearch-${VERSION}-linux-x86_64.tar.gz.sha512
$ tar -xzf elasticsearch-${VERSION}-linux-x86_64.tar.gz
$ cd elasticsearch-${VERSION}/
```
<!--rehype:className=wrap-text-->
#### macos
```shell
$ curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}-darwin-x86_64.tar.gz
$ curl https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}-darwin-x86_64.tar.gz.sha512 | shasum -a 512 -c -
$ tar -xzf elasticsearch-${VERSION}-darwin-x86_64.tar.gz
$ cd elasticsearch-${VERSION}/
```
<!--rehype:className=wrap-text-->
### 启动
<!--rehype:wrap-class=col-span-2-->
- 启动 Elasticsearch
```shell
$ ./bin/elasticsearch
```
- 设置密码
```shell
export ELASTIC_PASSWORD="your_password"
```
- 测试是否启动成功
```shell
curl --cacert $ES_HOME/config/certs/http_ca.crt -u elastic:$ELASTIC_PASSWORD https://localhost:9200
```
<!--rehype:className=wrap-text-->
- 成功则返回样例如下:
```json
{
"name" : "Cp8oag6",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "AT69_T_DTp-1qgIJlatQqA",
"version" : {
"number" : "${VERSION}",
"build_type" : "tar",
"build_hash" : "f27399d",
"build_flavor" : "default",
"build_date" : "2016-03-30T09:51:41.449Z",
"build_snapshot" : false,
"lucene_version" : "9.10.0",
"minimum_wire_compatibility_version" : "1.2.3",
"minimum_index_compatibility_version" : "1.2.3"
},
"tagline" : "You Know, for Search"
}
```
<!--rehype:className=style-timeline-->
### Elasticsearch 和 RDMS 的对比
| RDMS | elasticsearch |
| ----------------------- | ----------------- |
| 数据库(database) | 索引(index) |
| 表(table) | 类型(type) |
| 行(row) | 文档(document) |
| 列(column) | 字段(field) |
| 表结构 | 映射 |
| 索引 | 全文索引 |
| SQL | 查询DSL |
| SELECT * FROM tablename | GET http://... |
| UPDATE table SET | PUT http://... |
| DELETE | DELETE http://... |
<!--rehype:className=left-align show-header-->
操作
---
### 基础语法规则
```shell
$ curl -X<VERB> '<PROTOCOL>://<HOST>:<PORT>/<PATH>?<QUERY_STRING>' -d '<BODY>'
```
<!--rehype:className=wrap-text-->
- `VERB HTTP` 方法GET, POST, PUT, HEAD, DELETE
- `PROTOCOL`http 或者 https 协议(只有在 Elasticsearch 前面有 https 代理的时候可用)
- `HOST`Elasticsearch 集群中的任何一个节点的主机名,如果是在本地的节点,那么就叫 localhost
- `PORT`Elasticsearch HTTP 服务所在的端口,默认为 9200
- `PATH API 路径`例如_count 将返回集群中文档的数量PATH可以包含多个组件例如_cluster/stats 或者_nodes/stats/jvm
- `QUERY_STRING`:一些可选的查询请求参数,例如?pretty 参数将使请求返回更加美观易读的 JSON 数据
- `BODY`:一个 JSON 格式的请求主体(如果请求需要的话)
### 创建索引
<!--rehype:wrap-class=col-span-2 row-span-3-->
#### 统一请求 api 前缀
```
http://localhost:9200/
```
#### DSL语法
```json
PUT /user_info
{
"settings": { "number_of_replicas": 1, "number_of_shards": 1 },
"mappings": {
"properties": {
"id": { "type": "long", "index": true },
"username": { "type": "keyword", "index": true },
"nickname": { "type": "keyword", "index": true },
"password": { "type": "keyword", "index": false },
"age": { "type": "integer", "index": true },
"info": { "type": "text", "index": true },
"remark": { "type": "text", "index": true }
}
}
}
```
#### curl
```shell
curl -XPUT "http://localhost:9200/user_info" -H 'Content-Type: application/json' -d'{ "settings": { "number_of_replicas": 1, "number_of_shards": 1 }, "mappings": { "properties": { "id": { "type": "long", "index": true }, "username": { "type": "keyword", "index": true }, "nickname": { "type": "keyword", "index": true }, "password": { "type": "keyword", "index": false }, "age": { "type": "integer", "index": true }, "info": { "type": "text", "index": true }, "remark": { "type": "text", "index": true } } } }'
```
<!--rehype:className=wrap-text-->
#### 参数说明
- `settings`: 设置索引的信息
- `number_of_shards`: 每个索引的主分片数,一旦索引创建后,无法修改此配置
- `number_of_replicas`: 每个主分片的副本数,此配置可随时修改
- `mappings`: 索引映射定义
- `properties`: 字段定义。使用 JSON 配置,键为字段名称(自定义),值为嵌套 JSON其中 `type` 指定字段的类型
其他参数很多,请参考官网资料
### 删除索引
#### DSL语法
```http
DELETE /user_info
```
#### curl
```shell
curl -XDELETE "http://localhost:9200/user_info"
```
<!--rehype:className=wrap-text-->
### 判断索引是否存在
#### DSL语法
```http
# 查看索引是否存在
HEAD /user_info
```
#### curl
```shell
# 查看索引是否存在
curl -XHEAD "http://localhost:9200/user_info"
```
<!--rehype:className=wrap-text-->
### 开启/关闭索引
#### 开启DSL语法
```shell
POST /user_info/_open
```
`curl`
```shell
curl -XPOST "http://localhost:9200/user_info/_open"
```
<!--rehype:className=wrap-text-->
#### 关闭 DSL 语法
```shell
POST /user_info/_close
```
`curl`
```shell
curl -XPOST "http://localhost:9200/user_info/_close"
```
<!--rehype:className=wrap-text-->
### 索引的别名
<!--rehype:wrap-class=col-span-2-->
- 添加别名 DSL 语法
```shell
POST /user_info/_alias/user1
```
```shell
curl -XPOST "http://localhost:9200/user_info/_alias/user1"
```
- 删除别名DSL语法
```shell
DELETE /user_info/_alias/user1
```
```shell
curl -XDELETE "http://localhost:9200/user_info/_alias/user1"
```
- 查看别名DSL语法
```shell
GET /_alias/user1
```
```shell
curl -XGET "http://localhost:9200/_alias/useraa"
```
Mapping 操作
---
类似修改数据库中列的操作
### 查看 mapping
#### DSL语法
```shell
GET /user_info/_mapping
```
---
```shell
curl -XGET "http://localhost:9200/user_info/_mapping"
```
<!--rehype:className=wrap-text-->
### 新增 mapping
<!--rehype:wrap-class=col-span-2-->
#### DSL语法
```shell
PUT /user_info/_mapping
{
"properties":{
"sex":{ "type":"keyword" }
}
}
```
---
```shell
curl -XPUT "http://localhost:9200/user_info/_mapping" -H 'Content-Type: application/json' -d'{ "properties":{ "sex":{ "type":"keyword" } } }'
```
<!--rehype:className=wrap-text-->
`注意`: 需要注意的是字段映射只能增加,不能更改删除
文档的操作
---
### 添加文档
<!--rehype:wrap-class=row-span-2-->
#### 新增一条数据 - DSL语法
```shell
POST /user_info/_doc/1
{
"id":1,
"username":"username",
"password":"123456",
"nickname":"nickname",
"age":18,
"info":"一些个人相关的介绍",
"remark":"备注信息",
"sex":"男"
}
```
---
```shell
curl -XPOST "http://localhost:9200/user_info/_doc/1" -H 'Content-Type: application/json' -d'{ "id":1, "username":"username", "password":"123456", "nickname":"nickname", "age":18, "info":"一些个人相关的介绍", "remark":"备注信息", "sex":"男" }'
```
<!--rehype:className=wrap-text-->
### 查询指定索引的所有文档
<!--rehype:wrap-class=row-span-2-->
类似数据库中的 `select * from user_info;`
#### DSL语法
```json
GET /user_info/_search
{
"query": {
"match_all": {}
}
}
```
---
```shell
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "query": { "match_all": {} } }'
```
<!--rehype:className=wrap-text-->
### 通过 id 查询文档
类似数据库中的 `select * from user_info where id = 1;`
#### DSL语法
```shell
GET /user_info/_doc/1
```
---
```shell
curl -XGET "http://localhost:9200/user_info/_doc/1"
```
<!--rehype:className=wrap-text-->
### 模糊查找
类似数据库中的模糊查询 `select * from user_info where info like '%人%';`
#### DSL语法
```json
GET /user_info/_search
{
"query": { "match": { "info": "人" } }
}
```
### 通过条件查询文档
<!--rehype:wrap-class=col-span-2-->
类似数据库中的 `select * from user_info where username = 'username';`
#### 通过条件查询 - DSL语法
```json
GET /user_info/_search
{
"query": {
"bool": {
"must": [ { "term": { "username": "username" } } ]
}
}
}
```
---
```shell
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "query": { "bool": { "must": [ { "term": { "username": "username" } } ] } } }'
```
<!--rehype:className=wrap-text-->
### 范围查找
类似数据库中的范围查询 `select * from user_info where age between 18 and 30;`
#### DSL语法
```json
GET /user_info/_search
{
"query": {
"range": {
"age": {
"gt": 18,
"lt": 30
}
}
}
}
```
---
```shell
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "query": { "range": { "age": { "gt": 18, "lt": 30 } } } }'
```
<!--rehype:className=wrap-text-->
### and 查询
<!--rehype:wrap-class=col-span-2-->
类似数据库中的 and 查询 `select * from user_info where age > 18 and sex = '男';`
#### DSL语法
```json
GET /user_info/_search
{
"query": {
"bool": {
"must": [
{ "range": { "age": { "gt": 18 } } },
{ "term": { "sex": "男" } }
]
}
}
}
```
---
```shell
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "query": { "bool": { "must": [ { "range": { "age": { "gt": 17 } } }, { "term": { "sex": "男" } } ] } } }'
```
<!--rehype:className=wrap-text-->
### limit 查找
类似数据库中的 limit 查询 `select * from user_info limit 10;`
#### DSL语法
```json
GET /user_info/_search
{
"size": 10,
"query": {
"match_all": {}
}
}
```
---
```shell
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "size": 1, "query": { "match_all": {} } }'
```
<!--rehype:className=wrap-text-->
### limit offset 查找
类似数据库中的 limit 查询 `select * from user_info limit 0,10;`
#### DSL语法
```http
GET /user_info/_search
{
"size": 2,
"from": 1,
"query": {
"match_all": {}
}
}
```
---
```shell
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "size": 2, "from": 1, "query": { "match_all": {} } }'
```
<!--rehype:className=wrap-text-->
#### 参数说明
- `size`: 10 表示我们想要返回的结果数量是10条
- `from`: 20 表示我们想要从结果集中的第21条记录开始返回因为偏移是从0开始的
- `query`: `{"match_all": {}}` 是一个匹配所有文档的查询,因为我们没有特定的查询条件,只是想要分页结果
### or 查询
<!--rehype:wrap-class=col-span-2-->
类似数据库中的 or 查询 `select * from user_info where age > 18 or sex = '男';`
#### DSL语法
```json
GET /user_info/_search
{
"query": {
"bool": {
"should": [
{
"range": {
"age": { "gt": 18 }
}
},
{
"term": { "sex": "男" }
}
]
}
}
}
```
---
```shell
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "query": { "bool": { "should": [ { "range": { "age": { "gt": 18 } } }, { "term": { "sex": "男" } } ] } } }'
```
<!--rehype:className=wrap-text-->
删除文档
---
### 删除指定 id
类似数据库中的 delete 查询 `delete from user_info where id = 3;`
#### DSL语法
```shell
# 删除文档
DELETE /user_info/_doc/3
```
---
```shell
# 删除文档
curl -XDELETE "http://localhost:9200/user_info/_doc/3"
```
<!--rehype:className=wrap-text-->
### 删除指定条件
<!--rehype:wrap-class=col-span-2-->
类似数据库中的 delete 查询 `delete from user_info where age > 18;`
#### DSL语法
```json
POST /user_info/_delete_by_query
{
"query": {
"range": { "age": { "gt": 18 } }
}
}
```
---
```shell
curl -XPOST "http://localhost:9200/user_info/_delete_by_query" -H 'Content-Type: application/json' -d'{"query":{"range":{"age":{"gt":18}}}}'
```
<!--rehype:className=wrap-text-->

802
docs/elixir.md Normal file
View File

@@ -0,0 +1,802 @@
Elixir 备忘清单
===
提供基本语法和方法的 Elixir 快速参考备忘单。
入门
------
### 安装 Elixir
<!--rehype:wrap-class=row-span-2-->
Elixir 自带了 `iex` 这样一个交互 shell可以随时计算 Elixir 表达式的值,运行`iex`命令,继续输入几个简单的表达式试试:
```shell
iex 2+3
5
iex 2+3 == 5
true
iex String.length("快速的狐狸跳过了懒惰的狗")
43
```
每个操作系统的文档可以在[官网](https://elixir-lang.org)网站上 [Installing Elixir](http://elixir-lang.org/install.html) 部分找到
### hello.exs
```elixir
IO.puts("Hello world from Elixir")
```
Elixir 运行命令
```shell
$ elixir hello.exs
```
### 基本类型
<!--rehype:wrap-class=row-span-3-->
Elixir 支持多种基本类型:整数、浮点、布尔值、原子和字符串。其他数据类型,如列表和元组
```elixir
# integer 整数
iex> 1
# integer支持2进制、8进制和16进制的整数
iex> 0x1F
# float
iex> 1.0
# boolean
iex> true
# atom / symbol
iex> :atom
# string
iex> "elixir"
# list
iex> [1, 2, 3]
# tuple
iex> {1, 2, 3}
```
### 注释
```elixir
# 这是一个单行注释
```
### 字符串插值与拼接
```elixir
iex> name = "Sean"
iex> "Hello #{name}"
"Hello Sean"
iex> "Hello " <> "world!"
"Hello world!"
```
### 变量和模式匹配
```elixir
x = 1
# => x 现在等于 1
{a, b} = {1, 2}
# => a 等于 1b 等于 2
```
在 Elixir 中,使用 `=` 来进行赋值操作,但实际上是模式匹配。左边是模式,右边是值
### 原子Atoms
```elixir
:ok
```
原子是常量,它们的名称就是它们的值
### 列表Lists
```elixir
list = [1, 2, 3]
```
### 元组Tuples
```elixir
tuple = {:ok, "value"}
```
### 函数定义
```elixir
defmodule MyModule do
def my_function(parameter) do
# 函数体
end
end
```
### 匿名函数
```elixir
add = fn a, b -> a + b end
```
### 控制结构
<!--rehype:wrap-class=row-span-2-->
`if/else`
```elixir
if x > 0 do
"Positive"
else
"Non-positive"
end
```
`case`
```elixir
case {1, 2} do
{1, x} -> "Matched #{x}"
_ -> "Not matched"
end
```
`cond`
```elixir
cond do
x > 2 -> "Greater than 2"
x == 2 -> "Equal to 2"
true -> "Less than 2"
end
```
### 基本算术
<!--rehype:wrap-class=row-span-4-->
```elixir
iex> 1 + 2
3
iex> 5 * 5
25
iex> 10 / 2
5.0
```
运算符`/`总是返回一个 float。如果你想做整数除法或得到除法余数你可以调用 div 和 rem 函数:
```elixir
iex> div(10, 2)
5
```
允许在调用需要一个或多个参数的函数时删除括号
```elixir
iex> div 10, 2
5
iex> rem 10, 3
1
```
可以调用 round 函数来获取与给定浮点数最接近的整数,或者调用 trunc 函数来获取浮点数的整数部分
```elixir
iex> round(3.58)
4
iex> trunc(3.58)
3
```
可以使用 is_integer、is_float 或 is_number 分别检查参数是否为 integer、float 或 number 类型
```elixir
iex> is_integer(1)
true
iex> is_float(2.0)
true
iex> is_number(2.0)
false
```
### 布尔算术
<!--rehype:wrap-class=row-span-4-->
Elixir 提供了 `||``&&``!` 布尔操作符,它们支持任何类型的操作:
```elixir
iex> -20 || true
-20
iex> false || 42
42
iex> 42 && true
true
iex> 42 && nil
nil
iex> !42
false
iex> !false
true
```
还有三个操作符and、or、not它们的第一个参数**必须是布尔类型**true 和 false:
```elixir
iex> true and 42
42
iex> false or true
true
iex> not false
true
iex> 42 and true
** (ArgumentError) argument error: 42
iex> not 42
** (ArgumentError) argument error
```
### 模块和函数导入
```elixir
import List, only: [duplicate: 2]
```
### 管道操作符
```elixir
result = data
|> process1()
|> process2()
```
`|>` 用于链式调用函数,将前一个函数的结果作为下一个函数的第一个参数
### 比较运算符
比较运算符 `==`, `!=`, `===`, `!==`, `<=`, `>=`, `<``>`
```elixir
iex> 1 > 2
false
iex> 1 != 2
true
iex> 2 == 2
true
iex> 2 <= 3
true
```
集合
------
>
> 列表list、元组tuple、关键字列表keyword list、映射map
>
### 列表List
<!--rehype:wrap-class=row-span-2-->
```elixir
iex> [3.14, :pie, "Apple"]
[3.14, :pie, "Apple"]
iex> list = [3.14, :pie, "Apple"]
iex> [3.14, :pie, "Apple"]
```
列表的开头添加元素
```elixir
iex> ["π" | list]
["π", 3.14, :pie, "Apple"]
```
列表的尾部添加元素/列表拼接
```elixir
iex> list ++ ["Cherry"]
[3.14, :pie, "Apple", "Cherry"]
```
获取列表的头部元素
```elixir
iex> hd [3.14, :pie, "Apple"]
3.14
```
获取列表的尾部元素
```elixir
iex> tl [3.14, :pie, "Apple"]
[:pie, "Apple"]
```
### 元组Tuple
```elixir
iex> {3.14, :pie, "Apple"}
{3.14, :pie, "Apple"}
```
### 关键字列表Keyword List
```elixir
iex> [foo: "bar", hello: "world"]
[foo: "bar", hello: "world"]
iex> [{:foo, "bar"}, {:hello, "world"}]
[foo: "bar", hello: "world"]
```
关键字列表非常重要,它有以下的特性:
-key都是原子atom
-key是有序的定义后顺序不会改变
-key不必是唯一的
因为这些原因,常见的用法是作为参数传递给函数
### 映射Map
Elixir 的映射maps是键值对结构的第一选择和关键字列表keywords不同映射允许任意类型的数据作为键而且数据并不严格排序。 你可以使用 %{} 来定义映射:
```elixir
iex> map = %{:foo => "bar", "hello" => :world}
%{:foo => "bar", "hello" => :world}
iex> map[:foo]
"bar"
iex> map["hello"]
:world
```
模式匹配
------
>
> 模式匹配是 Elixir 很强大的特性,它允许我们匹配简单值、数据结构、甚至函数。
>
### 匹配元组
```elixir
iex> {a, b, c} = {:hello, "world", 42}
{:hello, "world", 42}
iex> a
:hello
iex> b
"world"
```
### 匹配列表
```
iex> [a, b, c] = [1, 2, 3]
[1, 2, 3]
iex> a
1
```
### 匹配列表的头部元素
```
iex> [head | tail] = [1, 2, 3]
[1, 2, 3]
iex> head
1
iex> tail
[2, 3]
```
### Pin 操作符
pin 操作符,就是用已经绑定的值去匹配,而不是重新绑定一个新值。
```elixir
iex> {x, ^x} = {2, 1}
{2, 1}
iex> x
2
```
### 使用下划线 `_` 忽略匹配的值
```elixir
iex> [head | _] = [1, 2, 3]
[1, 2, 3]
iex> head
1
```
控制语句
------
### if/else/end
```elixir
if condition do
# 条件成立时执行的代码
else
# 条件不成立时执行的代码
end
```
### case/end
```elixir
case expression do
pattern1 -> # 匹配 pattern1 时执行的代码
pattern2 -> # 匹配 pattern2 时执行的代码
_ -> # 其他情况执行的代码
end
```
### cond/end
```elixir
cond do
condition1 -> # 条件1成立时执行的代码
condition2 -> # 条件2成立时执行的代码
true -> # 如果没有任何条件成立,执行这里的代码
end
```
### unless/do/end
```elixir
unless condition do
# 条件为假时执行的代码
end
```
### try/rescue/end
```elixir
try do
# 可能会引发异常的代码
rescue
pattern1 -> # 匹配 pattern1 的异常处理代码
pattern2 -> # 匹配 pattern2 的异常处理代码
_ -> # 其他异常处理代码
end
```
### case
<!--rehype:wrap-class=row-span-2-->
允许将一个值与许多模式进行比较,直到找到匹配的模式:
```elixir
iex> case {1, 2, 3} do
{4, 5, 6} ->
"This clause won't match"
{1, x, 3} ->
"该子句将匹配并绑定 x 到该子句中的 2"
_ ->
"This clause would match any value"
end
"该子句将匹配并绑定 x 到该子句中的 2"
```
还可以使用when指定额外的条件
```elixir
iex> case {1, 2, 3} do
{1, x, 3} when x > 0 ->
"Will match"
_ ->
"如果不满足保护条件,将匹配"
end
"Will match"
```
### cond
当我们需要根据条件进行匹配而不是值时,类似于其他语言的 `else if``elsif`,可以使用 `cond` 控制结构。
```elixir
iex> cond do
2 + 2 == 5 ->
"This will not be true"
2 * 2 == 3 ->
"Nor this"
1 + 1 == 2 ->
"But this will"
end
"But this will"
```
如果所有的条件都返回 `nil``false`则会引发一个错误CondClauseError。因此需要添加一个 `final` 条件,等于 `true`,它将始终匹配:
```elixir
iex> cond do
2 + 2 == 5 ->
"This is never true"
2 * 2 == 3 ->
"Nor this"
true ->
"这始终为真(等同于 else"
end
"这始终为真(等同于 else"
```
### 变量的作用域
如果在if、case和类似的构造中声明或更改了任何变量则声明和更改将只在构造中可见。
```elixir
iex> x = 1
1
if true do
x = x + 1
end
2
iex> x
1
```
如果要更改值则必须从if返回值
```elixir
iex> x = 1
1
iex> x = if true do
x + 1
else
x
end
2
```
函数
------
### 函数定义
```elixir
def function_name(param1, param2) do
# 函数体
end
```
示例:
```elixir
def sum(a, b) do
a + b
end
```
### 模式匹配的多个函数定义
<!--rehype:wrap-class=row-span-2-->
```elixir
def fun_name(:atom) do
# 对于 :atom 的处理
end
def fun_name("string") do
# 对于 "string" 的处理
end
def fun_name(number) when is_integer(number) do
# 对于整数的处理
end
```
示例:
```elixir
def is_positive(number) when number > 0 do
true
end
def is_positive(_), do: false
```
### 函数调用
```elixir
module_name.function_name(arg1, arg2)
```
示例:
```elixir
Enum.map([1, 2, 3], &(&1 * 2))
```
### 函数参数默认值
```elixir
def function_name(parameter \\ 默认值) do
# 函数体
end
```
示例:
```elixir
def greet(name \\ "World") do
"Hello, #{name}!"
end
```
### 可变参数数量
```elixir
def function_name(param1, param2 \\ []) do
# 函数体
end
```
示例:
```elixir
def sum(numbers) do
Enum.sum(numbers)
end
```
### 函数文档注释
```elixir
@doc """
这是函数的文档。
"""
```
示例:
```elixir
@doc """
Adds two numbers together.
## 示例
iex> MyModule.add(1, 2)
3
"""
def add(a, b) do
a + b
end
```
这些是 Elixir 函数语法的基本要点,可以帮助你开始编写函数。
### 匿名函数
```elixir
iex> sum = fn (a, b) -> a + b end
iex> sum.(2, 3)
5
```
可以使用 & 语法来简化匿名函数的定义:
```elixir
iex> sum = &(&1 + &2)
iex> sum.(2, 3)
5
```
### 闭包
匿名函数去引用外部的变量,这通常被称为闭包。
```elixir
iex> double = fn a -> add.(a, a) end
#Function<6.71889879/1 in :erl_eval.expr/5>
double.(2)
4
```
闭包与守卫
```elixir
iex> f = fn
x, y when x > 0 -> x + y
x, y -> x * y
end
iex> f.(1, 3)
4
iex> f.(-1, 3)
-3
```
### 命名函数
命名函数是通过 def 关键字定义在某个模块中
```elixir
defmodule Greeter do
def hello(name) do
"Hello, " <> name
end
end
iex> Greeter.hello("Sean")
"Hello, Sean"
```
简写为一行:
```elixir
defmodule Greeter do
def hello(name), do: "Hello, " <> name
end
```
私有函数
```elixir
defmodule Greeter do
def hello(name), do: phrase <> name
# 使用defp来定义私有函数
defp phrase, do: "Hello, "
end
```
函数的默认参数:使用 `\\` 来定义默认参数
```elixir
defmodule Greeter do
def hello(name, language_code \\ "en") do
phrase(language_code) <> name
end
defp phrase("en"), do: "Hello, "
defp phrase("es"), do: "Hola, "
end
```
Enumerables 与 Streams
------
>
> Elixir 提供了 Enum 和 Stream 两个模块,用于处理集合。
>
### Enum
>
> Enum 模块提供了对集合的常用操作,如 map、filter、reduce、sort、chunk、join、into 等。
```elixir
iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
[2, 4, 6]
iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
[2, 12]
```
### Stream
>
> 作为Enum的替代品Elixir提供了支持懒惰操作的Stream模块
```elixir
iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(odd?) |> Enum.sum()
7500000000
```
> 流文件操作
```elixir
iex> stream = File.stream!("path/to/file")
%File.Stream{
line_or_bytes: :line,
modes: [:raw, :read_ahead, :binary],
path: "path/to/file",
raw: true
}
Enum.take(stream, 10)
# 上面的例子将提取所选文件的前10行。这意味着流对于处理大型文件甚至是网络资源等慢速资源非常有用。
```
另见
----
- [Elixir 官方](https://elixir-lang.org/) _(elixir-lang.org)_
- [Elixir School](https://elixirschool.com/) _(elixirschool.com)_

View File

@@ -78,9 +78,9 @@ $ emacs
:- | :-
:- | :-
`C-g` | 中止部分键入或执行的命令
`M-x` 恢复会话 | 恢复因系统崩溃而丢失的文件
`M-x` recover-session | 恢复因系统崩溃而丢失的文件
`C-x` `u` `C-_` `C-/` | 撤消不需要的更改
`M-x` 恢复缓冲器 | 将缓冲区恢复到其原始内容
`M-x` revert-buffer | 将缓冲区恢复到其原始内容
`C-l` | 重绘垃圾屏幕
<!--rehype:className=shortcuts-->
@@ -293,9 +293,9 @@ $ emacs
:- | :-
`M-.` | 查找标签(定义)
`C-u` `M-.` | 查找标签的下一个出现
`M-x` 访问标签表 | 指定一个新的标签文件
`M-x` 标签搜索 | 正则表达式搜索标签表中的所有文件
`M-x` 标签查询替换 | 对所有文件运行查询替换
`M-x` visit-tags-table | 指定一个新的标签文件
`M-x` tags-search | 正则表达式搜索标签表中的所有文件
`M-x` tags-query-replace | 对所有文件运行查询替换
`M-,` | 继续最后一个标签搜索或查询替换
<!--rehype:className=shortcuts-->
@@ -494,9 +494,9 @@ Emacs 搜索
:- | :-
:- | :-
`M-$` | 检查当前单词的拼写
`M-x` ispell 地区 | 检查区域内所有单词的拼写
`M-x` ispell 缓冲区 | 检查整个缓冲区的拼写
`M-x` flyspell 模式 | 切换即时拼写检查
`M-x` ispell-region | 检查区域内所有单词的拼写
`M-x` ispell-buffer | 检查整个缓冲区的拼写
`M-x` flyspell-mode | 切换即时拼写检查
<!--rehype:className=shortcuts-->
### 编写命令

450
docs/erlang.md Normal file
View File

@@ -0,0 +1,450 @@
Erlang 备忘清单
===
[Erlang](https://www.erlang.org/) 是一种用于构建并发、分布式和容错系统的编程语言。以下是一些常用的命令和操作。
入门
---
### 启动 Erlang Shell
```shell
erl
```
### 编译代码
<!--rehype:wrap-class=row-span-2-->
```shell
# 在 Erlang Shell 中编译
c(module).
# 在命令行中编译
erlc module.erl
```
### 运行代码
<!--rehype:wrap-class=row-span-2-->
```shell
# 在 Erlang Shell 中运行
module:function().
# 从命令行运行
erl -noshell -s module function -s init stop
```
### 退出 Erlang Shell
```shell
q().
```
代码结构
---
### 模块定义
```erlang
-module(module_name).
-export([function_name/arity, ...]).
function_name(Args) ->
% Function body.
Result.
```
### 导出函数
```erlang
-export([function1/0, function2/1]).
```
### 注释
```erlang
% 单行注释
% 这是一个注释
```
### 变量
```erlang
VarName = Value. % 变量名必须以大写字母开头
Age = 25.
Name = "Alice".
```
数据类型
---
### 原子
```erlang
atom. % 例子atom, 'Atom with spaces'
```
### 数字
```erlang
123. % 整数
3.14. % 浮点数
```
### 布尔值
```erlang
true.
false.
```
### 字符串
```erlang
"Hello, World!".
```
### 元组
```erlang
{ok, "Success"}.
```
### 列表
```erlang
[1, 2, 3].
[H|T] = [1, 2, 3]. % H = 1, T = [2, 3]
```
### 字典 (Map)
```erlang
#{key1 => value1, key2 => value2}.
```
控制结构
---
### 条件语句
```erlang
if
Condition1 -> Expression1;
Condition2 -> Expression2;
true -> DefaultExpression
end.
```
### case 表达式
```erlang
case Expression of
Pattern1 -> Expression1;
Pattern2 -> Expression2;
_ -> DefaultExpression
end.
```
### 函数定义
```erlang
% 无参函数
my_function() ->
ok.
% 有参函数
add(A, B) ->
A + B.
```
列表操作
---
### 列表生成
```erlang
% 生成 1 到 10 的列表
[ X || X <- lists:seq(1, 10)].
% 生成 1 到 10 中的偶数
[ X || X <- lists:seq(1, 10), X rem 2 == 0].
```
并发
---
### 启动进程
```erlang
spawn(Module, Function, Args).
% 示例
Pid = spawn(fun() -> io:format("Hello from process~n") end).
```
### 发送消息
```erlang
Pid ! Message.
% 示例
Pid ! {hello, self()}.
```
### 接收消息
```erlang
receive
Pattern1 -> Expression1;
Pattern2 -> Expression2;
after Timeout -> TimeoutExpression
end.
```
### 模式匹配
```erlang
{ok, Value} = {ok, 42}.
```
常用内置函数 (BIFs)
---
### 列表操作
```erlang
lists:append(List1, List2).
lists:map(Function, List).
lists:filter(Function, List).
lists:foldl(Function, Acc, List).
```
### 元组操作
```erlang
element(N, Tuple).
setelement(N, Tuple, Value).
tuple_size(Tuple).
```
### 字符串操作
```erlang
string:len(String).
string:concat(String1, String2).
string:tokens(String, Delimiters).
```
### 文件操作
```erlang
file:read_file(Filename).
file:write_file(Filename, Data).
file:delete(Filename).
```
### 列表操作
```erlang
lists:map(fun(X) -> X * 2 end, [1, 2, 3]).
lists:filter(fun(X) -> X rem 2 == 0 end, [1, 2, 3, 4]).
```
### 字符串操作
```erlang
string:len("Hello").
string:upper("hello").
```
### 文件操作
```erlang
{ok, File} = file:open("test.txt", [write]).
file:write(File, "Hello, file!").
file:close(File).
```
### 示例:简单的服务器
```erlang
-module(server).
-export([start/0, loop/0]).
start() ->
spawn(fun loop/0).
loop() ->
receive
{echo, Msg} ->
io:format("Echo: ~p~n", [Msg]),
loop();
stop ->
io:format("Server stopping~n"),
ok;
_ ->
io:format("Unknown message~n"),
loop()
end.
```
并发编程
---
### 创建进程
```erlang
Pid = spawn(Module, Function, Args).
```
### 发送消息
```erlang
Pid ! Message.
```
### 接收消息
```erlang
receive
Pattern1 -> Actions1;
Pattern2 -> Actions2;
...
end.
```
### 链接进程
```erlang
link(Pid).
unlink(Pid).
```
### 监控进程
```erlang
MonitorRef = erlang:monitor(process, Pid).
erlang:demonitor(MonitorRef).
```
错误处理
---
### 捕获异常
```erlang
try Expression of
Pattern -> Result
catch
Class:Reason -> Handler
end.
```
### 常见异常类型
- `throw`
- `error`
- `exit`
### 错误处理
```erlang
try Expression of
Pattern -> Result
catch
Type:Reason -> ErrorHandlingExpression
end.
```
分布式编程
---
### 启动分布式节点
```shell
erl -name nodename@hostname -setcookie Cookie
```
### 连接节点
```erlang
net_adm:ping(Node).
```
### 发送消息到远程节点
```erlang
{remote_process, 'remote_node@host'} ! Message.
```
OTP 框架
---
### 定义 GenServer
```erlang
-module(my_gen_server).
-behaviour(gen_server).
-export([start_link/0, init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
init([]) ->
{ok, #state{}}.
handle_call(Request, From, State) ->
{reply, Reply, State}.
handle_cast(Msg, State) ->
{noreply, State}.
handle_info(Info, State) ->
{noreply, State}.
terminate(Reason, State) ->
ok.
code_change(OldVsn, State, Extra) ->
{ok, State}.
```
### 使用 GenServer
```erlang
gen_server:start_link({local, Name}, Module, Args, Options).
gen_server:call(ServerRef, Request).
gen_server:cast(ServerRef, Msg).
```
测试
---
### 编写 EUnit 测试
```erlang
-module(module_name_tests).
-include_lib("eunit/include/eunit.hrl").
simple_test() ->
?assertEqual(Expected, Actual).
complex_test_() ->
[
{"Test case 1", ?_assertEqual(Expected1, Actual1)},
{"Test case 2", ?_assertEqual(Expected2, Actual2)}
].
```
### 运行 EUnit 测试
```shell
# 在命令行中运行
erl -eval "eunit:test(module_name)" -s init stop
```
另见
---
- [Erlang 官方文档](https://www.erlang.org/docs)
- [Erlang 编程书籍](https://learnyousomeerlang.com/content)

View File

@@ -1,11 +1,39 @@
FastAPI 备忘清单
===
FastAPI 是一个用于构建 API 的现代、快速(高性能)的 web 框架,使用 Python 3.6+ 并基于标准的 Python 类型提示。Python: `3.9.5` FastAPI: `0.103.1`
一个用于构建 API 的现代、快速(高性能)的 web 框架,使用 Python 3.6+ 并基于标准的 Python 类型提示
入门
---
<!--rehype:body-class=cols-1-->
<!--rehype:body-class=cols-2-->
### 安装 FastAPI
```shell
$ pip install "fastapi[all]"
```
#### 可以分开来安装
假如你想将应用程序部署到生产环境,你可能要执行以下操作:
```shell
$ pip install fastapi
```
并且安装 `uvicorn` 来作为服务器:
```shell
$ pip install "uvicorn[standard]"
```
#### 运行代码
```shell
$ uvicorn main:app --reload
```
Python: `3.9.5` FastAPI: `0.103.1`
### 最小程序
@@ -16,7 +44,11 @@ from fastapi import FastAPI
import uvicorn
app = FastAPI()
```
添加一个 API 的示例
```python
# http://127.0.0.1:8000/
@app.get("/")
async def root():
@@ -65,12 +97,14 @@ async def read_item(file_path):
```
### 查询参数
<!--rehype:wrap-class=row-span-2-->
#### 带默认值的查询参数
```python
# http://127.0.0.1:8000/items/?skip=0&limit=2
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}]
@app.get("/items/")
async def read_item(skip: int = 0, limit: int = 10):
return fake_items_db[skip: skip + limit]
@@ -81,6 +115,7 @@ async def read_item(skip: int = 0, limit: int = 10):
```python
# http://127.0.0.1:8000/items/1?q=admin
from typing import Union
@app.get("/items/{item_id}")
async def read_item(item_id: str, q: Union[str, None] = None):
if q:
@@ -96,14 +131,17 @@ async def read_item(item_id: str, q: Union[str, None] = None):
# http://127.0.0.1:8000/users/1/items/2?q=query&short=true
@app.get("/users/{user_id}/items/{item_id}")
async def read_user_item(
user_id: int, item_id: str, q: Union[str, None] = None, short: bool = False
user_id: int,
item_id: str,
q: Union[str, None] = None,
short: bool = False
):
item = {"item_id": item_id, "owner_id": user_id}
if q:
item.update({"q": q})
if not short:
item.update(
{"description": "This is an amazing item that has a long description"}
{"description": "这是一个令人惊叹的项目,有很长的描述"}
)
return item
```
@@ -123,11 +161,13 @@ async def read_user_item(item_id: str, needy: str):
```python
from pydantic import BaseModel
from typing import Union
class Item(BaseModel):
name: str = '小明'
description: Union[str, None] = None
price: float
tax: Union[float, None] = None
@app.post("/items/")
async def create_item(item: Item):
print(item.name)
@@ -153,8 +193,11 @@ curl -X 'POST' \
```python
from fastapi import Query
@app.get("/items/")
async def read_items(q: Union[str, None] = Query(default=None, max_length=50)):
async def read_items(
q: Union[str, None] = Query(default=None, max_length=50)
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
results.update({"q": q})
@@ -165,26 +208,28 @@ async def read_items(q: Union[str, None] = Query(default=None, max_length=50)):
| 参数 | 含义 | 类型 |
| ---------- | ------------ | ------------- |
| default | 默认值 | 任意类型或... |
| max_length | 最大长度 | int |
| min_length | 最小长度 | int |
| pattern | 正则匹配 | string |
| alias | 别名参数 | string |
| deprecated | 准备弃用参数 | bool |
| `default` | 默认值 | 任意类型或... |
| `max_length` | 最大长度 | `int` |
| `min_length` | 最小长度 | `int` |
| `pattern` | 正则匹配 | `string` |
| `alias` | 别名参数 | `string` |
| `deprecated` | 准备弃用参数 | `bool` |
#### 多个相同的查询参数
```python
# http://127.0.0.1:8000/items/?q=foo&q=bar
@app.get("/items/")
async def read_items(q: Union[List[str], None] = Query(default=None)):
async def read_items(
q: Union[List[str], None] = Query(default=None)
):
query_items = {"q": q}
return query_items
```
### 路径参数和数值校验
Path用法基本和Query相同参考[FastAPI官方文档](https://fastapi.tiangolo.com/zh/tutorial/path-params-numeric-validations/)
Path 用法基本和 Query 相同,参考:[FastAPI官方文档](https://fastapi.tiangolo.com/zh/tutorial/path-params-numeric-validations/)
#### 导入 Path
@@ -198,8 +243,8 @@ from typing_extensions import Annotated
```python
@app.get("/items/{item_id}")
async def read_items(
item_id: Annotated[int, Path(title="The ID of the item to get")],
q: Annotated[Union[str, None], Query(alias="item-query")] = None,
item_id: Annotated[int, Path(title="要获取的项目的 ID")],
q: Annotated[str | None, Query(alias="item-query")] = None,
):
results = {"item_id": item_id}
if q:
@@ -211,23 +256,26 @@ async def read_items(
| 参数 | 含义 | 类型 |
| ----- | ------------------- | --------- |
| ... | 和Query具有相同参数 | ... |
| ge | 大于等于 | int float |
| gt | 大于 | int float |
| le | 小于等于 | int float |
| le | 小于等于 | int float |
| title | api文档的标题 | string |
| `...` | 和 Query 具有相同参数 | ... |
| `ge` | 大于等于 | `int float` |
| `gt` | 大于 | `int float` |
| `le` | 小于等于 | `int float` |
| `le` | 小于等于 | `int float` |
| `title` | api文档的标题 | `string` |
### 其他参数
都具有Query的参数max_lengthmin_length等
都具有 `Query` 的参数,`max_length``min_length`
#### Cookie参数
```python
from fastapi import Cookie
@app.get("/items/")
async def read_items(ads_id: Annotated[Union[str, None], Cookie()] = None):
async def read_items(
ads_id: Annotated[Union[str, None], Cookie()] = None
):
return {"ads_id": ads_id}
```
@@ -235,8 +283,12 @@ async def read_items(ads_id: Annotated[Union[str, None], Cookie()] = None):
```python
from fastapi import Header
@app.get("/items/")
async def read_items(user_agent: Annotated[Union[str, None], Header()] = None,items_id: Annotated[Union[int, None], Header(ge=1)] = None):
async def read_items(
user_agent: Annotated[Union[str, None], Header()] = None,
items_id: Annotated[Union[int, None], Header(ge=1)] = None
):
return {"User-Agent": user_agent, "items_id": items_id}
```
@@ -246,7 +298,9 @@ async def read_items(user_agent: Annotated[Union[str, None], Header()] = None,it
#### 安装
`pip install python-multipart`
```shell
$ pip install python-multipart
```
#### HTML
@@ -282,14 +336,17 @@ if __name__ == '__main__':
```
### 文件上传
<!--rehype:wrap-class=col-span-2-->
```python
from fastapi import FastAPI, UploadFile
from fastapi.responses import HTMLResponse
@app.post("/uploadfile/")
async def create_upload_file(file: UploadFile):
print(file.file.read().decode())
return {"filenames": file.filename, "type": str(type(file.file))}
@app.get("/")
async def main():
content = """<body>
@@ -301,27 +358,28 @@ async def main():
return HTMLResponse(content=content)
```
#### UploadFile属性
#### UploadFile 属性
| 属性名 | 含义 | 返回 |
| ------------ | -------- | --------------------------------------- |
| filename | 文件名 | 上传的文件名 |
| content_type | 内容类型 | MIME 类型 |
| file | 文件 | SpooledTemporaryFile具有readwrite方法 |
| `filename` | 文件名 | 上传的文件名 |
| `content_type` | 内容类型 | `MIME` 类型 |
| `file` | 文件 | SpooledTemporaryFile 具有 `read``write` 方法 |
<!--rehype:className=left-align-->
#### UploadFile async方法
#### UploadFile async 方法
| 方法名 | 含义 |
| ------------ | ----------------------------------------- |
| write(data) | 把 `data` 写入文件 |
| read(size) | 按指定数量的字节读取文件内容 |
| seek(offset) | 移动至文件 `offset` `int`)字节处的位置 |
| close() | 关闭文件 |
| `write(data)` | 把 `data` 写入文件 |
| `read(size)` | 按指定数量的字节读取文件内容 |
| `seek(offset)` | 移动至文件 `offset` `int`)字节处的位置 |
| `close()` | 关闭文件 |
<!--rehype:className=left-align-->
依赖项
---
<!--rehype:body-class=cols-1-->
<!--rehype:body-class=cols-2-->
### 依赖项使用场景
@@ -331,6 +389,7 @@ async def main():
- 等……
### 创建依赖项
<!--rehype:wrap-class=row-span-2-->
```python
from typing import Union
@@ -338,22 +397,31 @@ from typing import Union
from fastapi import Depends, FastAPI
app = FastAPI()
```
# read_itemsread_users方法依赖common_parameters
# 白话就是read_itemsread_users都需要qskiplimit查询参数
`read_items``read_users` 方法依赖 `common_parameters`
白话就是 `read_items``read_users` 都需要 `q``skip``limit` 查询参数
```python
async def common_parameters(
q: Union[str, None] = None, skip: int = 0, limit: int = 100
q: Union[str, None] = None,
skip: int = 0,
limit: int = 100
):
return {"q": q, "skip": skip, "limit": limit}
@app.get("/items/")
async def read_items(commons: dict = Depends(common_parameters)):
async def read_items(
commons: dict = Depends(common_parameters)
):
return commons
@app.get("/users/")
async def read_users(commons: dict = Depends(common_parameters)):
async def read_users(
commons: dict = Depends(common_parameters)
):
return commons
```
@@ -361,60 +429,66 @@ async def read_users(commons: dict = Depends(common_parameters)):
```python
from typing import Union
from fastapi import Depends, FastAPI
app = FastAPI()
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}]
class CommonQueryParams:
def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100):
def __init__(
self,
q: Union[str, None] = None,
skip: int = 0,
limit: int = 100
):
self.q = q
self.skip = skip
self.limit = limit
```
# read_itemsx接收一个commons参数类型是CommonQueryParams
# CommonQueryParams接收三个参数这三个参数是调用api的时候传
`read_itemsx` 接收一个 `commons` 参数,类型是 `CommonQueryParams`
`CommonQueryParams` 接收三个参数,这三个参数是调用 api 的时候传
```python
@app.get("/items/")
async def read_items(commons: CommonQueryParams = Depends(CommonQueryParams)):
response = {}
if commons.q:
response.update({"q": commons.q})
items = fake_items_db[commons.skip : commons.skip + commons.limit]
response.update({"items": items})
return response
async def read_items(
commons: CommonQueryParams = Depends(CommonQueryParams)
):
response = {}
if commons.q:
response.update({"q": commons.q})
items = fake_items_db[commons.skip : commons.skip + commons.limit]
response.update({"items": items})
return response
```
#### 还可以简写
```python
@app.get("/items/")
async def read_items(commons: CommonQueryParams = Depends()): # 这里的Depends没有传参FastAPI会自动使用CommonQueryParams
response = {}
if commons.q:
response.update({"q": commons.q})
items = fake_items_db[commons.skip : commons.skip + commons.limit]
response.update({"items": items})
return response
async def read_items(
# 这里的 Depends 没有传参FastAPI 会自动使用 CommonQueryParams
commons: CommonQueryParams = Depends()
):
response = {}
if commons.q:
response.update({"q": commons.q})
items = fake_items_db[commons.skip : commons.skip + commons.limit]
response.update({"items": items})
return response
```
### 子依赖项
```python
from typing import Union
from fastapi import Cookie, Depends, FastAPI
app = FastAPI()
def query_extractor(q: Union[str, None] = None):
return q
def query_or_cookie_extractor(
q: str = Depends(query_extractor),
last_query: Union[str, None] = Cookie(default=None),
@@ -427,20 +501,25 @@ def query_or_cookie_extractor(
# query_or_cookie_extractor函数又依赖query_extractor函数
# 就是说依赖项可以依赖其他依赖项,只要你不晕,可以无数次套娃
@app.get("/items/")
async def read_query(query_or_default: str = Depends(query_or_cookie_extractor)):
async def read_query(
query_or_default: str = Depends(query_or_cookie_extractor)
):
return {"q_or_cookie": query_or_default}
```
#### 不使用缓存
使用 `use_cache = False` 参数不使用缓存数据,不使用 `use_cache = False``value``value1` 是一样的
```python
# 使用use_cache = False参数不使用缓存数据
# 不使用use_cache = False,value和value1是一样的
def result_value():
value = randint(1, 99)
return value
def get_value(value: int = Depends(result_value, use_cache=False), value1: int = Depends(result_value, use_cache=False)):
def get_value(
value: int = Depends(result_value, use_cache=False),
value1: int = Depends(result_value, use_cache=False)
):
return value, value1
@app.get('/value/')
@@ -453,26 +532,27 @@ async def needy_dependency(value: tuple = Depends(get_value)):
```python
from fastapi import Depends, FastAPI, Header, HTTPException
async def verify_token(x_token: str = Header()):
if x_token != "fake-super-secret-token":
raise HTTPException(status_code=400, detail="X-Token header invalid")
if x_token != "fake-super-secret-token":
raise HTTPException(status_code=400, detail="X-Token 标头无效")
async def verify_key(x_key: str = Header()):
if x_key != "fake-super-secret-key":
raise HTTPException(status_code=400, detail="X-Key header invalid")
return x_key
if x_key != "fake-super-secret-key":
raise HTTPException(status_code=400, detail="X-Key 标头无效")
return x_key
```
# 全局依赖项很有用,后面的安全性就可以使用全局依赖项
app = FastAPI(dependencies=[Depends(verify_token), Depends(verify_key)])
全局依赖项很有用,后面的安全性就可以使用全局依赖项
```python
app = FastAPI(
dependencies=[Depends(verify_token), Depends(verify_key)]
)
@app.get("/items/")
async def read_items():
return [{"item": "Portal Gun"}, {"item": "Plumbus"}]
@app.get("/users/")
async def read_users():
return [{"username": "Rick"}, {"username": "Morty"}]
@@ -481,6 +561,116 @@ async def read_users():
安全性
---
### 基于 Token 的认证
<!--rehype:wrap-class=col-span-2-->
```python
from fastapi import FastAPI, Depends, HTTPException
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
from pydantic import BaseModel
app = FastAPI()
```
使用 OAuth2PasswordBearer 创建一个 token 依赖
```python
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
```
假设这是你的用户数据库
```python
fake_users_db = {
"johndoe": {
"username": "johndoe",
"full_name": "John Doe",
"email": "johndoe@example.com",
"hashed_password": "fakehashedsecret",
"disabled": False,
}
}
```
创建一个用户模型
```python
class User(BaseModel):
username: str
email: str
full_name: str
disabled: bool
```
创建一个简单的认证函数
```python
def fake_hash_password(password: str):
return "fakehashed" + password
def get_user(db, username: str):
if username in db:
user_dict = db[username]
return User(**user_dict)
def fake_decode_token(token: str):
# 这个函数应该验证 token 并返回用户信息
# 这里我们只是简单地返回了用户名
return get_user(fake_users_db, token)
```
创建一个依赖,用于从请求中获取 token 并验证用户
```python
async def get_current_user(token: str = Depends(oauth2_scheme)):
user = fake_decode_token(token)
if not user:
raise HTTPException(
status_code=401,
detail="Invalid authentication credentials",
headers={"WWW-Authenticate": "Bearer"},
)
return user
@app.post("/token")
async def login(form_data: OAuth2PasswordRequestForm = Depends()):
user = get_user(fake_users_db, form_data.username)
if not user or user.hashed_password != fake_hash_password(form_data.password):
raise HTTPException(status_code=400, detail="Incorrect username or password")
return {"access_token": user.username, "token_type": "bearer"}
@app.get("/users/me")
async def read_users_me(current_user: User = Depends(get_current_user)):
return current_user
```
使用 OAuth2PasswordBearer 来创建一个简单的 token 认证流程。
### HTTPS 和证书
```python
from fastapi import FastAPI
app = FastAPI()
```
在生产环境中,你应该使用一个真正的证书和私钥,你可以从像 Let's Encrypt 这样的证书颁发机构获得免费的证书,或者使用 OpenSSL 生成自签名证书
```python
@app.get("/https")
async def read_https():
return {"message": "Hello, HTTPS!"}
```
启动服务器时,使用以下命令来指定证书和私钥:
```bash
uvicorn main:app --host 0.0.0.0 --port 443 --ssl-keyfile /path/to/your/key.pem --ssl-certfile /path/to/your/cert.pem
```
FastAPI 默认支持 HTTPS你只需要提供证书和私钥即可。
待更新
参考

View File

@@ -150,7 +150,6 @@ CDN
[cdnjs](https://cdnjs.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
[jsDelivr](https://www.jsdelivr.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
[前端静态资源库](https://cdn.baomitu.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
[UNPKG](https://unpkg.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
[Statically](https://statically.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
[raw.githack.com](http://raw.githack.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->

203
docs/figma.md Normal file
View File

@@ -0,0 +1,203 @@
Figma 备忘清单
===
Figma 中 119 个键盘快捷键的可视化备忘表
键盘快捷键
---
### 基本操作
快捷键 | 动作
---|---
`Ctrl` `\` | 显示/隐藏界面
`Ctrl` `C` | 选择颜色
`Ctrl` `/` | 搜索菜单
<!--rehype:className=shortcuts-->
### 工具
快捷键 | 动作
---|---
`V` | 移动工具
`F` | 框架工具
`P` | 钢笔工具
`Shift` `P` | 铅笔工具
`T` | 文本工具
`R` | 矩形工具
`O` | 椭圆工具
`L` | 线条工具
`Shift` `L` | 箭头工具
`C` | 添加/显示评论
`Ctrl` `C` | 选择颜色
`S` | 切片工具
<!--rehype:className=shortcuts-->
### 视图
快捷键 | 动作
---|---
`Shift` `R` | 切换标尺
`Ctrl` `Y` | 显示轮廓
`Ctrl` `P` | 像素预览
`Ctrl` `G` | 布局网格
`Ctrl` `'` | 像素网格
`Ctrl` `\` | 显示/隐藏界面
`Ctrl` `Alt` `\` | 显示多人光标
`Alt` `1` | 显示图层
`Alt` `2` | 显示组件
`Alt` `3` | 显示团队库
<!--rehype:className=shortcuts-->
### 缩放
快捷键 | 动作
---|---
`Space` `(拖拽)` | 平移
`+` | 放大
`-` | 缩小
`Shift` `0` | 缩放至100%
`Shift` `1` | 缩放以适应
`Shift` `2` | 缩放至选区
`Shift` `N` | 缩放至上一帧
`N` | 缩放至下一帧
`PgUp` | 上一页
`PgDown` | 下一页
`Home` | 查找上一帧
`End` | 查找下一帧
<!--rehype:className=shortcuts-->
### 文本
快捷键 | 动作
---|---
`Ctrl` `B` | 加粗
`Ctrl` `I` | 斜体
`Ctrl` `U` | 下划线
`Ctrl` `Shift` `V` | 粘贴并匹配样式
`Ctrl` `Alt` `L` | 文本左对齐
`Ctrl` `Alt` `T` | 文本居中对齐
`Ctrl` `Alt` `R` | 文本右对齐
`Ctrl` `Alt` `J` | 文本两端对齐
`Ctrl` `Shift` `</>` | 调整字体大小
`Alt` `,/.` | 调整字间距
`Alt` `Shift` `</>` | 调整行高
<!--rehype:className=shortcuts-->
### 形状
快捷键 | 动作
---|---
`P` | 钢笔
`Shift` `P` | 铅笔
`B` | 填充桶(编辑形状时)
`Ctrl` | 弯曲工具(编辑形状时)
`Alt` `/` | 移除填充
`/` | 移除描边
`Shift` `X` | 交换填充和描边
`Ctrl` `Shift` `O` | 描边轮廓
`Ctrl` `E` | 扁平化选择
`Ctrl` `J` | 连接选择(选择点后)
`Ctrl` `Shift` `J` | 平滑连接选择(选择点后)
`Shift` `Backspace` | 删除并修复选择(选择点后)
<!--rehype:className=shortcuts-->
### 选择
快捷键 | 动作
---|---
`Ctrl` `A` | 全选
`Ctrl` `Shift` `A` | 反向选择
`Esc` | 取消选择
`Ctrl` `(单击)` | 深度选择
`Ctrl` `(右键单击)` | 选择图层菜单
`Enter` | 选择子元素
`Shift` `Enter` | 选择父元素
`Tab` | 选择下一个同级元素
`Shift` `Tab` | 选择上一个同级元素
`Ctrl` `G` | 分组选择
`Ctrl` `Shift` `G` | 取消分组选择
`Ctrl` `Alt` `G` | 框架选择
`Ctrl` `Shift` `H` | 显示/隐藏选择
`Ctrl` `Shift` `L` | 锁定/解锁选择
<!--rehype:className=shortcuts-->
### 光标
快捷键 | 动作
---|---
`Alt` | 测量到选择区域(指向时)
`Alt` | 复制选择区域(移动时)
`Ctrl` `(单击)` | 深度选择(点击时)
`Ctrl` `(右键单击)` | 选择图层菜单(点击时)
`Ctrl` `(拖动)` | 矩形内深度选择(拖动选择时)
`Alt` | 从中心调整大小(调整大小时)
`Shift` | 等比例调整大小(调整大小时)
`Space` | 在调整大小时移动
`Ctrl` | 忽略约束(仅限框架)
<!--rehype:className=shortcuts-->
### 编辑
快捷键 | 动作
---|---
`Ctrl` `C` | 复制
`Ctrl` `X` | 剪切
`Ctrl` `V` | 粘贴
`Ctrl` `Shift` `V` | 在选择上粘贴
`Ctrl` `D` | 原地复制选择
`Ctrl` `R` | 重命名选择
`Ctrl` `Shift` `E` | 导出
`Ctrl` `Alt` `C` | 复制属性
`Ctrl` `Alt` `V` | 粘贴属性
<!--rehype:className=shortcuts-->
### 变换
快捷键 | 动作
---|---
`Shift` `H` | 水平翻转
`Shift` `V` | 垂直翻转
`Ctrl` `M` | 用作蒙版
`Enter` | 编辑形状或图像
`Ctrl` `Shift` `K` | 放置图像
`Alt` `(双击)` | 裁剪图像
`1` | 将不透明度设置为 10%
`5` | 将不透明度设置为 50%
`0` | 将不透明度设置为 100%
<!--rehype:className=shortcuts-->
### 排列
快捷键 | 动作
---|---
`Ctrl` `]` | 上移一层
`Ctrl` `[` | 下移一层
`Ctrl` `Alt` `]` | 移至顶层
`Ctrl` `Alt` `[` | 移至底层
`Alt` `A` | 左对齐
`Alt` `D` | 右对齐
`Alt` `W` | 顶部对齐
`Alt` `S` | 底部对齐
`Alt` `H` | 水平居中对齐
`Alt` `V` | 垂直居中对齐
`Ctrl` `Alt` `T` | 整理
`Ctrl` `Alt` `H` | 分布水平间距
`Ctrl` `Alt` `V` | 分布垂直间距
<!--rehype:className=shortcuts-->
### 组件
快捷键 | 动作
---|---
`Alt` `2` | 显示组件
`Ctrl` `Shift` `O` | 团队库
`Ctrl` `Shift` `K` | 创建组件
`Ctrl` `Shift` `B` | 分离实例
`Alt` | 替换组件实例(从资源拖动时)
<!--rehype:className=shortcuts-->
另见
---
- [Figma 的键盘快捷键](https://help.figma.com/article/77-keyboard-shortcuts) _(help.figma.com)_

93
docs/finder.md Normal file
View File

@@ -0,0 +1,93 @@
Finder 备忘清单
===
Finder 中 55 个键盘快捷键的可视化小抄。此应用程序是 macOS 的一部分。
键盘快捷键
----
<!--rehype:body-class=cols-4-->
### 修饰键符号
<!--rehype:wrap-class=col-span-4-->
- `Command` (或 `Cmd`) ⌘
- `Option` (或 `Alt`) ⌥
- `Caps Lock`
- `Shift`
- `Control` (或 `Ctrl`) ⌃
- `Fn` 🌐
<!--rehype:className=cols-3-->
### Finder 快捷键
<!--rehype:wrap-class=col-span-2-->
快捷键 | 操作
---|---
`Cmd` `D` | 复制选定的文件
`Cmd` `E` | 弹出选定的磁盘或卷
`Cmd` `F` | 在Finder窗口中启动Spotlight搜索
`Cmd` `I` | 显示选定文件的详细信息窗口
`Cmd` `R` | 当在Finder中选择别名时显示所选别名的原始文件
`Cmd` `Shift` `C` | 打开计算机窗口
`Cmd` `Shift` `D` | 打开桌面文件夹
`Cmd` `Shift` `F` | 打开最近窗口,显示您最近查看或更改的所有文件
`Cmd` `Shift` `G` | 打开前往文件夹窗口
`Cmd` `Shift` `H` | 打开当前MacOS用户账户的主文件夹
`Cmd` `Shift` `I` | 打开iCloud驱动器
`Cmd` `Shift` `K` | 打开网络窗口
`Cmd` `Opt` `L` | 打开下载文件夹
`Cmd` `Shift` `N` | 创建新文件夹
`Cmd` `Shift` `O` | 打开文档文件夹
`Cmd` `Shift` `P` | 在Finder窗口中显示或隐藏预览窗格
`Cmd` `Shift` `R` | 打开AirDrop窗口
`Cmd` `Shift` `T` | 在Finder窗口中显示或隐藏选项卡栏
`Ctrl` `Cmd` `Shift` `T` | 将选定的Finder项目添加到Dock
`Cmd` `Shift` `U` | 打开实用工具文件夹
`Cmd` `Opt` `D` | 显示或隐藏Dock
`Cmd` `Ctrl` `T` | 将选定项目添加到侧边栏
`Cmd` `Opt` `P` | 在Finder窗口中隐藏或显示路径栏
`Cmd` `Opt` `S` | 在Finder窗口中隐藏或显示侧边栏
`Cmd` `/` | 在Finder窗口中隐藏或显示状态栏
`Cmd` `J` | 显示视图选项
`Cmd` `K` | 打开连接到服务器窗口
<!--rehype:className=shortcuts left-align-->
### Finder 快捷键
<!--rehype:wrap-class=col-span-2-->
快捷键 | 操作
---|---
`Cmd` `Ctrl` `A` | 制作所选项目的别名
`Cmd` `N` | 打开新的Finder窗口
`Cmd` `Opt` `N` | 创建新的智能文件夹
`Cmd` `T` | 在当前Finder窗口中打开或隐藏选项卡栏
`Cmd` `Opt` `T` | 在当前Finder窗口中打开或隐藏工具栏
`Cmd` `Opt` `V` | 将剪贴板中文件从其原始位置移动到当前位置
`Cmd` `Y` | 使用快速查看预览所选文件
`Cmd` `Opt` `Y` | 查看所选文件的快速查看幻灯片
`Cmd` `1` | 将Finder窗口中的项目以图标形式查看
`Cmd` `2` | 将Finder窗口中的项目以列表形式查看
`Cmd` `3` | 将Finder窗口中的项目以列形式查看
`Cmd` `4` | 将Finder窗口中的项目以画廊形式查看
`Cmd` `[` | 转到上一个文件夹
`Cmd` `]` | 转到下一个文件夹
`Cmd` `Up` | 打开包含当前文件夹的文件夹
`Cmd` `Ctrl` `Up` | 在新窗口中打开包含当前文件夹的文件夹
`Cmd` `Left` | 打开所选项目
`Right` | 打开所选文件夹(仅在列表视图中有效)
`Left` | 关闭所选文件夹(仅在列表视图中有效)
`Cmd` `Del` | 将所选项目移至废纸篓
`Cmd` `Shift` `Del` | 清空废纸篓
`Cmd` `Opt` `Shift` `Del` | 无需确认对话框即可清空废纸篓
`Cmd` `Bright-Down` | 在Mac连接到多个显示器时打开或关闭视频镜像
`Cmd` `Bright-Up` | 打开显示首选项
`Ctrl` `Bright` | 更改外部显示器的亮度(如果支持)
`Opt` `Shift` `Bright` | 以较小步长调整显示亮度
`Ctrl` `Down` | 显示前台应用程序的所有窗口
`Opt` `Vol` | 打开声音首选项
<!--rehype:className=shortcuts left-align-->
另见
----
- [macOS Finder 的键盘快捷键](https://support.apple.com/en-us/HT201236) _(support.apple.com)_

134
docs/ftp.md Normal file
View File

@@ -0,0 +1,134 @@
ftp 备忘清单
===
此 ftp 备忘清单包含命令和使用 ftp 脚本实现自动化的技巧示例。
入门
----
### 介绍
<!--rehype:wrap-class=col-span-2-->
- FTP 命令允许用户通过FTPFile Transfer Protocol协议在本地计算机和远程服务器之间传输文件。
- FTP 是一种在网络上交换文件的标准协议,是 ARPANet 的标准文件传输协议ARPANet 网络就是现今 Internet 的前身。
- 使用 FTP 协议时,一方充当客户端,另一方充当服务器,客户端可以上传、下载、删除、重命名文件和目录,以及执行其他文件传输相关的操作。
### 选项
<!--rehype:wrap-class=row-span-3-->
```bash
ftp -v ftp.example.com
```
`-v`:启用或禁用详细模式。在详细模式下,`ftp`命令会显示所有来自服务器的响应消息。默认情况下,该选项为开启状态。
```bash
ftp -d ftp.example.com
```
`-d`启用调试模式。该选项会显示所有FTP传输过程中发送和接收到的命令有助于调试连接问题。
```bash
ftp -n ftp.example.com
```
`-n`:禁止自动登录。默认情况下,`ftp`命令会在连接到远程服务器后尝试自动登录。使用该选项可以禁止该行为,通常与`.netrc`文件联合使用。
```bash
ftp -g ftp.example.com
```
禁用文件名通配符扩展。`ftp`命令默认会展开文件名中的通配符。使用该选项可以关闭这一行为。
```bash
ftp -p ftp.example.com
```
`-p`使用被动模式PASV进行数据连接。被动模式在客户端位于防火墙或NAT后面时非常有用。
```bash
ftp -s:script.txt ftp.example.com # Windows
ftp -n ftp.example.com < script # Linux
```
:warning: Windows 上使用`-s`选项指定`script.txt`脚本执行 ftp 命令。Linux 上可以使用重定向实现。
### 目录操作
| 命令 | 描述 |
| -------------------- | -------------------------- |
| `cd` | 更改当前工作目录到指定目录 |
| `ls``dir` | 列出当前目录下的内容 |
| `pwd` | 显示当前目录的绝对路径 |
| `mkdir` | 创建目录 |
| `rmdir` | 删除一个目录 |
| `rename <old> <new>` | 重命名一个目录 |
### 快速开始
<!--rehype:wrap-class=row-span-2-->
使用匿名模式访问远程 FTP 服务器
```bash
ftp ftp.example.com
```
ftp 会启动交互式命令行
```bash
Connected to <host> (<ip address>).
220 (vsFTPd 3.*)
# 需要手动输入 anonymous
Name (192.168.10.10:root): anonymous
331 Please specify the password.
Password: # 匿名模式下直接回车
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
```
连接成功后进入交互式会话.
查看所有命令,使用 `helm``?`
```bash
ftp> help
# 或者
ftp> ?
```
### 文件操作
| 命令 | 描述 |
| ---------------------- | -------------------- |
| `get <remote> <local>` | 下载一个文件到本地 |
| `mget` | 下载多个文件到本地 |
| `put <local> <remote>` | 上传一个文件到服务器 |
| `mput` | 上传多个文件到服务器 |
| `delete <remote>` | 删除一个文件 |
| `rename <old> <new>` | 重命名一个文件 |
脚本
----
### 样例
<!--rehype:wrap-class=col-span-3-->
以匿名登录为例,将下列脚本代码放入文件 `script` 中:
```bash
user anonymous "\n" # 匿名用户
binary # 将文件传输模式设置为二进制模式,这对于非文本文件(如图片、压缩文件等)来说是必要的,以确保文件在传输过程中不会被更改。
ls <dir> # 进入某个目录
pwd # 输出当前路径
quit # 退出 ftp 连接
```
使用 `ftp` 命令执行脚本文件:
```bash
ftp -n ftp.example.com < script # 使用 -n 选项禁止自动登录,这样会继续执行 user 指令,而不是启动交互式命令行。
```

View File

@@ -155,6 +155,27 @@ jobs:
- run: echo ${{needs.job1.outputs.output1}} ${{needs.job1.outputs.output2}}
```
### 定时触发
可以使用 cron 表达式配置周期性任务,定时执行
```yaml
name: schedule task
# 要注意时差,最好手动指定时区
env:
TZ: Asia/Shanghai
on:
# push 到 main 分支时执行任务
push:
branches:
- main
# 每隔两小时自动执行任务
schedule:
- cron: '0 0/2 * * *'
```
### 指定每项任务的虚拟机环境
```yml
@@ -274,7 +295,7 @@ env:
<!--rehype:className=cols-2 style-none-->
### Github 上下文
<!--rehype:wrap-class=col-span-2-->
<!--rehype:wrap-class=col-span-2 row-span-3-->
属性名称 | 类型 | 描述
---- | ---- | ----
@@ -300,7 +321,49 @@ env:
[Github 上下文](https://help.github.com/cn/actions/reference/context-and-expression-syntax-for-github-actions)是访问有关工作流运行、运行器环境、作业和步骤的信息的一种方式
### 直接常量
作为表达式的一部分,可以使用 `boolean`, `null`, `number` 或 `string`数据类型
```yml
env:
myNull: ${{ null }}
myBoolean: ${{ false }}
myIntegerNumber: ${{ 711 }}
myFloatNumber: ${{ -9.2 }}
myHexNumber: ${{ 0xff }}
myExponentialNumber: ${{ -2.99e-2 }}
myString: Mona the Octocat
myStringInBraces: ${{ 'It''s source!' }}
```
### 函数 contains
使用字符串的示例
```js
contains('Hello world', 'llo') // 返回 true
```
使用对象过滤器的示例返回 true
```js
contains(github.event.issue.labels.*.name, 'bug')
```
<!--rehype:className=wrap-text -->
另见: [函数 contains](https://docs.github.com/cn/actions/learn-github-actions/expressions#contains)
### 函数 startsWith
```js
startsWith('Hello world', 'He') // 返回 true
```
另见: [函数 startsWith](https://docs.github.com/cn/actions/learn-github-actions/expressions#startswith),此函数不区分大小写
### 默认环境变量
<!--rehype:wrap-class=row-span-8 col-span-2-->
环境变量 | 描述
---- | ----
@@ -326,49 +389,6 @@ env:
另见: [默认环境变量](https://docs.github.com/cn/actions/learn-github-actions/environment-variables#default-environment-variables)
### 直接常量
<!--rehype:wrap-class=row-span-2-->
作为表达式的一部分,可以使用 `boolean`, `null`, `number` 或 `string`数据类型
```yml
env:
myNull: ${{ null }}
myBoolean: ${{ false }}
myIntegerNumber: ${{ 711 }}
myFloatNumber: ${{ -9.2 }}
myHexNumber: ${{ 0xff }}
myExponentialNumber: ${{ -2.99e-2 }}
myString: Mona the Octocat
myStringInBraces: ${{ 'It''s source!' }}
```
### 函数 contains
<!--rehype:wrap-class=row-span-2-->
使用字符串的示例
```js
contains('Hello world', 'llo') // 返回 true
```
使用对象过滤器的示例返回 true
```js
contains(github.event.issue.labels.*.name, 'bug')
```
<!--rehype:className=wrap-text -->
另见: [函数 contains](https://docs.github.com/cn/actions/learn-github-actions/expressions#contains)
### 函数 startsWith
```js
startsWith('Hello world', 'He') // 返回 true
```
另见: [函数 startsWith](https://docs.github.com/cn/actions/learn-github-actions/expressions#startswith),此函数不区分大小写
### 函数 format
```js
@@ -382,7 +402,7 @@ format('{{Hello {0} {1} {2}!}}', 'Mona', 'the', 'Octocat')
### 函数 join
```js
join(github.event.issue.labels.*.name, ', ')
join(github.event.issue.labels.*.name,', ')
// 也许返回 'bug, help wanted'.
```
@@ -583,14 +603,15 @@ npm token revoke <id|token> # 撤销
Artifacts 是 GitHub Actions 为您提供持久文件并在运行完成后使用它们或在作业(文档)之间共享的一种方式。
要创建工件并使用它,您将需要不同的操作:上传和下载
- 要创建工件并使用它,您将需要不同的操作:上传和下载
要上传文件或目录,您只需像这样使用它:
```yml
steps:
- uses: actions/checkout@v2
- run: mkdir -p path/to/artifact
- run: echo hello > path/to/artifact/a.txt
- run: echo hello > path/to/file/a.txt
- uses: actions/upload-artifact@v2
with:
name: my-artifact
@@ -836,7 +857,7 @@ steps:
<!--rehype:className=style-list-->
### 在 Github 中创建 Docker 镜像
<!--rehype:wrap-class=row-span-3-->
<!--rehype:wrap-class=row-span-2 col-span-2-->
```yml
- name: Set up Docker Buildx
@@ -866,8 +887,19 @@ steps:
tags: ghcr.io/jaywcjlove/reference:${{steps.changelog.outputs.version}}
```
### 生成贡献者头像列表
```yml
- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
id: contributors
with:
output: dist/CONTRIBUTORS.svg
avatarSize: 42
```
### 在 Docker Hub 中创建 Docker 镜像
<!--rehype:wrap-class=row-span-3-->
<!--rehype:wrap-class=row-span-3 col-span-2-->
```yml
- name: Set up Docker Buildx
@@ -905,28 +937,27 @@ steps:
node-version: 16
```
### 生成贡献者头像列表
```yml
- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
id: contributors
with:
output: dist/CONTRIBUTORS.svg
avatarSize: 42
```
### 忽略失败
```yml
- run: npm publish
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
```
当 `npm` 推送包失败不影响整个流程,可用于自动发包
### 安装 yarn
```yml
- name: Setup Yarn
uses: threeal/setup-yarn-action@v2.0.0
with:
cache: false
version: 1.22.21
```
GitLab CI/CD 迁移到 GitHub Actions
---

View File

@@ -1,9 +1,7 @@
Github Copilot 备忘清单
===
这是开始使用 [Github Copilot](https://code.visualstudio.com/docs/editor/github-copilot) 的快速参考指南
\* 校对、错误请指正。📮邮箱: <a href="mailto:jussker@outlook.com">jussker@outlook.com</a>
这是开始使用 [Github Copilot](https://code.visualstudio.com/docs/editor/github-copilot) 的快速参考指南
一、准备工作
----

View File

@@ -27,6 +27,18 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
`G` `W` | 转到 `Wiki` 选项卡
<!--rehype:className=shortcuts-->
### 源码浏览
快捷键 | 说明
:- | -
`T` | 激活文件查找器
`L` | 跳转到代码中的一行
`W` | 切换到新的分支或标签
`Y` | 将 URL 扩展为其规范形式
`I` | 显示或隐藏对差异的评论
`B` | 打开责备视图
<!--rehype:className=shortcuts-->
### 源代码编辑
快捷键 | 说明
@@ -41,18 +53,6 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
`Ctrl` `Y` | 重做
<!--rehype:className=shortcuts-->
### 源码浏览
快捷键 | 说明
:- | -
`T` | 激活文件查找器
`L` | 跳转到代码中的一行
`W` | 切换到新的分支或标签
`Y` | 将 URL 扩展为其规范形式
`I` | 显示或隐藏对差异的评论
`B` | 打开责备视图
<!--rehype:className=shortcuts-->
### 注释
快捷键 | 说明
@@ -67,43 +67,8 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
`R` | 在回复中引用所选文字
<!--rehype:className=shortcuts-->
### 问题和拉取请求列表
快捷键 | 说明
:- | -
`C` | 创建问题
`Ctrl` `/` | 将光标聚焦在问题或拉取请求搜索栏上
`U` | 按作者过滤
`L` | 按标签过滤或编辑标签
`M` | 按里程碑过滤或编辑里程碑
`A` | 按受让人过滤或编辑受让人
`O` | 打开问题
<!--rehype:className=shortcuts-->
### 问题和拉取请求
快捷键 | 说明
:- | -
`Q` | 请求审稿人
`M` | 设定一个里程碑
`L` | 应用标签
`A` | 设置受让人
<!--rehype:className=shortcuts-->
### 拉取请求的变化
快捷键 | 说明
:- | -
`C` | 打开拉取请求中的提交列表
`T` | 打开拉取请求中已更改文件的列表
`J` | 在列表中向下移动选择
`K` | 在列表中向上移动选择
`Ctrl` `Shift` `Enter` | 在拉取请求差异上添加单个评论
`Alt` `(click)` | 在拉取请求中折叠和展开所有过时的审阅评论之间切换
<!--rehype:className=shortcuts-->
### 项目板
<!--rehype:wrap-class=row-span-2-->
<!--rehype:wrap-class=row-span-4-->
快捷键 | 说明
:- | -
@@ -131,6 +96,30 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
`Ctrl` `Shift` `Right/L` | 将卡片移至最右侧列的顶部
<!--rehype:className=shortcuts-->
### 问题和拉取请求列表
<!--rehype:wrap-class=row-span-2-->
快捷键 | 说明
:- | -
`C` | 创建问题
`Ctrl` `/` | 将光标聚焦在问题或拉取请求搜索栏上
`U` | 按作者过滤
`L` | 按标签过滤或编辑标签
`M` | 按里程碑过滤或编辑里程碑
`A` | 按受让人过滤或编辑受让人
`O` | 打开问题
<!--rehype:className=shortcuts-->
### 问题和拉取请求
快捷键 | 说明
:- | -
`Q` | 请求审稿人
`M` | 设定一个里程碑
`L` | 应用标签
`A` | 设置受让人
<!--rehype:className=shortcuts-->
### 通知
快捷键 | 说明
@@ -139,6 +128,18 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
`Shift` `M` | 静音线程
<!--rehype:className=shortcuts-->
### 拉取请求的变化
快捷键 | 说明
:- | -
`C` | 打开拉取请求中的提交列表
`T` | 打开拉取请求中已更改文件的列表
`J` | 在列表中向下移动选择
`K` | 在列表中向上移动选择
`Ctrl` `Shift` `Enter` | 在拉取请求差异上添加单个评论
`Alt` `(click)` | 在拉取请求中折叠和展开所有过时的审阅评论之间切换
<!--rehype:className=shortcuts-->
### 网络图
快捷键 | 说明
@@ -175,6 +176,7 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
`path:__init__.py` | 文件为 <pur>`__init__.py`</pur> 里面的内容搜索
`path:/.*shrc$/` | 文件路径包含 <pur>`.*shrc`</pur> 结尾的文件中搜索内容
`path:/src/*.js` | <pur>`src`</pur> 目录中的 <pur>`.js`</pur> 后缀的文件中搜索内容
`path:/(^\|\/)README\.md$/` | 使用正则,仅匹配特定文件名(而不是路径的一部分)
<!--rehype:className=style-list-->
### 完全符合
@@ -192,6 +194,7 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
<!--rehype:className=style-list-->
### 基于仓库的条件
<!--rehype:wrap-class=row-span-2-->
:-- | --
:-- | --
@@ -204,6 +207,7 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
<!--rehype:className=style-list-->
### 基于 issue 的条件
<!--rehype:wrap-class=row-span-2-->
:-- | --
:-- | --
@@ -226,6 +230,59 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
`repos:0 repos:<40 repos:>5` | 仓库数量
<!--rehype:className=style-list-->
### Symbol 限定符
搜索 `go` 语言中的 `WithContext` 符号
```
language:go symbol:WithContext
```
查询将查找在 `Rust` 中实现的 `String` 类型转换:
```
language:rust symbol:/^String::to_.*/
```
### 使用布尔运算
<!--rehype:wrap-class=col-span-2-->
查询将匹配包含 `sparse``index` 的文档
```js
sparse OR index
```
排除 `__testing__` 目录中的文件,您可以搜索:
```js
"fatal error" NOT path:__testing__
```
您可以使用括号来表达更复杂的布尔表达式
```js
(language:ruby OR language:python) AND NOT path:"/tests/"
```
使用运算符 `AND``OR``NOT` 来组合搜索词
### is 限定符
- `archived`: 限制搜索`已存档`的版本库
- `fork`: 限制搜索已`分叉`的版本库
- `vendored`: 限制搜索被检测为 vendored 的内容
- `generated`: 限制搜索检测为`已生成`的内容
示例
:-- | --
:-- | --
`path:/^MIT.txt$/ is:archived` | 已归档存储库,中包含名为 <pur>MIT.txt</pur> 的文件
`log4j NOT is:archived` | 限定符 <pur>is:</pur> 可以与 <pur>NOT</pur> 运算符反转
`log4j NOT is:fork` | 从结果中排除<pur>分叉</pur>
<!--rehype:className=style-list-->
另见
-----

814
docs/glances.md Normal file
View File

@@ -0,0 +1,814 @@
Glances 备忘清单
===
这是开始使用 [Glances](https://glances.readthedocs.io/en/latest/) 系统监控工具的快速参考备忘单,可以帮助用户监视系统的各种性能指标
入门
----
### 功能特点
<!--rehype:wrap-class=row-span-2-->
#### 跨平台支持
- `Glances` 支持多种操作系统,包括 Linux、Windows、macOS 和 FreeBSD。
#### 多种输出方式
- `命令行界面CLI`:通过终端查看系统监控数据。
- `Web 界面`:通过浏览器访问并查看系统性能指标。
- `API 输出`:可以将数据通过 REST API 或者 MQTT 传输到其他系统或服务。
#### 详细的系统监控
- `CPU`:实时显示 CPU 的使用率、每个核心的负载情况。
- `内存`:显示总内存、已用内存、缓存和交换分区的使用情况。
- `磁盘 I/O`:显示磁盘的读写速度和 I/O 操作数。
- `网络带宽`:显示网络接口的上传和下载速度。
- `文件系统`:显示各个挂载点的使用情况。
- `传感器`:显示系统温度、风扇速度等传感器数据(需要支持的硬件和驱动)。
#### 扩展功能
- `插件系统`:支持通过插件扩展功能,可以自定义监控指标。
- `导出数据`:支持将监控数据导出为 CSV、JSON 等格式。
- `报警系统`:可以设置报警,当某些指标超过设定阈值时触发通知。
### 安装
#### **通过 pip 安装**
```sh
pip install glances
```
#### **通过包管理器安装**
**Debian/Ubuntu**:
```sh
sudo apt-get install glances
```
**Fedora**:
```sh
sudo dnf install glances
```
**macOS (使用 Homebrew)**:
```sh
brew install glances
```
### 配置文件
Glances 的配置文件位于 `~/.config/glances/glances.conf`。通过编辑这个文件,可以自定义 Glances 的显示和行为。
#### 例子配置文件
```ini
[global]
refresh=2 # 设置刷新间隔(以秒为单位)
[cpu]
enable=true # 显示 CPU 负载平均值
[mem]
enable=true # 显示内存使用情况
[disk]
enable=true # 显示磁盘 I/O 信息
[network]
enable=true # 显示网络带宽使用情况
```
### Web 访问
```sh
# 使用 Glances 的 API
glances -w
# 访问 API
curl http://<your_ip>:61208/api/3/all
```
**使用 Docker 部署 Glances**
```sh
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /glances/conf:/glances/conf:ro \
-v /glances/data:/glances/data:rw \
-p 61208-61209:61208-61209 \
--name glances nicolargo/glances
```
### 使用方法
#### **启动命令行界面**
```sh
glances
```
#### **启动 Web 界面**
```sh
glances -w
```
启动后,通过浏览器访问 `http://<your_ip>:61208` 查看系统监控数据。
#### **启动以特定模式输出**
```sh
glances --export json # JSON 输出
glances --export csv # CSV 输出
```
命令行选项
---
### 命令行选项
:- | :-
:- | :-
`-h`, `--help` | 显示此帮助信息并退出
`-V`, `--version` | 显示程序版本号并退出
`-d`, `--debug` | 启用调试模式
`-C CONF_FILE`, `--config CONF_FILE` | 配置文件的路径
`--modules-list` | 显示模块(插件和导出)列表并退出
`--stdout PLUGINS_STATS` | 显示插件统计信息到标准输出(用逗号分隔的插件/插件属性列表)
<!--rehype:className=style-list-->
### 禁用启用选项
<!--rehype:wrap-class=row-span-2-->
:- | :-
:- | :-
`--disable-plugin PLUGIN` | 禁用插件(用逗号分隔的列表)
`--enable-plugin PLUGIN` | 启用插件(用逗号分隔的列表)
`--disable-process` | 禁用进程模块减少Glances的CPU消耗
`--disable-webui` | 禁用Web界面仅响应RESTful API
`--enable-history` | 启用历史模式
`--disable-bold` | 禁用终端中的粗体模式
`--disable-bg` | 禁用终端中的背景颜色
`--enable-process-extended` | 启用顶级进程的扩展统计
`--disable-check-update` | 禁用在线Glances版本检查
`--disable-autodiscover` | 禁用自动发现功能
`--light`, `--enable-light` | Curses UI的轻量模式仅启用顶部菜单
`-q`, `--quiet` | 不显示 curses 界面
<!--rehype:className=style-list-->
### SNMP
:- | :-
:- | :-
`--snmp-community SNMP_COMMUNITY` | SNMP社区
`--snmp-port SNMP_PORT` | SNMP端口
`--snmp-version SNMP_VERSION` | SNMP版本1, 2c 或 3
`--snmp-user SNMP_USER` | SNMP用户名仅适用于SNMPv3
`--snmp-auth SNMP_AUTH` | SNMP认证密钥仅适用于SNMPv3
`--snmp-force` | 强制SNMP模式
<!--rehype:className=style-list-->
### 命令行选项
:- | :-
:- | :-
`--export EXPORT`| 启用导出模块(用逗号分隔的列表)
`--export-csv-file EXPORT_CSV_FILE` | CSV导出文件路径
`--export-json-file EXPORT_JSON_FILE`| JSON导出文件路径
<!--rehype:className=style-list-->
### 命令行选项
:- | :-
:- | :-
`-0`, `--disable-irix` | 任务的CPU使用率将按CPU总数进行划分
`-1`, `--percpu` | 以每个CPU模式启动Glances
`-2`, `--disable-left-sidebar` | 禁用网络、磁盘I/O、文件系统和传感器模块
`-3`, `--disable-quicklook` | 禁用快速查看模块
`-4`, `--full-quicklook` | 仅启用快速查看和负载模块
`-5`, `--disable-top` | 禁用顶部菜单快速查看、CPU、内存、交换区和负载
`-6`, `--meangpu` | 以平均GPU模式启动Glances
<!--rehype:className=style-list-->
### 命令行选项
:- | :-
:- | :-
`-c CLIENT`, `--client CLIENT` | 通过IPv4/IPv6地址、主机名或主机名:端口连接到Glances服务器
`-s`, `--server` | 以服务器模式运行Glances
`--browser` | 启动客户端浏览器(服务器列表)
`-p PORT`, `--port PORT` | 定义客户端/服务器TCP端口 \[默认61209]
`-B BIND_ADDRESS`, `--bind BIND_ADDRESS` | 将服务器绑定到给定的IPv4/IPv6地址或主机名
`--username` | 定义客户端/服务器用户名
`--password` | 定义客户端/服务器密码
<!--rehype:className=style-list-->
### 命令行选项
:- | :-
:- | :-
`-t TIME`, `--time TIME` | 设置刷新时间(秒)\[默认3秒]
`-w`, `--webserver` | 以Web服务器模式运行Glances需要bottle库
`--cached-time CACHED_TIME` | 设置服务器缓存时间 \[默认1秒]
`--open-web-browser` | 尝试在默认的 Web 浏览器中打开Web界面
`-f PROCESS_FILTER`, `--process-filter PROCESS_FILTER` | 设置进程过滤模式(正则表达式)
`--process-short-name` | 强制使用进程名称的短名称
`--hide-kernel-threads` | 在进程列表中隐藏内核线程Windows不可用
<!--rehype:className=style-list-->
### 命令行选项
:- | :-
:- | :-
`-b`, `--byte` | 以每秒字节数显示网络速率
`--diskio-show-ramfs` | 在 DiskIO 插件中显示RAM文件系统
`--diskio-iops` | 在 DiskIO 插件中显示每秒I/O操作数
`--fahrenheit` | 以华氏度显示温度(默认是摄氏度)
`--fs-free-space` | 显示文件系统的可用空间而非已用空间
`--theme-white` | 优化显示颜色以适应白色背景
<!--rehype:className=style-list-->
键盘快捷键
---
### 快捷键
| 快捷键 | 功能 |
|--------|-----------------------------|
| `ENTER` | 设置进程过滤器 |
| `a` | 自动排序进程列表 |
| `A` | 启用/禁用应用程序监控进程 |
| `b` | 在网络I/O中切换比特/秒或字节/秒 |
| `B` | 查看每秒磁盘I/O计数器 |
| `c` | 按CPU使用率排序进程 |
| `C` | 启用/禁用云统计 |
| `d` | 显示/隐藏磁盘I/O统计 |
| `D` | 启用/禁用Docker统计 |
| `e` | 启用/禁用顶级扩展统计 |
| `E` | 清除当前进程过滤器 |
| `f` | 显示/隐藏文件系统和文件夹监控统计 |
| `F` | 在文件系统使用和可用空间之间切换 |
| `g` | 为当前历史生成图表 |
| `G` | 启用/禁用GPU统计 |
| `h` | 显示/隐藏帮助屏幕 |
| `i` | 按I/O速率排序进程 |
| `I` | 显示/隐藏IP模块 |
| `+` | 增加选定进程的nice值/降低优先级(需要权限)- 仅在独立模式下 |
| `-` | 减少选定进程的nice值/提高优先级(需要权限)- 仅在独立模式下 |
| `k` | 终止选定进程(需要权限)- 仅在独立模式下 |
<!--rehype:className=shortcuts left-align-->
### 快捷键
| 快捷键 | 功能 |
|--------|-----------------------------|
| `K` | 显示/隐藏TCP连接 |
| `l` | 显示/隐藏日志消息 |
| `m` | 按内存使用率排序进程 |
| `M` | 重置进程摘要的最小/最大值 |
| `n` | 显示/隐藏网络统计 |
| `N` | 显示/隐藏当前时间 |
| `p` | 按名称排序进程 |
| `P` | 启用/禁用端口统计 |
| `q\|ESC\|CTRL-C` | 退出当前Glances会话 |
| `Q` | 显示/隐藏IRQ模块 |
| `r` | 重置历史记录 |
| `R` | 显示/隐藏RAID插件 |
| `s` | 显示/隐藏传感器统计 |
| `S` | 启用/禁用微小曲线图 |
| `t` | 按CPU时间排序进程TIME+ |
| `T` | 以组合方式查看网络I/O |
| `u` | 按用户排序进程 |
| `U` | 查看累积网络I/O |
| `w` | 删除已完成的警告日志消息 |
| `W` | 显示/隐藏Wifi模块 |
| `x` | 删除已完成的警告和严重日志消息 |
| `z` | 显示/隐藏进程统计 |
<!--rehype:className=shortcuts left-align-->
### 快捷键
| 快捷键 | 功能 |
|--------|-----------------------------|
| `0` | 启用/禁用Irix/Solaris模式。任务的CPU使用率将按CPU总数进行划分 |
| `1` | 在全局CPU和每个CPU统计之间切换 |
| `2` | 启用/禁用左侧边栏 |
| `3` | 启用/禁用快速查看模块 |
| `4` | 启用/禁用除快速查看和负载模块外的所有模块 |
| `5` | 启用/禁用顶部菜单快速查看、CPU、内存、交换区和负载 |
| `6` | 启用/禁用平均GPU模式 |
| `9` | 在黑白主题之间切换UI主题 |
| `/` | 在进程命令行或命令名称之间切换 |
| `F5` | 刷新curses用户界面的统计数据 |
| `LEFT` | 向左导航进程排序 |
| `RIGHT` | 向右导航进程排序 |
| `UP` | 在进程列表中向上 |
| `DOWN` | 在进程列表中向下。在Glances客户端浏览器中通过`--browser`命令行参数访问): |
| `ENTER` | 运行选定的服务器 |
| `UP` | 在服务器列表中向上 |
| `DOWN` | 在服务器列表中向下 |
| `q\|ESC` | 退出Glances |
<!--rehype:className=shortcuts left-align-->
配置
---
### 位置
<!--rehype:wrap-class=col-span-2-->
您可以将自己的 `glances.conf` 文件放在以下位置:
:-- | -- | --
:-- | -- | --
`Linux`, `SunOS` | ~/.config/glances/, /etc/glances/, /usr/share/docs/glances/ |
`*BSD` |~/.config/glances/, /usr/local/etc/glances/, /usr/share/docs/glances/ |
`macOS` | ~/Library/Application Support/glances/, /usr/local/etc/glances/, /usr/share/docs/glances/ |
`Windows` | %APPDATA%\glances\glances.conf |
---
- 在 Windows XP 上,%APPDATA% 为:`C:\Documents and Settings\<USERNAME>\Application Data`
- 在 Windows Vista 及更高版本上:`C:\Users\<用户名>\AppData\Roaming`
### 语法
```ini
[global]
# 刷新率(默认为至少 2 秒)
# 可以通过 -t <sec> 选项覆盖
# 也可以在每个插件部分覆盖它
refresh=2
# Glances 是否应该检查 PyPI 上是否有更新的版本?
check_update=false
# 历史大小(最大值数)
# 默认值为288001天每3秒1分
history_size=28800
```
### CPU 插件的示例
```ini
[cpu]
disable=False
refresh=3
user_careful=50
user_warning=70
user_critical=90
iowait_careful=50
iowait_warning=70
iowait_critical=90
system_careful=50
system_warning=70
system_critical=90
steal_careful=50
steal_warning=70
steal_critical=90
```
### InfluxDB 导出模块
```ini
[influxdb]
# 配置 --export influxdb 选项
# https://influxdb.com/
host=localhost
port=8086
user=root
password=root
db=glances
prefix=localhost
#tags=foo:bar,spam:eggs
```
### Nginx AMP
```ini
[amp_nginx]
# 应启用 Nginx 状态页面
# https://easyengine.io/tutorials/nginx/status-page/
enable=true
regex=\/usr\/sbin\/nginx
refresh=60
one_line=false
status_url=http://localhost/nginx_status
```
<!--rehype:className=wrap-text-->
导出统计服务
---
### CSV
```sh
$ glances --export csv \
--export-csv-file /tmp/glances.csv \
--quiet
```
可以将统计数据导出到 CSV 文件
### JSON
```sh
$ glances --export json \
--export-json-file /tmp/glances.json
```
可以将统计信息导出到 JSON 文件
### Cassandra
<!--rehype:wrap-class=row-span-2-->
您可以将统计数据导出到 Cassandra 或 Scylla 服务器
```ini
[cassandra]
host=localhost
port=9042
protocol_version=3
keyspace=glances
replication_factor=2
table=localhost
```
并运行 Glances
```sh
$ glances --export cassandra
```
数据模型如下:
```sql
CREATE TABLE <table> (plugin text, time timeuuid, stat map<text,float>, PRIMARY KEY (plugin, time))
```
### Graph
<!--rehype:wrap-class=col-span-2-->
```ini
[graph]
# --export graph 选项的配置
# 设置创建图形(.svg 文件)的路径
# 可以通过 --graph-path 命令行选项覆盖
path=/tmp
# 可以通过设置自动生成图表
# generate_every 为一个非零值,对应于之间的秒数
# 两代。将其设置为 0 以禁用图形自动生成。
generate_every=60
# 请参阅 Pygal lib 文档中的以下配置键定义
# http://pygal.org/en/stable/documentation/index.html
width=800
height=600
style=DarkStyle
```
并运行 Glances
```sh
$ glances --export graph \
--export-graph-path /tmp
```
### CouchDB
您可以将统计数据导出到 CouchDB 服务器
```ini
[mongodb]
host=localhost
port=27017
db=glances
user=root
password=example
```
并运行 Glances
```sh
$ glances --export mongodb
```
### InfluxDB
<!--rehype:wrap-class=col-span-2 row-span-4-->
您可以将统计数据导出到 InfluxDB 服务器(时间序列服务器)
测量 | 字段 | 标签
:-- | -- | --
cpu | user system iowait… | hostname
network | read_bytes write_bytes time_since_update… | hostname disk_name
diskio | rx tx time_since_update… | hostname interface_name
docker | cpu_percent memory_usage… | hostname name
gpu | proc mem temperature… | hostname gpu_id
<!--rehype:className=show-header-->
#### InfluxDB (最高版本 1.7.x
```ini
[influxdb]
host=localhost
port=8086
protocol=http
user=root
password=root
db=glances
# 所有测量名称都会添加前缀
# Ex: prefix=foo
# => foo.cpu
# => foo.mem
# 您还可以使用动态值
#prefix=foo
# 将为所有测量添加以下标签
# 您还可以使用动态值
# 注意:主机名始终作为标签添加
#tags=foo:bar,spam:eggs,domain:`domainname`
```
并运行 Glances
```sh
$ glances --export influxdb
```
#### InfluxDB v2来自 InfluxDB v1.8.x/Flux 和 InfluxDB v2.x
```ini
[influxdb2]
host=localhost
port=8086
protocol=http
org=nicolargo
bucket=glances
token=EjFUTWe8U-MIseEAkaVIgVnej_TrUpDy==
# 设置两个导出之间的间隔(以秒为单位)
# 如果时间间隔设置为 0
# 则使用 Glances 刷新时间(默认行为)
#interval=0
# 将为所有测量名称添加前缀
# Ex: prefix=foo
# => foo.cpu
# => foo.mem
# 您还可以使用动态值
#prefix=foo
# 将为所有测量添加以下标签
# 您还可以使用动态值.
# 注意:主机名始终作为标签添加
#tags=foo:bar,spam:eggs,domain:`domainname`
```
并运行 Glances
```sh
$ glances --export influxdb2
```
### Elasticsearch
可以将统计数据导出到 Elasticsearch 服务器
```ini
[elasticsearch]
host=localhost
port=9200
index=glances
```
并运行 Glances
```sh
$ glances --export elasticsearch
```
### MQTT
您可以将统计信息导出到 `MQTT` 服务器
```ini
[mqtt]
host=localhost
port=883
tls=true
user=glances
password=glances
topic=glances
topic_structure=per-metric
```
并运行 Glances
```sh
$ glances --export mqtt
```
### MongoDB
```ini
[couchdb]
host=localhost
port=
user=root
password=example
db=glances
```
并运行 Glances
```sh
$ glances --export couchdb
```
### OpenTSDB
```ini
[opentsdb]
host=localhost
port=4242
prefix=glances
tags=foo:bar,spam:eggs
```
并运行 Glances
```sh
$ glances --export opentsdb
```
### Kafka
<!--rehype:wrap-class=col-span-2 row-span-3-->
您可以将统计信息导出到 Kafka 服务器
```ini
[kafka]
host=localhost
port=9092
topic=glances
#compression=gzip
# Tags will be added for all events
#tags=foo:bar,spam:eggs
# You can also use dynamic values
#tags=hostname:`hostname -f`
```
并运行 Glances
```sh
$ glances --export kafka
```
内存插件的记录示例:
```py
ConsumerRecord(topic=u'glances', partition=0, offset=1305, timestamp=1490460592248, timestamp_type=0, key='mem', value=u'{"available": 2094710784, "used": 5777428480, "cached": 2513543168, "mem_careful": 50.0, "percent": 73.4, "free": 2094710784, "mem_critical": 90.0, "inactive": 2361626624, "shared": 475504640, "history_size": 28800.0, "mem_warning": 70.0, "total": 7872139264, "active": 4834361344, "buffers": 160112640}', checksum=214895201, serialized_key_size=3, serialized_value_size=303)
```
<!--rehype:className=wrap-text-->
使用 Kafka Glances 插件的 Python 代码示例:
```py
from kafka import KafkaConsumer
import json
consumer = KafkaConsumer('glances', value_deserializer=json.loads)
for s in consumer:
print(s)
```
### Prometheus
```ini
[prometheus]
host=localhost
port=9091
prefix=glances
labels=src:glances
```
并运行 Glances
```sh
$ glances --export prometheus
```
### RabbitMQ
```ini
[rabbitmq]
host=localhost
port=5672
user=glances
password=glances
queue=glances_queue
#protocol=amqps
```
并运行 Glances
```sh
$ glances --export rabbitmq
```
### RESTful
<!--rehype:wrap-class=row-span-2-->
```ini
[restful]
# --export-restful 选项的配置
# 例如,导出到 http://localhost:6789/
host=localhost
port=6789
protocol=http
path=/
```
URL语法
```
http://localhost:6789/
| | | |
| | | path
| | port
| host
protocol
```
并运行 Glances
```sh
$ glances --export restful
```
### ZeroMQ
<!--rehype:wrap-class=row-span-2-->
```ini
[zeromq]
host=127.0.0.1
port=5678
prefix=G
```
并运行 Glances
```sh
$ glances --export zeromq
```
以下是订阅 Glances 统计数据的简单 Python 客户端:
```py
import json
import zmq
context = zmq.Context()
subscriber = context.socket(zmq.SUB)
subscriber.setsockopt(zmq.SUBSCRIBE, 'G')
subscriber.connect("tcp://127.0.0.1:5678")
while True:
_, plugin, data_raw = subscriber.recv_multipart()
data = json.loads(data_raw)
print('{} => {}'.format(plugin, data))
subscriber.close()
context.term()
```
### Riemann
```ini
[riemann]
host=localhost
port=5555
```
并运行 Glances
```sh
$ glances --export riemann
```
### StatsD
```ini
[statsd]
host=localhost
port=8125
prefix=glances
```
并运行 Glances
```sh
$ glances --export statsd
```
另见
----
- [Glances 官方文档](https://nicolargo.github.io/glances/) _nicolargo.github.io_

View File

@@ -59,7 +59,7 @@ Google Chrome 键盘快捷键备忘清单
:- | -
`(type)` `Enter` | 使用您的默认搜索引擎进行搜索
`(type)` `Tab` | 使用不同的搜索引擎搜索
`Ctrl` `Enter` | 添加 www. 和 .com 到站点名称,并在当前选项卡中打开
`Ctrl` `Enter` | 添加 <www>. 和 .com 到站点名称,并在当前选项卡中打开
`Alt` `Enter` | 打开新标签页并执行 Google 搜索
`Ctrl` `L` | 跳转到地址栏
`Ctrl` `K` | 从页面上的任何位置搜索

View File

@@ -33,110 +33,170 @@ export HOMEBREW_INSTALL_FROM_API=1
```
<!--rehype:className=wrap-text -->
### 命令
### 安装卸载
<!--rehype:wrap-class=row-span-2-->
命令 | 说明
:--- :---
:--- | :---
`brew install git` | `安装`一个软件包
`brew reinstall git` | 重新`安装`一个软件包
`brew uninstall git` | `删除`/`卸载`软件包
`brew upgrade git` | 升级一个软件包
`brew upgrade` | 升级所有可升级的包
:--- :---
`brew switch git 2.5.0` | 切换软件包的版本
`brew unlink git` | 取消软件包的链接
`brew link git` | 链接已有的软件包
`brew switch git 2.5.0` | 切换软件包的版本
:--- :---
`brew list --versions git` | 查看安装的软件包及其版本信息
`brew cleanup git` | 删除旧版本的软件包及依赖
### 更多包命令
### 升级
命令 | 说明
:--- :---
`brew info git` | 显示软件包的版本、依赖、注意事项等信息
`brew cleanup git` | 删除旧版本的软件包及其依赖
`brew edit git` | 编辑此软件包的安装脚本
`brew cat git` | 打印此软件包的安装脚本
`brew home git` | 打开此软件包的主页
`brew search git` | 搜索软件包公式并显示相关信息
:--- | :---
`brew upgrade git` | 升级一个软件包
`brew upgrade` | 升级所有可升级的软件包
`brew update` | 更新 `Homebrew``Cask`
### Brew Cask 命令
命令 | 说明
:--- :---
:--- | :---
`brew install --cask firefox` | 安装火狐浏览器
`brew list --cask` | 列出已安装应用
Cask 命令用于与图形界面应用程序交互,可以安装和管理 macOS 上的图形界面应用程序
### 更多包命令
<!--rehype:wrap-class=row-span-2-->
命令 | 说明
:--- | :---
`brew info git` | 显示软件包的版本、依赖、注意事项等信息
`brew edit git` | 编辑此软件包的安装脚本
`brew cat git` | 打印此软件包的安装脚本
`brew home git` | 打开此软件包的主页
`brew search git` | 搜索软件包公式并显示相关信息
`brew list --versions git` | 查看安装的软件包及其版本信息
<!--rehype:className=style-list-->
### 全局命令
<!--rehype:wrap-class=row-span-2-->
命令 | 说明
:--- :---
`brew update` | 更新 `Homebrew``Cask`
`brew upgrade` | 升级所有可升级的软件包
:--- | :---
`brew list` | 列出已安装的软件包
`brew outdated` | 列出需要升级的软件包
`brew doctor` | 诊断 Homebrew 是否存在问题
`brew pin <formula>` | 防止指定软件包被升级
`brew unpin <formula>` | 允许指定软件包被升级
<!--rehype:className=style-list-->
### 帮助命令
命令 | 说明
:--- | :---
`brew help` | 打印帮助信息
`brew help <sub-command>` | 打印子命令的帮助信息
<!--rehype:className=style-list-->
### Brew 清理
<!--rehype:wrap-class=row-span-2-->
删除旧版本的已安装软件包
```bash
$ brew cleanup
```
删除旧版本指定软件包
```bash
$ brew cleanup <formula>
```
删除未安装的软件包
```bash
$ brew cleanup -s
```
删除所有 Homebrew 缓存
```bash
$ brew cleanup --prune=all
```
直接删除 Homebrew 的缓存目录
```bash
$ rm -rf $(brew --cache)
```
显示所有将被删除的软件包(试运行)
```bash
$ brew cleanup # 删除旧版本的已安装软件包
$ brew cleanup <formula> # 删除旧版本指定软件包
$ brew cleanup -s # 删除未安装的软件包
$ brew cleanup --prune=all # 删除所有 Homebrew 缓存
$ rm -rf $(brew --cache) # 直接删除 Homebrew 的缓存目录
# 显示所有将被删除的软件包(试运行)
$ brew cleanup -n
```
### Brew 源码仓库
列出所有当前点击的源码仓库(点击)
```bash
# 列出所有当前点击的源码仓库(点击)
$ brew tap
# 使用 https 从 Github 中点击软件包源码仓库以点击
```
使用 https 从 Github 中点击软件包源码仓库以点击
```bash
# https://github.com/user/homebrew-repo
$ brew tap <user/repo>
# 点击指定 URL 中的软件源码仓库
```
点击指定 URL 中的软件源码仓库
```bash
$ brew tap <user/repo> <URL>
# 从存储库中删除给定的源码仓库
```
从存储库中删除给定的源码仓库
```bash
$ brew untap <user/repo>
```
### 搜索查看
列出所有已安装的软件包
```bash
# 列出所有已安装的软件包
$ brew list
# 显示所有本地可用的 brew 配方
```
显示所有本地可用的 brew 配方
```bash
$ brew search
# 搜索包含指定字符的 brew 配方
```
搜索包含指定字符的 brew 配方
```bash
$ brew search <text>
# 显示有关软件包的信息
```
显示有关软件包的信息
```bash
$ brew info <formula>
```
### 帮助命令
命令 | 说明
:--- :---
`brew help` | 打印帮助信息
`brew help <sub-command>` | 打印子命令的帮助信息
### 依赖
显示`包`的依赖关系。 特定于`包`的其他选项可能是附加到命令
命令 | 说明
:--- | :---
`brew deps --tree --installed` | 查看包和依赖关系图
`brew deps git` | 显示 git 依赖
<!--rehype:className=style-list-->
```bash
# 您还可以看到包和依赖关系图
$ brew deps --tree --installed
$ brew deps git # 显示 git 依赖
```
显示`包`的依赖关系。 特定于`包`的其他选项可能是附加到命令
### 卸载 Homebrew

1025
docs/hook.md Normal file

File diff suppressed because it is too large Load Diff

267
docs/iso-3166-1.md Normal file
View File

@@ -0,0 +1,267 @@
ISO 3166-1 国家代码 备忘清单
===
这是一个符合 ISO 3166-1 标准的 ISO 国家代码列表,它为多语言网站提供参考。
ISO 3166-1 代码列表
----
### 完整代码
<!--rehype:wrap-class=col-span-3-->
英文短名称 | 二位代码 | 三位代码 | 数字代码 | 中文名称(简体) | 中文名称(繁体)
:-|:-|:-|:-|:-|:-
Afghanistan | AF | AFG | 004 | 阿富汗 | 阿富汗
Åland Islands | AX | ALA | 248 | 奥兰 | 奧蘭
Albania | AL | ALB | 008 | 阿尔巴尼亚 | 阿爾巴尼亞
Algeria | DZ | DZA | 012 | 阿尔及利亚 | 阿爾及利亞
American Samoa | AS | ASM | 016 | 美属萨摩亚 | 美屬薩摩亞
Andorra | AD | AND | 020 | 安道尔 | 安道爾
Angola | AO | AGO | 024 | 安哥拉 | 安哥拉
Anguilla | AI | AIA | 660 | 安圭拉 | 安圭拉
Antarctica | AQ | ATA | 010 | 南极洲 | 南極洲
Antigua and Barbuda | AG | ATG | 028 | 安提瓜和巴布达 | 安提瓜和巴布達
Argentina | AR | ARG | 032 | 阿根廷 | 阿根廷
Armenia | AM | ARM | 051 | 亚美尼亚 | 亞美尼亞
Aruba | AW | ABW | 533 | 阿鲁巴 | 阿魯巴
Australia | AU | AUS | 036 | 澳大利亚 | 澳大利亞
Austria | AT | AUT | 040 | 奥地利 | 奧地利
Azerbaijan | AZ | AZE | 031 | 阿塞拜疆 | 阿塞拜疆
Bahamas | BS | BHS | 044 | 巴哈马 | 巴哈馬
Bahrain | BH | BHR | 048 | 巴林 | 巴林
Bangladesh | BD | BGD | 050 | 孟加拉国 | 孟加拉國
Barbados | BB | BRB | 052 | 巴巴多斯 | 巴巴多斯
Belarus | BY | BLR | 112 | 白俄罗斯 | 白俄羅斯
Belgium | BE | BEL | 056 | 比利时 | 比利時
Belize | BZ | BLZ | 084 | 伯利兹 | 伯利茲
Benin | BJ | BEN | 204 | 贝宁 | 貝寧
Bermuda | BM | BMU | 060 | 百慕大 | 百慕大
Bhutan | BT | BTN | 064 | 不丹 | 不丹
Bolivia (Plurinational State of) | BO | BOL | 068 | 玻利维亚 | 玻利維亞
Bonaire, Sint Eustatius and Saba | BQ | BES | 535 | 荷兰加勒比区 | 荷蘭加勒比區
Bosnia and Herzegovina | BA | BIH | 070 | 波斯尼亚和黑塞哥维那 | 波斯尼亞和黑塞哥維那
Botswana | BW | BWA | 072 | 波札那 | 波札那
Bouvet Island | BV | BVT | 074 | 布韦岛 | 布韋島
Brazil | BR | BRA | 076 | 巴西 | 巴西
British Indian Ocean Territory | IO | IOT | 086 | 英属印度洋领地 | 英屬印度洋領地
Brunei Darussalam | BN | BRN | 096 | 汶莱 | 汶萊
Bulgaria | BG | BGR | 100 | 保加利亚 | 保加利亞
Burkina Faso | BF | BFA | 854 | 布基纳法索 | 布吉納法索
Burundi | BI | BDI | 108 | 布隆迪 | 蒲隆地
Cabo Verde | CV | CPV | 132 | 佛得角 | 佛得角
Cambodia | KH | KHM | 116 | 柬埔寨 | 柬埔寨
Cameroon | CM | CMR | 120 | 喀麦隆 | 喀麦隆
Canada | CA | CAN | 124 | 加拿大 | 加拿大
Cayman Islands | KY | CYM | 136 | 开曼群岛 | 開曼群島
Central African Republic | CF | CAF | 140 | 中非共和国 | 中非共和國
Chad | TD | TCD | 148 | 乍得 | 乍得
Chile | CL | CHL | 152 | 智利 | 智利
China | CN | CHN | 156 | 中华人民共和国 | 中華人民共和國
Christmas Island | CX | CXR | 162 | 圣诞岛 | 聖诞島
Cocos (Keeling) Islands | CC | CCK | 166 | 科科斯(基林)群岛 | 科科斯(基林)群島
Colombia | CO | COL | 170 | 哥伦比亚 | 哥倫比亞
Comoros | KM | COM | 174 | 葛摩 | 葛摩
Congo | CG | COG | 178 | 刚果 | 剛果共和國
Congo (Democratic Republic of the) | CD | COD | 180 | 刚果(金) | 剛果民主共和國
Cook Islands | CK | COK | 184 | 库克群岛 | 庫克群島
Costa Rica | CR | CRI | 188 | 哥斯达黎加 | 哥斯達黎加
Côte d'Ivoire | CI | CIV | 384 | 科特迪瓦 | 科特迪瓦
Croatia | HR | HRV | 191 | 克罗地亚 | 克羅地亞
Cuba | CU | CUB | 192 | 古巴 | 古巴
Curaçao | CW | CUW | 531 | 库拉索 | 庫拉索
Cyprus | CY | CYP | 196 | 塞浦路斯 | 賽普勒斯
Czechia | CZ | CZE | 203 | 捷克 | 捷克
Denmark | DK | DNK | 208 | 丹麦 | 丹麥
Djibouti | DJ | DJI | 262 | 吉布提 | 吉布提
Dominica | DM | DMA | 212 | 多米尼克 | 多米尼克
Dominican Republic | DO | DOM | 214 | 多米尼加 | 多明尼加
Ecuador | EC | ECU | 218 | 厄瓜多尔 | 厄瓜多爾
Egypt | EG | EGY | 818 | 埃及 | 埃及
El Salvador | SV | SLV | 222 | 萨尔瓦多 | 薩爾瓦多
Equatorial Guinea | GQ | GNQ | 226 | 赤道几内亚 | 赤道幾內亞
Eritrea | ER | ERI | 232 | 厄立特里亚 | 厄立特里亚
Estonia | EE | EST | 233 | 爱沙尼亚 | 愛沙尼亞
Eswatini | SZ | SWZ | 748 | 斯威士兰 | 斯威士蘭
Ethiopia | ET | ETH | 231 | 埃塞俄比亚 | 埃塞俄比亞
Falkland Islands (Malvinas) | FK | FLK | 238 | 福克兰群岛 | 福克蘭群島
Faroe Islands | FO | FRO | 234 | 法罗群岛 | 法羅群島
Fiji | FJ | FJI | 242 | 斐济 | 斐濟
Finland | FI | FIN | 246 | 芬兰 | 芬蘭
France | FR | FRA | 250 | 法国 | 法國
French Guiana | GF | GUF | 254 | 法属圭亚那 | 法屬圭亞那
French Polynesia | PF | PYF | 258 | 法属波利尼西亚 | 法屬玻里尼西亞
French Southern Territories | TF | ATF | 260 | 法属南部领地 | 法屬南部和南极領地
Gabon | GA | GAB | 266 | 加蓬 | 加蓬
Gambia | GM | GMB | 270 | 冈比亚 | 岡比亞
Georgia | GE | GEO | 268 | 格鲁吉亚 | 喬治亞
Germany | DE | DEU | 276 | 德国 | 德國
Ghana | GH | GHA | 288 | 加纳 | 加納
Gibraltar | GI | GIB | 292 | 直布罗陀 | 直布羅陀
Greece | GR | GRC | 300 | 希腊 | 希臘
Greenland | GL | GRL | 304 | 格陵兰 | 格陵蘭
Grenada | GD | GRD | 308 | 格林纳达 | 格林納達
Guadeloupe | GP | GLP | 312 | 瓜德罗普 | 瓜德羅普
Guam | GU | GUM | 316 | 关岛 | 關島
Guatemala | GT | GTM | 320 | 危地马拉 | 危地馬拉
Guernsey | GG | GGY | 831 | 根西 | 根西
Guinea | GN | GIN | 324 | 几内亚 | 幾內亞
Guinea-Bissau | GW | GNB | 624 | 几内亚比绍 | 幾內亞比索
Guyana | GY | GUY | 328 | 圭亚那 | 圭亞那
Haiti | HT | HTI | 332 | 海地 | 海地
Heard Island and McDonald Islands | HM | HMD | 334 | 赫德岛和麦克唐纳群岛 | 赫德島和麥克唐納群島
Holy See | VA | VAT | 336 | 梵蒂冈 | 梵蒂岡
Honduras | HN | HND | 340 | 洪都拉斯 | 洪都拉斯
Hong Kong | HK | HKG | 344 | 香港 | 香港
Hungary | HU | HUN | 348 | 匈牙利 | 匈牙利
Iceland | IS | ISL | 352 | 冰岛 | 冰島
India | IN | IND | 356 | 印度 | 印度
Indonesia | ID | IDN | 360 | 印度尼西亚 | 印度尼西亞
Iran (Islamic Republic of) | IR | IRN | 364 | 伊朗 | 伊朗
Iraq | IQ | IRQ | 368 | 伊拉克 | 伊拉克
Ireland | IE | IRL | 372 | 爱尔兰 | 愛爾蘭
Isle of Man | IM | IMN | 833 | 曼岛 | 曼島
Israel | IL | ISR | 376 | 以色列 | 以色列
Italy | IT | ITA | 380 | 意大利 | 義大利
Jamaica | JM | JAM | 388 | 牙买加 | 牙買加
Japan | JP | JPN | 392 | 日本 | 日本
Jersey | JE | JEY | 832 | 泽西 | 澤西
Jordan | JO | JOR | 400 | 约旦 | 約旦
Kazakhstan | KZ | KAZ | 398 | 哈萨克斯坦 | 哈薩克斯坦
Kenya | KE | KEN | 404 | 肯尼亚 | 肯尼亞
Kiribati | KI | KIR | 296 | 基里巴斯 | 基里巴斯
Korea (Democratic People's Republic of) | KP | PRK | 408 | 朝鲜 | 朝鮮民主主義人民共和國
Korea (Republic of) | KR | KOR | 410 | 韩国 | 大韓民國
Kuwait | KW | KWT | 414 | 科威特 | 科威特
Kyrgyzstan | KG | KGZ | 417 | 吉尔吉斯斯坦 | 吉爾吉斯斯坦
Lao People's Democratic Republic | LA | LAO | 418 | 老挝 | 老挝
Latvia | LV | LVA | 428 | 拉脱维亚 | 拉脫維亞
Lebanon | LB | LBN | 422 | 黎巴嫩 | 黎巴嫩
Lesotho | LS | LSO | 426 | 莱索托 | 賴索托
Liberia | LR | LBR | 430 | 利比里亚 | 利比里亚
Libya | LY | LBY | 434 | 利比亚 | 利比亞
Liechtenstein | LI | LIE | 438 | 列支敦士登 | 列支敦士登
Lithuania | LT | LTU | 440 | 立陶宛 | 立陶宛
Luxembourg | LU | LUX | 442 | 卢森堡 | 盧森堡
Macao | MO | MAC | 446 | 澳门 | 澳門
Madagascar | MG | MDG | 450 | 马达加斯加 | 馬達加斯加
Malawi | MW | MWI | 454 | 马拉维 | 馬拉維
Malaysia | MY | MYS | 458 | 马来西亚 | 馬來西亞
Maldives | MV | MDV | 462 | 马尔代夫 | 馬爾代夫
Mali | ML | MLI | 466 | 马里 | 馬里
Malta | MT | MLT | 470 | 马耳他 | 馬耳他
Marshall Islands | MH | MHL | 584 | 马绍尔群岛 | 馬紹爾群島
Martinique | MQ | MTQ | 474 | 马提尼克 | 馬提尼克
Mauritania | MR | MRT | 478 | 毛里塔尼亚 | 毛里塔尼亞
Mauritius | MU | MUS | 480 | 毛里求斯 | 毛里求斯
Mayotte | YT | MYT | 175 | 马约特 | 馬約特
Mexico | MX | MEX | 484 | 墨西哥 | 墨西哥
Micronesia (Federated States of) | FM | FSM | 583 | 密克罗尼西亚联邦 | 密克罗尼西亞聯邦
Moldova (Republic of) | MD | MDA | 498 | 摩尔多瓦 | 摩爾多瓦
Monaco | MC | MCO | 492 | 摩纳哥 | 摩納哥
Mongolia | MN | MNG | 496 | 蒙古 | 蒙古
Montenegro | ME | MNE | 499 | 黑山 | 蒙特內哥羅
Montserrat | MS | MSR | 500 | 蒙特塞拉特 | 蒙特塞拉特
Morocco | MA | MAR | 504 | 摩洛哥 | 摩洛哥
Mozambique | MZ | MOZ | 508 | 莫桑比克 | 莫桑比克
Myanmar | MM | MMR | 104 | 缅甸 | 緬甸
Namibia | NA | NAM | 516 | 纳米比亚 | 納米比亞
Nauru | NR | NRU | 520 | 诺鲁 | 諾魯
Nepal | NP | NPL | 524 | 荷兰 | 荷蘭
New Caledonia | NC | NCL | 540 | 新喀里多尼亚 | 新喀里多尼亞
New Zealand | NZ | NZL | 554 | 新西兰 | 新西蘭
Nicaragua | NI | NIC | 558 | 尼加拉瓜 | 尼加拉瓜
Niger | NE | NER | 562 | 尼日尔 | 尼日爾
Nigeria | NG | NGA | 566 | 尼日利亚 | 奈及利亞
Niue | NU | NIU | 570 | 纽埃 | 紐埃
Norfolk Island | NF | NFK | 574 | 诺福克岛 | 諾福克島
North Macedonia | MK | MKD | 807 | 北马其顿 | 北馬其頓
Northern Mariana Islands | MP | MNP | 580 | 北马里亚纳群岛 | 北馬里亞納群島
Norway | NO | NOR | 578 | 挪威 | 挪威
Oman | OM | OMN | 512 | 阿曼 | 阿曼
Pakistan | PK | PAK | 586 | 巴基斯坦 | 巴基斯坦
Palau | PW | PLW | 585 | 帛琉 | 帛琉
Palestine, State of | PS | PSE | 275 | 巴勒斯坦 | 巴勒斯坦國
Panama | PA | PAN | 591 | 巴拿马 | 巴拿馬
Papua New Guinea | PG | PNG | 598 | 巴布亚新几内亚 | 巴布亞新幾內亞
Paraguay | PY | PRY | 600 | 巴拉圭 | 巴拉圭
Peru | PE | PER | 604 | 秘鲁 | 秘魯
Philippines | PH | PHL | 608 | 菲律宾 | 菲律賓
Pitcairn | PN | PCN | 612 | 皮特凯恩群岛 | 皮特凱恩群島
Poland | PL | POL | 616 | 波兰 | 波蘭
Portugal | PT | PRT | 620 | 葡萄牙 | 葡萄牙
Puerto Rico | PR | PRI | 630 | 波多黎各 | 波多黎各
Qatar | QA | QAT | 634 | 卡塔尔 | 卡塔爾
Réunion | RE | REU | 638 | 留尼汪 | 留尼汪
Romania | RO | ROU | 642 | 罗马尼亚 | 羅馬尼亞
Russian Federation | RU | RUS | 643 | 俄罗斯 | 俄羅斯
Rwanda | RW | RWA | 646 | 卢旺达 | 盧旺达
Saint Barthélemy | BL | BLM | 652 | 圣巴泰勒米 | 聖巴泰勒米
Saint Helena, Ascension and Tristan da Cunha | SH | SHN | 654 | 圣赫勒拿 | 聖赫勒拿
Saint Kitts and Nevis | KN | KNA | 659 | 圣克里斯多福及尼维斯 | 聖克里斯多福及尼維斯
Saint Lucia | LC | LCA | 662 | 圣卢西亚 | 聖盧西亞
Saint Martin (French part) | MF | MAF | 663 | 法属圣马丁 | 法屬聖馬丁
Saint Pierre and Miquelon | PM | SPM | 666 | 圣皮埃尔和密克隆 | 聖皮埃爾和密克隆
Saint Vincent and the Grenadines | VC | VCT | 670 | 圣文森特和格林纳丁斯 | 聖文森特和格林納丁斯
Samoa | WS | WSM | 882 | 萨摩亚 | 薩摩亞
San Marino | SM | SMR | 674 | 圣马力诺 | 聖馬力諾
Sao Tome and Principe | ST | STP | 678 | 圣多美和普林西比 | 聖多美和普林西比
Saudi Arabia | SA | SAU | 682 | 沙特阿拉伯 | 沙特阿拉伯
Senegal | SN | SEN | 686 | 塞内加尔 | 塞內加爾
Serbia | RS | SRB | 688 | 塞尔维亚 | 塞爾維亞
Seychelles | SC | SYC | 690 | 塞舌尔 | 塞舌爾
Sierra Leone | SL | SLE | 694 | 塞拉利昂 | 塞拉利昂
Singapore | SG | SGP | 702 | 新加坡 | 新加坡
Sint Maarten (Dutch part) | SX | SXM | 534 | 荷属圣马丁 | 荷屬聖馬丁
Slovakia | SK | SVK | 703 | 斯洛伐克 | 斯洛伐克
Slovenia | SI | SVN | 705 | 斯洛文尼亚 | 斯洛文尼亞
Solomon Islands | SB | SLB | 090 | 所罗门群岛 | 所羅門群島
Somalia | SO | SOM | 706 | 索马里 | 索馬里
South Africa | ZA | ZAF | 710 | 南非 | 南非
South Georgia and the South Sandwich Islands | GS | SGS | 239 | 南乔治亚岛和南桑威奇群岛 | 南喬治亞島和南桑威奇群島
South Sudan | SS | SSD | 728 | 南苏丹 | 南蘇丹
Spain | ES | ESP | 724 | 西班牙 | 西班牙
Sri Lanka | LK | LKA | 144 | 斯里兰卡 | 斯里蘭卡
Sudan | SD | SDN | 729 | 苏丹 | 蘇丹
Suriname | SR | SUR | 740 | 苏里南 | 蘇利南
Svalbard and Jan Mayen | SJ | SJM | 744 | 斯瓦尔巴德群岛 | 斯瓦巴和揚馬延
Sweden | SE | SWE | 752 | 瑞典 | 瑞典
Switzerland | CH | CHE | 756 | 瑞士 | 瑞士
Syrian Arab Republic | SY | SYR | 760 | 叙利亚 | 敘利亞
Taiwan, Province of China | TW | TWN | 158 | 台湾 | 中國台灣省
Tanzania, United Republic of | TZ | TZA | 834 | 坦桑尼亚 | 坦桑尼亞
Thailand | TH | THA | 764 | 泰国 | 泰國
Timor-Leste | TL | TLS | 626 | 东帝汶 | 東帝汶
Togo | TG | TGO | 768 | 多哥 | 多哥
Tokelau | TK | TKL | 772 | 托克劳 | 托克勞
Tonga | TO | TON | 776 | 汤加 | 東加
Trinidad and Tobago | TT | TTO | 780 | 特立尼达和多巴哥 | 千里達及托巴哥
Tunisia | TN | TUN | 788 | 突尼斯 | 突尼西亞
Türkiye | TR | TUR | 792 | 土耳其 | 土耳其
Turkmenistan | TM | TKM | 795 | 土库曼斯坦 | 土庫曼斯坦
Turks and Caicos Islands | TC | TCA | 796 | 特克斯和凯科斯群岛 | 特克斯和凱科斯群島
Tuvalu | TV | TUV | 798 | 图瓦卢 | 圖瓦盧
Uganda | UG | UGA | 800 | 乌干达 | 烏干達
Ukraine | UA | UKR | 804 | 乌克兰 | 烏克蘭
United Arab Emirates | AE | ARE | 784 | 阿拉伯联合酋长国 | 阿拉伯聯合大公國
United Kingdom of Great Britain and Northern Ireland | GB | GBR | 826 | 英国 | 英國
United States of America | US | USA | 840 | 美国 | 美國
United States Minor Outlying Islands | UM | UMI | 581 | 美属小离岛 | 美國本土外小島嶼
Uruguay | UY | URY | 858 | 乌拉圭 | 烏拉圭
Uzbekistan | UZ | UZB | 860 | 乌兹别克斯坦 | 烏茲別克斯坦
Vanuatu | VU | VUT | 548 | 瓦努阿图 | 瓦努阿圖
Venezuela (Bolivarian Republic of) | VE | VEN | 862 | 委内瑞拉 | 委內瑞拉
Viet Nam | VN | VNM | 704 | 越南 | 越南
Virgin Islands (British) | VG | VGB | 92 | 英属维尔京群岛 | 英屬維爾京群島
Virgin Islands (U.S.) | VI | VIR | 850 | 美属维尔京群岛 | 美屬維爾京群島
Wallis and Futuna | WF | WLF | 876 | 瓦利斯群岛和富图纳群岛 | 瓦利斯群島和富圖納群島
Western Sahara | EH | ESH | 732 | 西撒哈拉 | 西撒哈拉
Yemen | YE | YEM | 887 | 也门 | 也門
Zambia | ZM | ZMB | 894 | 赞比亚 | 賛比亞
Zimbabwe | ZW | ZWE | 716 | 津巴布韦 | 津巴布韋
<!--rehype:className=show-header-->
另见
---
<!--rehype:wrap-class=col-span-3-->
- [ISO_3166-1](https://zh.wikipedia.org/wiki/ISO_3166-1) _(wikipedia.org)_

View File

@@ -3,7 +3,7 @@ ISO 639-1 Language Code 备忘清单
这是一个符合 ISO 639-1 标准的 ISO 语言代码列表,它为多语言网站提供参考。
入门
说明
----
### 介绍

View File

@@ -465,6 +465,47 @@ int max = (a > b) ? a : b;
System.out.println(max);
```
### 逻辑运算符
```java
// 与运算
if (condition1 && condition2) {
// 如果 condition1 和 condition2 都成立
// 则执行此处的代码
}
// 或运算
if (condition1 || condition2) {
// 如果condition1或condition2任意一个成立
// 则执行此处的代码
}
// 非运算
if (!condition) {
// 如果条件不成立,则执行此处的代码
}
```
### 比较运算
```java
// 等于
if (a == b) {
// 如果a等于b则执行此处的代码
}
// 不等于
if (a != b) {
// 如果a不等于b则执行此处的代码
}
// 大于、大于等于、小于、小于等于
if (a > b) {}
if (a >= b) {}
if (a < b) {}
if (a <= b) {}
```
Java 循环
----
@@ -545,9 +586,10 @@ for (int i = 0; i < 5; i++) {
```
Java 多线程
--------------------
---
### 创建线程
<!--rehype:wrap-class=row-span-2 col-span-2-->
```java
// 实现Runnable接口
@@ -557,8 +599,11 @@ public class RunnableThread implements Runnable {
// todo something
}
}
```
// 实现Callable接口,T 替换成实际类型
实现Callable接口,T 替换成实际类型
```java
public class CallableTask implements Callable<T> {
@Override
public T call() throws Exception {
@@ -566,43 +611,50 @@ public class CallableTask implements Callable<T> {
return null;
}
}
```
// 继承Thrad类
继承Thrad类
```java
public class ExtendsThread extends Thread {
@Override
public void run() {
// todo something
}
}
```
// 运行线程
运行线程
```java
public static void main(String[] args) throws ExecutionException, InterruptedException {
new Thread(new RunnableThread()).start();
new ExtendsThread2().start();
FutureTask<Integer> integerFutureTask = new FutureTask<>(new CallableTask());
integerFutureTask.run();
}
new Thread(new RunnableThread()).start();
new ExtendsThread2().start();
FutureTask<Integer> integerFutureTask = new FutureTask<>(new CallableTask());
integerFutureTask.run();
}
```
### 线程池
- corePoolSize: 核心线程数
- maximumPoolSize: 最大线程数
- keepAliveTime: 线程空闲时间
- timeUni: 线程空闲时间单位
- workQueue: 线程等待队列
- threadFactory: 线程创建工厂
- handler: 拒绝策略
```java
/**
* corePoolSize: 核心线程数
* maximumPoolSize: 最大线程数
* keepAliveTime: 线程空闲时间
* timeUni: 线程空闲时间单位
* workQueue: 线程等待队列
* threadFactory: 线程创建工厂
* handler: 拒绝策略
*/
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
2, 5,
5, TimeUnit.SECONDS,
new ArrayBlockingQueue<>(10),
new DefaultThreadFactory("pollName"),
new ThreadPoolExecutor.CallerRunsPolicy());
ThreadPoolExecutor threadPoolExecutor
= new ThreadPoolExecutor(
2, 5,
5, TimeUnit.SECONDS,
new ArrayBlockingQueue<>(10),
new DefaultThreadFactory("pollName"),
new ThreadPoolExecutor.CallerRunsPolicy()
);
// 内置的线程池, 不推荐生产使用
Executors.newCachedThreadPool();
@@ -613,8 +665,6 @@ Executors.newSingleThreadExecutor();
### synchronized
<!--rehype:wrap-class=row-span-1-->
```java
// 代码块
synchronized(obj) {
@@ -622,16 +672,58 @@ synchronized(obj) {
}
// (静态)方法
public synchronized (static) void methodName() {
public synchronized
(static) void methodName() {
...
}
```
### 线程编排
<!--rehype:wrap-class=row-span-2 col-span-2-->
```java
// CountDownLatch
CountDownLatch countDownLatch = new CountDownLatch(2);
new Thread(() -> {
try {
...
}finally {
countDownLatch.countDown();
}
}).start();
countDownLatch.await();
```
CompletableFuture
```java
CompletableFuture<Void> task1 = CompletableFuture.runAsync(() -> {});
CompletableFuture<Void> task2 = CompletableFuture.runAsync(() -> {});
CompletableFuture<Void> task3 = CompletableFuture.runAsync(() -> {});
CompletableFuture.allOf(task1, task2, task3).get();
```
Semaphore
```java
Semaphore semaphore = new Semaphore(5);
try {
semaphore.acquire();
} finally {
semaphore.release();
}
```
### ThreadLocal
```java
// 使用完之后一定要记得remove, 否则会内存泄露
ThreadLocal<Integer> threadLocal = new ThreadLocal<>();
ThreadLocal<Integer> threadLocal
= new ThreadLocal<>();
```
使用完之后一定要记得 `remove`, 否则会内存泄露
```java
threadLocal.set(1);
threadLocal.get();
threadLocal.remove();
@@ -663,37 +755,8 @@ LockSupport.park(obj);
LockSupport.unpark(thread);
```
### 线程编排
```java
// CountDownLatch
CountDownLatch countDownLatch = new CountDownLatch(2);
new Thread(() -> {
try {
...
}finally {
countDownLatch.countDown();
}
}).start();
countDownLatch.await();
// CompletableFuture
CompletableFuture<Void> task1 = CompletableFuture.runAsync(() -> {});
CompletableFuture<Void> task2 = CompletableFuture.runAsync(() -> {});
CompletableFuture<Void> task3 = CompletableFuture.runAsync(() -> {});
CompletableFuture.allOf(task1, task2, task3).get();
// Semaphore
Semaphore semaphore = new Semaphore(5);
try {
semaphore.acquire();
} finally {
semaphore.release();
}
```
Java 框架搜集
--------------------
---
### Java 集合
<!--rehype:wrap-class=col-span-2 row-span-2-->
@@ -744,7 +807,9 @@ for (Integer value : nums) {
System.out.println(value);
}
// lambda 打印元素
nums.forEach(e -> System.out.println(e.toString()));
nums.forEach(
e -> System.out.println(e.toString())
);
```
### HashMap
@@ -803,7 +868,9 @@ set.remove("cat");
for (String element : set) {
System.out.println(element);
}
set.forEach(e -> System.out.println(e.toString()));
set.forEach(
e -> System.out.println(e.toString())
);
```
### ArrayDeque
@@ -824,6 +891,510 @@ System.out.println(a.peek());
System.out.println(a.pop());
```
Java I/O流
---
### 常见的类和操作
<!--rehype:wrap-class=row-span-5-->
字节流
- `InputStream` 字节输入流的抽象基类
- `FileInputStream` 从文件中读取字节的输入流
- `ByteArrayInputStream` 从字节数组中读取字节的输入流
- `OutputStream` 字节输出流的抽象基类
- `FileOutputStream` 向文件中写入字节的输出流
- `ByteArrayOutputStream` 将字节写入到字节数组的输出流
字符流
- `Reader` 字符输入流的抽象基类
- `FileReader` 从文件中读取字符的输入流
- `BufferedReader` 带缓冲区的字符输入流
- `InputStreamReader` 字节流到字符流的桥接器
- `Writer` 字符输出流的抽象基类
- `FileWriter` 向文件中写入字符的输出流
- `BufferedWriter` 带缓冲区的字符输出流
- `OutputStreamWriter` 字符流到字节流的桥接器
对象流
- `ObjectInputStream` 从输入流中读取Java对象的流
- `ObjectOutputStream` 将Java对象写入输出流的流
缓冲流
- `BufferedInputStream` 带缓冲区的字节输入流
- `BufferedOutputStream` 带缓冲区的字节输出流
- `BufferedReader` 带缓冲区的字符输入流
- `BufferedWriter` 带缓冲区的字符输出流
数据流
- `DataInputStream` 从输入流中读取基本数据类型的数据
- `DataOutputStream` 将基本数据类型数据写入输出流
文件类
- `File` 文件和目录路径名的抽象表示
- `FileReader` 从文件中读取字符的输入流
- `FileWriter` 向文件中写入字符的输出流
输入输出异常处理
- `IOException` Java I/O操作中的通用异常
- `FileNotFoundException` 当试图打开指定文件失败时抛出
- `EOFException` 在尝试读取流的末尾时抛出
其他流
- `PrintStream` 打印格式化表示的对象的输出流
- `PrintWriter` 格式化的文本输出流
- `RandomAccessFile` 随机访问文件的类,支持读取和写入操作
### 字节流
```java
// 文件输入流
InputStream inputStream
= new FileInputStream("input.txt");
// 文件输出流
OutputStream outputStream
= new FileOutputStream("output.txt");
// 缓冲字节输入流
InputStream bufferedInputStream
= new BufferedInputStream(inputStream);
// 缓冲字节输出流
OutputStream bufferedOutputStream
= new BufferedOutputStream(outputStream);
```
### 字符流
```java
// 文件字符输入流
Reader fileReader
= new FileReader("input.txt");
// 文件字符输出流
Writer fileWriter
= new FileWriter("output.txt");
// 缓冲字符输入流
Reader bufferedFileReader
= new BufferedReader(
new FileReader("input.txt")
);
// 缓冲字符输出流
Writer bufferedFileWriter
= new BufferedWriter(
new FileWriter("output.txt")
);
```
### 数据流
```java
// 数据输入流
DataInputStream dataInputStream
= new DataInputStream(inputStream);
// 数据输出流
DataOutputStream dataOutputStream
= new DataOutputStream(outputStream);
```
### 对象流
```java
// 对象输入流
ObjectInputStream objectInputStream
= new ObjectInputStream(inputStream);
// 对象输出流
ObjectOutputStream objectOutputStream
= new ObjectOutputStream(outputStream);
```
### 序列化与反序列化
<!--rehype:wrap-class=col-span-2-->
序列化对象到文件
```java
try (
ObjectOutputStream objectOutputStream
= new ObjectOutputStream(new FileOutputStream("object.dat"))
) {
objectOutputStream.writeObject(object);
}
```
从文件反序列化对象
```java
try (
ObjectInputStream objectInputStream
= new ObjectInputStream(new FileInputStream("object.dat"))
) {
Object object = objectInputStream.readObject();
}
```
### 标准输入输出流
标准输入流
```java
InputStream standardInputStream
= System.in;
```
标准输出流
```java
PrintStream standardOutputStream
= System.out;
```
### 基本操作
<!--rehype:wrap-class=row-span-2-->
```java
// 读取字节数据
int byteData = inputStream.read();
// 写入字节数据
outputStream.write(byteData);
// 读取字符数据
int charData = reader.read();
// 写入字符数据
writer.write(charData);
```
### 关闭流
```java
// 关闭输入流
inputStream.close();
// 关闭输出流
outputStream.close();
```
Java Stream 流
---
<!--rehype:body-class=cols-2-->
### 创建流
从集合创建流
```java
List<String> list = Arrays.asList("a", "b", "c");
Stream<String> streamFromList = list.stream();
```
从数组创建流
```java
String[] array = {"d", "e", "f"};
Stream<String> streamFromArray = Arrays.stream(array);
```
创建空流
```java
Stream<String> emptyStream = Stream.empty();
```
创建无限流
```java
Stream<Integer> infiniteStream = Stream.iterate(0, n -> n + 2);
```
### 中间操作
```java
// 过滤
Stream<String> filteredStream = list.stream().filter(
s -> s.startsWith("a")
);
// 映射
Stream<Integer> mappedStream = list.stream().map(String::length);
// 排序
Stream<String> sortedStream = list.stream().sorted();
// 去重
Stream<String> distinctStream = list.stream().distinct();
// 截断
Stream<String> limitedStream = list.stream().limit(2);
// 跳过
Stream<String> skippedStream = list.stream().skip(1);
```
### 终端操作
```java
// 聚合操作
Optional<String> anyElement = list.stream().findAny();
Optional<String> firstElement = list.stream().findFirst();
long count = list.stream().count();
Optional<String> maxElement = list.stream()
.max(Comparator.naturalOrder());
Optional<String> minElement = list.stream()
.min(Comparator.naturalOrder());
// 检查匹配
boolean anyMatch = list.stream().anyMatch(s -> s.contains("a"));
boolean allMatch = list.stream().allMatch(s -> s.length() == 1);
boolean noneMatch = list.stream().noneMatch(s -> s.contains("z"));
// 归约
Optional<String> reducedString = list.stream()
.reduce((s1, s2) -> s1 + s2);
String reducedStringWithIdentity = list.stream()
.reduce("Start:", (s1, s2) -> s1 + s2);
// 收集
List<String> collectedList = list.stream()
.collect(Collectors.toList());
Set<String> collectedSet = list.stream()
.collect(Collectors.toSet());
Map<Integer, String> collectedMap = list.stream()
.collect(
Collectors.toMap(String::length, Function.identity())
);
```
### 并行流
```java
List<String> list = Arrays.asList("a", "b", "c", "d", "e");
List<String> upperCaseList = list.parallelStream()
.map(String::toUpperCase)
.collect(Collectors.toList());
```
反射
---
这些是使用 Java 反射时常见的操作。使用反射需要注意性能和安全性问题,尽量避免在性能要求高的地方过度使用。
### 获取 Class 对象
<!--rehype:wrap-class=col-span-2-->
```java
// 通过类名获取Class对象
Class<?> clazz1 = MyClass.class;
// 通过对象获取Class对象
MyClass obj = new MyClass();
Class<?> clazz2 = obj.getClass();
// 通过完整类名字符串获取Class对象
Class<?> clazz3 = Class.forName("com.example.MyClass");
```
### 获取类的信息
<!--rehype:wrap-class=row-span-2-->
获取类的名称
```java
String className = clazz.getName();
```
获取类的修饰符
```java
int modifiers = clazz.getModifiers();
```
获取类的包信息
```java
Package pkg = clazz.getPackage();
```
获取类的父类
```java
Class<?> superClass = clazz.getSuperclass();
```
获取类实现的接口
```java
Class<?>[] interfaces = clazz.getInterfaces();
```
### 创建对象实例
<!--rehype:wrap-class=col-span-2-->
```java
// 使用默认构造函数创建对象
MyClass instance = (MyClass) clazz.newInstance();
// 使用带参数的构造函数创建对象
Constructor<?> constructor = clazz.getConstructor(String.class, int.class);
MyClass instanceWithArgs = (MyClass) constructor.newInstance("example", 123);
```
### 获取和设置字段值
<!--rehype:wrap-class=col-span-2-->
```java
// 获取字段值
Field field = clazz.getDeclaredField("fieldName");
field.setAccessible(true); // 如果字段是私有的,需要设置可访问
Object value = field.get(instance);
// 设置字段值
field.set(instance, newValue);
```
### 处理泛型
```java
// 获取泛型信息
Type genericType = field.getGenericType();
```
### 调用方法
<!--rehype:wrap-class=col-span-2-->
```java
// 获取方法
Method method = clazz.getDeclaredMethod("methodName", parameterTypes);
method.setAccessible(true); // 如果方法是私有的,需要设置可访问
// 调用方法
Object result = method.invoke(instance, args);
```
### 其他常用操作
<!--rehype:wrap-class=row-span-2-->
```java
// 判断是否是数组、枚举、注解等
boolean isArray = clazz.isArray();
boolean isEnum = clazz.isEnum();
boolean isAnnotation = clazz.isAnnotation();
// 获取构造函数、字段、方法等
Constructor<?>[] constructors = clazz.getConstructors();
Field[] fields = clazz.getDeclaredFields();
Method[] methods = clazz.getDeclaredMethods();
```
### 处理注解
<!--rehype:wrap-class=col-span-2-->
```java
// 获取注解信息
Annotation annotation = field.getAnnotation(MyAnnotation.class);
```
方法引用
---
### 方法引用
<!--rehype:wrap-class=row-span-3-->
Java 的 `Consumer` 接口里的 `accept` 方法接受参数但不返回值。要让它打印传入的参数,可以这样做:
```java
Consumer<String> test = new Consumer<String>() {
@Override
public void accept(String s) {
System.out.println(s);
}
};
test.accept("test");
```
更简单的我们可以直接传入Lambda表达式
```java
Consumer<String> test = System.out::println;
```
方法引用通过方法的名字指向一个方法,使语言构造更简洁,减少冗余代码。
#### 使用方式
- 引用方法
- 引用构造方法
- 引用数组
### 静态方法引用
```java
Comparator<Integer> comparator = Math::max;
int result = comparator.compare(1, 2);
// 返回 2
```
### 实例方法引用
```java
String str = "HELLO";
String lowerCase = str::toLowerCase;
// 返回 "hello"
```
### 构造方法引用
```java
Supplier<String> supplier = String::new;
String str = supplier.get();
// 返回一个空字符串
```
### 数组构造方法引用
```java
Function<Integer, String[]> function = String[]::new;
String[] array = function.apply(5);
// 返回 5 个空字符串的数组
```
<!--rehype:className=wrap-text-->
### 对象中的方法引用
```java
String someStr = "HELLO";
String lowerCase = someStr::toLowerCase;
// 返回 "hello"
```
### 对象中的静态方法引用
```java
SomeClass someObject = new SomeClass();
int result = someObject::staticMethod;
// 调用静态方法
```
杂项 Misc
----
@@ -924,6 +1495,7 @@ text.split(Pattern.quote("|"));
<!--rehype:className=cols-7 style-none-->
### 数学方法
<!--rehype:wrap-class=row-span-2-->
方法 | 说明
:-|:-
@@ -953,59 +1525,23 @@ try {
}
```
### 反射
```java
/**
* 利用反射动态加载依赖库
* java9及以上版本可用
* @param jar jar文件
*/
Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
method.setAccessible(true);
MethodHandle addURL = lookup.unreflect(method);
URL url = jar.toURI().toURL();
URLClassLoader urlClassLoader = new URLClassLoader(new URL[] {url});
addURL.invoke(urlClassLoader, url);
//java8
Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
method.setAccessible(true);
method.invoke(classLoader, url);
```
### util工具类
<!--rehype:wrap-class=row-span-2-->
- `ArrayDeque` 提供 resizable-array 并实现 Deque
- `Arrays` 包含一个静态工厂,允许将数组视为列表
- `Collections` 包含对集合进行操作或返回集合的静态方法
- `Date` 表示特定时间瞬间,精度为毫秒
- `Dictionary` 是任何类的抽象父类,例如 Hashtable,它将键映射到值
- `EnumMap` 一个专门用于枚举键的 Map 实现
- `EnumSet` 一个专门用于枚举键的 Set 实现
- `Formatter` 提供对布局对齐和对齐、数字、字符串和日期/时间数据的常用格式以及特定于语言环境的输出的支持
- `SecureRandom` 实例用于生成安全的伪随机数流
- `UUID` 表示一个不可变的通用唯一标识符
- `Vector` 实现了一个可增长的对象数组
- `LocalDate` 表示没有时区的日期,包含年月日,不可变且线程安全java8 及以上版本可用
- `LocalTime` 表示没有时区的时间,包含时分秒,不可变且线程安全java8 及以上版本可用
- `LocalDateTime` 表示没有时区的日期时间,同时包含年月日时分秒,不可变且线程安全java8 及以上版本可用
### IO流
```java
// 输入流转输出流
byte[] inputContent = "test".getBytes();
try (InputStream inputStream = new ByteArrayInputStream(inputContent);
OutputStream outputStream = new ByteArrayOutputStream()) {
byte[] buffer = new byte[1024];
int len;
while ((len = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, len);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
```
- `ArrayDeque`: 可调整大小的数组双端队列,实现Deque接
- `Arrays`: 提供静态工厂,允许将数组视为列表
- `Collections`: 包含操作集合或返回集合的静态方法
- `Date`: 表示特定时间瞬间,精度为毫秒
- `Dictionary`: 抽象父类,可用于键值对映射例如Hashtable
- `EnumMap`: 专门用于枚举键的Map实现
- `EnumSet`: 专门用于枚举键的Set实现
- `Formatter`: 提供对布局对齐、数字、字符串和日期/时间数据的格式化支持,以及特定于语言环境的输出
- `SecureRandom`: 生成安全的伪随机数流的实例
- `UUID`: 表示不可变的通用唯一标识符
- `Vector`: 实现了可增长的对象数组
- `LocalDate`: 表示时区的日期,包含年月日,不可变且线程安全适用于Java 8及更高版本
- `LocalTime`: 表示时区的时间,包含时分秒,不可变且线程安全适用于Java 8及更高版本
- `LocalDateTime`: 表示时区的日期时间,包含年月日时分秒,不可变且线程安全适用于Java 8及更高版本
### Collections 工具类
@@ -1018,24 +1554,8 @@ list.add(2);
list.add(3);
list.add(3);
list.add(3);
int frequency = Collections.frequency(list, 2); // frequency = 2
```
### Stream 流
```java
// 统计词频
List<Integer> list = new ArrayList<>();
list.add(1);
list.add(1);
list.add(3);
list.add(2);
list.add(2);
list.add(2);
Map<Integer, Long> frequencyMap = list.stream().collect(Collectors.groupingBy(x -> x, Collectors.counting()));
// 1: 2
// 2: 3
// 3: 1
int frequency = Collections
.frequency(list, 2); // frequency = 2
```
另见

View File

@@ -10,24 +10,29 @@ Kubernetes 备忘清单
```bash
$ kubectl get no # 显示所有节点信息
$ kubectl get no -o wide # 显示所有节点的更多信息
# 显示所有节点的更多信息
$ kubectl get no -o wide
$ kubectl describe no # 显示节点详情
$ kubectl get no -o yaml # 以yaml格式显示节点详情
$ kubectl get node --selector=[label_name] # 筛选指定标签的节点
# 以yaml格式显示节点详情
$ kubectl get no -o yaml
# 筛选指定标签的节点
$ kubectl get node --selector=[label_name]
# 输出 jsonpath 表达式定义的字段信息
$ kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="ExternalIP")].address}'
# 输出jsonpath表达式定义的字段信息
$ kubectl top node [node_name] # 显示节点(CPU/内存/存储)使用情况
# 显示节点(CPU/内存/存储)使用情况
$ kubectl top node [node_name]
```
### 容器组
<!--rehype:wrap-class=col-span-2-->
资源名称: pods, 缩写: po
```bash
$ kubectl get po # 显示所有容器组信息
$ kubectl get po # 显示所有容器组信息
$ kubectl get po -o wide
$ kubectl describe po
$ kubectl get po --show-labels # 查看容器组的labels
$ kubectl get po --show-labels # 查看容器组的labels
$ kubectl get po -l app=nginx
$ kubectl get po -o yaml
$ kubectl get pod [pod_name] -o yaml --export
@@ -39,7 +44,7 @@ $ kubectl get pods --field-selector status.phase=Running
### 命名空间
资源名称: namespaces, 缩写: ns
资源名称: `namespaces`, 缩写: `ns`
```bash
$ kubectl get ns
@@ -49,7 +54,7 @@ $ kubectl describe ns
### 无状态
资源名称: deployments, 缩写: deploy
资源名称: `deployments`, 缩写: `deploy`
```bash
$ kubectl get deploy
@@ -60,7 +65,7 @@ $ kubectl get deploy -o yaml
### 服务
资源名称: services, 缩写: svc
资源名称: `services`, 缩写: `svc`
```bash
$ kubectl get svc
@@ -71,8 +76,9 @@ $ kubectl get svc --show-labels
```
### 守护进程集
<!--rehype:wrap-class=col-span-2-->
资源名称: daemonsets, 缩写: ds
资源名称: `daemonsets`, 缩写: `ds`
```bash
$ kubectl get ds
@@ -83,7 +89,7 @@ $ kubectl get ds [ds_name] -n [ns_name] -o yaml
### 事件
资源名称: events, 缩写: ev
资源名称: `events`, 缩写: `ev`
```bash
$ kubectl get events
@@ -91,27 +97,29 @@ $ kubectl get events -n kube-system
$ kubectl get events -w
```
### 服务帐户
<!--rehype:wrap-class=col-span-2-->
资源名称: `serviceaccounts`, 缩写: `sa`
```bash
$ kubectl get sa
$ kubectl get sa -o yaml
$ kubectl get serviceaccounts default -o yaml >./sa.yaml
$ kubectl replace serviceaccount default -f ./sa.yaml
```
### 日志
```bash
$ kubectl logs [pod_name]
$ kubectl logs --since=1h [pod_name]
$ kubectl logs --tail=20 [pod_name]
$ kubectl logs -f -c [container_name] [pod_name]
$ kubectl logs \
-f -c [container_name] [pod_name]
$ kubectl logs [pod_name] > pod.log
```
### 服务帐户
资源名称: serviceaccounts, 缩写: sa
```bash
$ kubectl get sa
$ kubectl get sa -o yaml
$ kubectl get serviceaccounts default -o yaml >./sa.yaml
$ kubectl replace serviceaccount default -f ./sa.yaml
```
### 副本集
资源名称: replicasets, 缩写: rs
@@ -127,7 +135,13 @@ $ kubectl get rs -o yaml
```bash
$ kubectl get roles --all-namespaces
$ kubectl get roles --all-namespaces -o yaml
```
---
```
$ kubectl get roles \
--all-namespaces -o yaml
```
### 保密字典
@@ -203,6 +217,7 @@ $ kubectl taint [node_name] [taint_name]
```
### 标签
<!--rehype:wrap-class=col-span-2-->
```bash
$ kubectl label nodes <node-name> <label-key>=<label-value> #增加
@@ -233,6 +248,7 @@ $ kubectl edit pod [pod_name]
```
### 无状态/命名空间
<!--rehype:wrap-class=col-span-2 row-span-2-->
```bash
$ kubectl edit deploy [deploy_name]
@@ -265,6 +281,7 @@ $ kubectl delete sa [sa_name]
```
### 注释
<!--rehype:wrap-class=col-span-2-->
```bash
$ kubectl annotatepo [pod_name] [annotation]
@@ -275,6 +292,7 @@ $ kubectl annotateno [node_name]
---
### 创建容器组
<!--rehype:wrap-class=col-span-2-->
```bash
$ kubectl create -f [name_of_file]
@@ -287,7 +305,8 @@ $ kubectl run [pod_name] --image=nginx --restart=Never
### 创建服务
```bash
$ kubectl create svc nodeport [svc_name] --tcp=8080:80
$ kubectl create svc nodeport [svc_name] \
--tcp=8080:80
```
### 创建无状态应用
@@ -295,16 +314,12 @@ $ kubectl create svc nodeport [svc_name] --tcp=8080:80
```bash
$ kubectl create -f [name_of_file]
$ kubectl apply -f [name_of_file]
$ kubectl create deploy [deploy_name] --image=nginx
```
### 容器交互
```bash
$ kubectl run [pod_name] --image=busybox --rm -it --restart=Never -- sh
$ kubectl create deploy [deploy_name] \
--image=nginx
```
### 输出YAML文件
<!--rehype:wrap-class=col-span-2-->
```bash
$ kubectl create deploy [deploy_name] --image=nginx --dry-run -o yaml > deploy.yaml
@@ -312,6 +327,14 @@ $ kubectl get po [pod_name] -o yaml --export > pod.yaml
$ kubectl run nginx --image=nginx:alpine --dry-run -o -yaml > deploy.yaml
```
### 容器交互
```bash
$ kubectl run [pod_name] \
--image=busybox --rm -it \
--restart=Never -- sh
```
### 获取帮助
```bash

View File

@@ -549,8 +549,8 @@ string.lower("STR") -- str
-- 指定替换的字符串个数, 最后一个参数可选,默认是全部替换
string.gsub("aaaa", "a", "b", 3) -- bbba 3
string.gsub("Today is 29/01/2019", "%d%d/%d%d/%d%d%d%d", "good day.")
-- Today is a good day. 1
string.gsub("Today is 29/01/2019", "%d%d/%d%d/%d%d%d%d", "a good day.")
-- Today is a good day.
-- 查找第一个匹配的字符串,第三个参数可以提供开始查找的位置,默认从 1 开始
-- 如果未找到,则返回 nil

View File

@@ -1027,5 +1027,5 @@ origin 函数用于告诉这个变量的从何而来
---
* [make 中文教程](https://seisman.github.io/how-to-write-makefile/overview.html) _(seisman.github.io)_
* [make 手册](https://www.gnu.org/software/make/manual/make.html#toc-Overview-of-make) _(www.gnu.org)_
* [make 官网](https://www.gnu.org/software/make/) _www.gnu.org_
* [make 手册](https://www.gnu.org/software/make/manual/make.html#toc-Overview-of-make) _(<www.gnu.org>)_
* [make 官网](https://www.gnu.org/software/make/) _<www.gnu.org>_

View File

@@ -198,8 +198,8 @@ c = 2×2 complex
### 输入命令
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[ans](https://ww2.mathworks.cn/help/matlab/ref/ans.html) | 最近计算的答案
[clc](https://ww2.mathworks.cn/help/matlab/ref/clc.html) | 清空命令行窗口
[diary](https://ww2.mathworks.cn/help/matlab/ref/diary.html) | 将命令行窗口文本记录到日志文件中
@@ -221,8 +221,8 @@ c = 2×2 complex
创建和合并数组
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[zeros](https://ww2.mathworks.cn/help/matlab/ref/zeros.html) | 创建全零数组
[ones](https://ww2.mathworks.cn/help/matlab/ref/ones.html) | 创建全部为 1 的数组
[rand](https://ww2.mathworks.cn/help/matlab/ref/rand.html) | 均匀分布的随机数
@@ -239,8 +239,8 @@ c = 2×2 complex
创建网格
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[linspace](https://ww2.mathworks.cn/help/matlab/ref/linspace.html) | 生成线性间距向量
[logspace](https://ww2.mathworks.cn/help/matlab/ref/logspace.html) | 生成对数间距向量
[freqspace](https://ww2.mathworks.cn/help/matlab/ref/freqspace.html) | 频率响应的频率间距
@@ -249,8 +249,8 @@ c = 2×2 complex
确定大小、形状和排序
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[length](https://ww2.mathworks.cn/help/matlab/ref/length.html) | 最大数组维度的长度
[size](https://ww2.mathworks.cn/help/matlab/ref/size.html) | 数组大小
[ndims](https://ww2.mathworks.cn/help/matlab/ref/double.ndims.html) | 数组维度数目
@@ -266,8 +266,8 @@ c = 2×2 complex
重构和重新排列
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[sort](https://ww2.mathworks.cn/help/matlab/ref/sort.html) | 对数组元素排序
[sortrows](https://ww2.mathworks.cn/help/matlab/ref/double.sortrows.html) | 对矩阵行或表行进行排序
[flip](https://ww2.mathworks.cn/help/matlab/ref/flip.html) | 翻转元素顺序
@@ -285,8 +285,8 @@ c = 2×2 complex
索引
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[colon](https://ww2.mathworks.cn/help/matlab/ref/colon.html) | 向量创建、数组下标和 <code class="literal">for</code> 循环迭代
[end](https://ww2.mathworks.cn/help/matlab/ref/end.html) | 终止代码块或指示最大数组索引
[ind2sub](https://ww2.mathworks.cn/help/matlab/ref/ind2sub.html) | 将线性索引转换为下标
@@ -297,8 +297,8 @@ c = 2×2 complex
创建数值变量
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[double](https://ww2.mathworks.cn/help/matlab/ref/double.html) | 双精度数组
[single](https://ww2.mathworks.cn/help/matlab/ref/single.html) | 单精度数组
[int8](https://ww2.mathworks.cn/help/matlab/ref/int8.html) | 8 位有符号整数数组
@@ -312,15 +312,15 @@ c = 2×2 complex
在数值类型之间转换
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[cast](https://ww2.mathworks.cn/help/matlab/ref/cast.html) | 将变量转换为不同的数据类型
[typecast](https://ww2.mathworks.cn/help/matlab/ref/typecast.html) | 在不更改基础数据的情况下转换数据类型
查询类型和值
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[allfinite](https://ww2.mathworks.cn/help/matlab/ref/allfinite.html") | Determine if all array elements are finite
[anynan](https://ww2.mathworks.cn/help/matlab/ref/anynan.html") | Determine if any array element is NaN
[isinteger](https://ww2.mathworks.cn/help/matlab/ref/isinteger.html) | 确定输入是否为整数数组
@@ -333,8 +333,8 @@ c = 2×2 complex
数值范围
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[eps](https://ww2.mathworks.cn/help/matlab/ref/eps.html) | 浮点相对精度
[flintmax](https://ww2.mathworks.cn/help/matlab/ref/flintmax.html) | 浮点格式的最大连续整数
[Inf](https://ww2.mathworks.cn/help/matlab/ref/inf.html) | 创建所有值均为 `Inf` 的数组
@@ -363,8 +363,8 @@ c = 2×2 complex
### 字符串数组
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[string](https://ww2.mathworks.cn/help/matlab/ref/string.html) | 字符串数组
[strings](https://ww2.mathworks.cn/help/matlab/ref/strings.html) | 创建不包含字符的字符串数组
[join](https://ww2.mathworks.cn/help/matlab/ref/join.html) | 合并字符串
@@ -372,8 +372,8 @@ c = 2×2 complex
### 字符数组
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[char](https://ww2.mathworks.cn/help/matlab/ref/char.html) | 字符数组
[cellstr](https://ww2.mathworks.cn/help/matlab/ref/cellstr.html) | 转换为字符向量元胞数组
[blanks](https://ww2.mathworks.cn/help/matlab/ref/blanks.html) | 创建空白字符数组
@@ -381,8 +381,8 @@ c = 2×2 complex
### 字符或字符串数组
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[compose](https://ww2.mathworks.cn/help/matlab/ref/compose.html) | 将数据格式化为多个字符串
[sprintf](https://ww2.mathworks.cn/help/matlab/ref/sprintf.html) | 将数据格式化为字符串或字符向量
[strcat](https://ww2.mathworks.cn/help/matlab/ref/strcat.html) | 水平串联字符串
@@ -399,8 +399,8 @@ c = 2×2 complex
### 字符或字符串 - 在数值和字符串之间转换
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[double](https://ww2.mathworks.cn/help/matlab/ref/double.html) | 双精度数组
[string](https://ww2.mathworks.cn/help/matlab/ref/string.html) | 字符串数组
[str2double](https://ww2.mathworks.cn/help/matlab/ref/str2double.html) | 将字符串转换为双精度值
@@ -411,8 +411,8 @@ c = 2×2 complex
数据类型
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[ischar](https://ww2.mathworks.cn/help/matlab/ref/ischar.html) | 确定输入是否为字符数组
[iscellstr](https://ww2.mathworks.cn/help/matlab/ref/iscellstr.html) | 确定输入是否为字符向量元胞数组
[isstring](https://ww2.mathworks.cn/help/matlab/ref/isstring.html) | 确定输入是否为字符串数组
@@ -420,8 +420,8 @@ c = 2×2 complex
文本属性
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[strlength](https://ww2.mathworks.cn/help/matlab/ref/strlength.html) | 字符串长度
[isstrprop](https://ww2.mathworks.cn/help/matlab/ref/isstrprop.html) | 确定输入字符串中的哪些字符属于指定类别
[isletter](https://ww2.mathworks.cn/help/matlab/ref/isletter.html) | 确定哪些字符为字母
@@ -432,8 +432,8 @@ c = 2×2 complex
查找
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[contains](https://ww2.mathworks.cn/help/matlab/ref/contains.html) | 确定字符串中是否有模式
[matches](https://ww2.mathworks.cn/help/matlab/ref/matches.html) | 确定模式是否与字符串匹配
[count](https://ww2.mathworks.cn/help/matlab/ref/count.html) | 计算字符串中模式的出现次数
@@ -444,22 +444,22 @@ c = 2×2 complex
替换
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[replace](https://ww2.mathworks.cn/help/matlab/ref/replace.html) | 查找并替换一个或多个子字符串
[replaceBetween](https://ww2.mathworks.cn/help/matlab/ref/replacebetween.html) | 替换起点和终点之间的子字符串
[strrep](https://ww2.mathworks.cn/help/matlab/ref/strrep.html) | 查找并替换子字符串
### 字符串匹配模式 - 构建模式
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[pattern](https://ww2.mathworks.cn/help/matlab/ref/pattern.html) | 用于搜索和匹配文本的模式
### 字符串匹配模式 - 字符匹配模式
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[alphanumericsPattern](https://ww2.mathworks.cn/help/matlab/ref/alphanumericspattern.html) | 匹配字母和数字字符
[characterListPattern](https://ww2.mathworks.cn/help/matlab/ref/characterlistpattern.html) | 匹配列表中的字符
[digitsPattern](https://ww2.mathworks.cn/help/matlab/ref/digitspattern.html) | 匹配数字字符
@@ -469,8 +469,8 @@ c = 2×2 complex
### 字符串匹配模式 - 模式搜索规则
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[optionalPattern](https://ww2.mathworks.cn/help/matlab/ref/optionalpattern.html) | 使模式匹配可选
[possessivePattern](https://ww2.mathworks.cn/help/matlab/ref/possessivepattern.html) | 匹配模式而不回溯
[caseSensitivePattern](https://ww2.mathworks.cn/help/matlab/ref/casesensitivepattern.html) | 以区分大小写的方式匹配模式
@@ -495,15 +495,15 @@ c = 2×2 complex
### 字符串匹配模式 - 自定义模式显示
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[maskedPattern](https://ww2.mathworks.cn/help/matlab/ref/maskedpattern.html) | 具有指定显示名称的模式
[namedPattern](https://ww2.mathworks.cn/help/matlab/ref/namedpattern.html) | 指定命名模式
### 字符串匹配模式 - 正则表达式
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[regexp](https://ww2.mathworks.cn/help/matlab/ref/regexp.html) | 匹配正则表达式(区分大小写)
[regexpi](https://ww2.mathworks.cn/help/matlab/ref/regexpi.html) | 匹配正则表达式(不区分大小写)
[regexprep](https://ww2.mathworks.cn/help/matlab/ref/regexprep.html) | 使用正则表达式替换文本
@@ -512,8 +512,8 @@ c = 2×2 complex
### 字符串匹配模式 - 联接和拆分
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[join](https://ww2.mathworks.cn/help/matlab/ref/join.html) | 合并字符串
[plus](https://ww2.mathworks.cn/help/matlab/ref/plus.html) | 添加数字,追加字符串
[split](https://ww2.mathworks.cn/help/matlab/ref/split.html) | 在分隔符处拆分字符串
@@ -529,8 +529,8 @@ c = 2×2 complex
### 字符串编辑
<!--rehype:wrap-class=row-span-2-->
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[erase](https://ww2.mathworks.cn/help/matlab/ref/erase.html) | 删除字符串内的子字符串
[eraseBetween](https://ww2.mathworks.cn/help/matlab/ref/erasebetween.html) | 删除起点和终点之间的子字符串
[extract](https://ww2.mathworks.cn/help/matlab/ref/extract.html) | 从字符串中提取子字符串
@@ -550,8 +550,8 @@ c = 2×2 complex
### 字符串比较
:- | :- | :-
:- | :- | :-
:- | :-
:- | :-
[matches](https://ww2.mathworks.cn/help/matlab/ref/matches.html) | 确定模式是否与字符串匹配
[strcmp](https://ww2.mathworks.cn/help/matlab/ref/strcmp.html) | 比较字符串
[strcmpi](https://ww2.mathworks.cn/help/matlab/ref/strcmpi.html) | 比较字符串(不区分大小写)

View File

@@ -556,7 +556,7 @@ ON t(c3,c4)
删除索引
```sql
DROP INDEX idx_name;
DROP INDEX idx_name ON t;
```
MySQL 数据类型
@@ -601,6 +601,80 @@ MySQL 数据类型
| `DOUBLE` | Decimal (24 to 53 digits) |
| `DECIMAL` | "­DOU­BLE­" stored as string |
## 函数
### 聚合函数
| 函数 | 解释 |
| :--------- |:-------------------------------|
| `SUM()` | 计算一列值的总和 |
| `AVG()` | 计算一列值的平均值 |
| `COUNT()` | 计算行数可选择性地忽略NULL值 |
| `MAX()` | 找出一列的最大值 |
| `MIN()` | 找出一列的最小值 |
### 数学函数
<!--rehype:wrap-class=col-span-2 -->
| 函数 | 解释 | 示例语法 | 结果 |
| :-------------- | :---------------------------------------------- | :----------------------- | :-------- |
| `ABS(x)` | 返回数值的绝对值 | `ABS(-5)` | 5 |
| `ROUND(x,y)` | 四舍五入到指定的小数位数y为小数位数默认为0 | `ROUND(3.1415,2)` | 3.14 |
| `FLOOR(x)` | 向下取整至最接近的整数 | `FLOOR(3.7)` | 3 |
| `CEIL(x)` | 向上取整至最接近的整数 | `CEIL(3.3)` | 4 |
| `SQRT(x)` | 返回一个数的平方根 | `SQRT(16)` | 4 |
| `MOD(x,y)` | 返回x除以y的余数 | `MOD(10,3)` | 1 |
| `RAND([seed])` | 返回0到1之间的随机数可选种子值 | `RAND()``RAND(123)` | 0.345... |
### 日期和时间函数
| 函数 | 解释 |
| :--------------- | :-------------------------- |
| `NOW()` | 返回当前日期和时间 |
| `CURDATE()` | 返回当前日期 |
| `CURTIME()` | 返回当前时间 |
| `DATE_FORMAT()` | 格式化日期时间输出 |
| `DATEDIFF()` | 计算两个日期之间相差的天数 |
| `STR_TO_DATE()` | 将字符串转换为日期格式 |
### 字符串函数
<!--rehype:wrap-class=col-span-2 -->
| 函数 | 解释 | 示例语法 | 结果 |
| :------------------------------ | :------------------------ | ---------------------------- | --------------- |
| `CONCAT(s1,s2,...)` | 连接两个或更多字符串 | `CONCAT('Hello, ','World!')` | 'Hello, World!' |
| `LOWER(str)` | 转换为小写 | `LOWER('HELLO')` | 'hello' |
| `UPPER(str)` | 转换为大写 | `UPPER('world')` | 'WORLD' |
| `TRIM(str)` | 去除字符串两端空格 | `TRIM(' Hello ')` | 'Hello' |
| `LEFT(str,len)` | 提取字符串左侧的若干字符 | `LEFT('Hello', 3)` | 'Hel' |
| `RIGHT(str,len)` | 提取字符串右侧的若干字符 | `RIGHT('Hello', 2)` | 'lo' |
| `SUBSTR(str,pos,len)` | 提取字符串中的一部分 | `SUBSTR('Hello', 2, 3)` | 'ell' |
| `REPLACE(str,from_str,to_str)` | 替换字符串中的部分文本 | `REPLACE('Hello', 'l', 'L')` | 'HeLLo' |
### 高级函数
<!--rehype:wrap-class=col-span-3 -->
| 函数 | 解释 | 示例语法 | 结果 |
| ----------------------------------- | -------------------------------------------------- | ------------------------------------------------------------ | ---------------------------------------- |
| BIN(x) | 返回 x 的二进制编码x 为十进制数。 | `BIN(2)` | `10` |
| BINARY(s) | 将字符串 s 转换为二进制字符串。 | `BINARY 'RUNOOB'` | `'RUNOOB'`(显示效果,实际存储为二进制) |
| CASE | 复合条件函数,根据条件返回不同结果。 | `CASE WHEN 1 > 0 THEN '1 > 0' WHEN 2 > 0 THEN '2 > 0' ELSE '3 > 0' END` | `'1 > 0'` |
| CAST(x AS type) | 转换数据类型。 | `CAST('2017-08-29' AS DATE)` | `2017-08-29` |
| COALESCE(expr1, expr2, ..., expr_n) | 返回第一个非空表达式的值。 | `COALESCE(NULL, NULL, 'runoob.com', NULL, 'google.com')` | `'runoob.com'` |
| CONNECTION_ID() | 返回当前连接的唯一ID。 | `CONNECTION_ID()` | `4292835`(示例值) |
| CONV(x, f1, f2) | 将 f1 进制数转换为 f2 进制数。 | `CONV(15, 10, 2)` | `1111` |
| CONVERT(s USING cs) | 转换字符串 s 的字符集为 cs。 | `CHARSET(CONVERT('ABC' USING gbk))` | `gbk` |
| CURRENT_USER() | 返回当前用户。 | `CURRENT_USER()` | `guest@%` |
| DATABASE() | 返回当前数据库名。 | `DATABASE()` | `runoob` |
| IF(expr, v1, v2) | 条件表达式expr 为真则 v1否则 v2。 | `IF(1 > 0, '正确', '错误')` | `'正确'` |
| IFNULL(v1, v2) | 如果 v1 不为 NULL则返回 v1否则返回 v2。 | `IFNULL(NULL, 'Hello Word')` | `'Hello Word'` |
| ISNULL(expression) | 判断表达式是否为 NULL。 | `ISNULL(NULL)` | `1` |
| LAST_INSERT_ID() | 返回最近生成的 AUTO_INCREMENT 值。 | `LAST_INSERT_ID()` | `6`(示例值) |
| NULLIF(expr1, expr2) | 若 expr1 等于 expr2则返回 NULL否则返回 expr1。 | `NULLIF(25, 25)` | `NULL` |
另见
---

2159
docs/neo4j.md Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -316,7 +316,7 @@ server {
### 重定向(301永久)
<!--rehype:wrap-class=row-span-2-->
将 www.example.com 重定向到 example.com
<www.example.com> 重定向到 example.com
```nginx
server {

View File

@@ -314,6 +314,7 @@ $ npx create-react-app my-app --template typescript
`~/.npmrc` | 每个用户的配置文件
`$PREFIX/etc/npmrc` | 全局配置文件
`/path/to/npm/npmrc` | npm 内置配置文件
<!--rehype:className=left-align-->
### 配置内容
@@ -336,6 +337,7 @@ $ npx create-react-app my-app --template typescript
`cnpm` | <https://r.cnpmjs.org/>
`taobao` | <https://registry.npmmirror.com/>
`npmMirror` | <https://skimdb.npmjs.com/registry/>
<!--rehype:className=left-align-->
### `.npmignore`

146
docs/nvm.md Normal file
View File

@@ -0,0 +1,146 @@
nvm 备忘清单
===
nvm 是一个用于管理电脑上多个 node.js 版本的程序
<!--rehype:style=padding-top: 12px;-->
入门
-----
### 安装
<!--rehype:wrap-class=row-span-5-->
Node Version Manager 用于管理多个活动的 Node.js 版本
- [Windows 版本](https://github.com/coreybutler/nvm-windows/releases) _(github.io)_
- [Posix 兼容的 Shell 版本](https://github.com/nvm-sh/nvm?tab=readme-ov-file) _(github.io)_
#### Windows
最新的 windows 版本通过 [nvm-windows发行版下载](https://github.com/coreybutler/nvm-windows/releases) 地址下载安装程序
双击 `setup` 程序按照提示操作即可完成安装。
#### macOS/Linux
```shell
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
```
<!--rehype:className=wrap-text-->
```shell
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
```
<!--rehype:className=wrap-text-->
#### 快速使用
```shell
# 下载并安装 Node.js 20 版本
nvm install 20
# 验证环境中的 Node.js 版本是否正确
node --version # 应该打印“v20.11.1”
# 验证环境中是否存在正确的 NPM 版本
npm --version # 应该打印“10.2.4”
```
### 展示当前使用版本
```shell
nvm current
```
### 安装指定版本的 node 程序
<!--rehype:wrap-class=row-span-2-->
version 设置为 `latest` 安装最新版本或者设置为 "lts" 安装最近的 LTS长期支持版本。
```shell
nvm install <version> [arch]
```
`arch` 可以指定 `32` 或者 `64` 位版本(默认跟随系统),设置为 `all` 同时安装 32 和 64 位版本。在命令最后添加 `--insecure` 将跳过远程下载服务器的 SSL 验证。
### 切换使用指定版本
```shell
nvm use <version> [arch]
```
### 列出 node.js 已安版本
可选输入 available 显示可获取的版本下载列表。
```shell
nvm list [available]
```
### 卸载指定版本
<!--rehype:wrap-class=row-span-2-->
```shell
# <version> 可选设置 latest/lts/newest
nvm uninstall <version>
```
启用 `newest` 指定最近安装版本。
```shell
nvm use <arch> # 可选指定32/64位架构
```
将继续使用当前版本,但是将切换为指定架构程序。
### 查看 node 运行模式
```shell
nvm arch [32|64]
```
查看 node 程序是运行在 `32` 位还是 `64` 位模式下,指定 `32` 或者 `64` 覆盖默认运行架构模式
### 检查 NVM4W 进程已知问题
```shell
nvm check
```
### 启用/关闭 node.js 版本管理
```shell
nvm on # 启用
nvm off # 关闭 - 不会执行任何卸载操作
```
### 设置下载代理
```shell
nvm proxy [url]
```
可选 url 留空查看当前使用代理,设置为 "none" 移除代理设置。
### 设置版本存储目录
设置 nvm 储存不同版本的 node.js 的目录。如果未设置path将展示当前存储目录。
```shell
nvm root <path>
```
### 展示当前 nvm 使用版本
```shell
nvm version
```
### 指定 node 镜像
```shell
nvm node_mirror <node_mirror_url>
```
### 指定 npm 镜像
```shell
nvm npm_mirror <npm_mirror_url>
```

View File

@@ -8,14 +8,21 @@ Oracle 备忘清单
### SELECT 语句
```sql
SELECT * FROM beverages WHERE field1 = 'Kona' AND field2 = 'coffee' AND field3 = 122;
SELECT *
FROM beverages
WHERE field1 = 'Kona'
AND field2 = 'coffee'
AND field3 = 122;
```
<!--rehype:className=wrap-text-->
### SELECT INTO 语句
```sql
SELECT name,address,phone_number INTO v_employee_name,v_employee_address,v_employee_phone_number FROM employee WHERE employee_id = 6;
SELECT name, address, phone_number
INTO v_employee_name, v_employee_address, v_employee_phone_number
FROM employee
WHERE employee_id = 6;
```
<!--rehype:className=wrap-text-->
@@ -25,24 +32,35 @@ SELECT name,address,phone_number INTO v_employee_name,v_employee_address,v_emplo
使用 VALUES 关键字插入
```sql
INSERT INTO table_name VALUES ('Value1', 'Value2', ... );
INSERT INTO table_name(Column1, Column2, ... ) VALUES ( 'Value1', 'Value2', ... );
INSERT INTO table_name
VALUES ('Value1', 'Value2', ... );
INSERT INTO table_name (Column1, Column2, ... )
VALUES ( 'Value1', 'Value2', ... );
```
<!--rehype:className=wrap-text-->
使用 SELECT 语句插入
```sql
INSERT INTO table_name(SELECT Value1, Value2, ... from table_name );
INSERT INTO table_name(Column1, Column2, ... ) ( SELECT Value1, Value2, ... from table_name );
INSERT INTO table_name
SELECT Value1, Value2, ...
FROM table_name;
INSERT INTO table_name (Column1, Column2, ...)
SELECT Value1, Value2, ...
FROM table_name;
```
<!--rehype:className=wrap-text-->
### DELETE 语句
```sql
DELETE FROM table_name WHERE some_column=some_value
DELETE FROM customer WHERE sold = 0;
DELETE FROM table_name
WHERE some_column = some_value;
DELETE FROM customer
WHERE sold = 0;
```
### UPDATE 语句
@@ -384,7 +402,8 @@ CREATE TABLE table_name
column1 datatype null/not null,
column2 datatype null/not null,
...
CONSTRAINT constraint_name CHECK (column_name condition) [DISABLE]
CONSTRAINT constraint_name
CHECK (column_name condition) [DISABLE]
);
```
@@ -410,7 +429,8 @@ CREATE TABLE table_name
column1 datatype null/not null,
column2 datatype null/not null,
...
CONSTRAINT constraint_name UNIQUE (column1, column2, column_n)
CONSTRAINT constraint_name
UNIQUE (column1, column2, column_n)
);
```
@@ -421,7 +441,8 @@ CREATE TABLE customer
(
id integer not null,
name varchar2(20),
CONSTRAINT customer_id_constraint UNIQUE (id)
CONSTRAINT customer_id_constraint
UNIQUE (id)
);
```
@@ -431,14 +452,18 @@ CREATE TABLE customer
```sql
ALTER TABLE [table name]
ADD CONSTRAINT [constraint name] UNIQUE( [column name] ) USING INDEX [index name];
ADD CONSTRAINT [constraint name]
UNIQUE([column name])
USING INDEX [index name];
```
例如:
```sql
ALTER TABLE employee
ADD CONSTRAINT uniqueEmployeeId UNIQUE(employeeId) USING INDEX ourcompanyIndx_tbs;
ADD CONSTRAINT uniqueEmployeeId
UNIQUE(employeeId)
USING INDEX ourcompanyIndx_tbs;
```
### 添加外部约束
@@ -447,14 +472,19 @@ foregin 约束的语法是:
```sql
ALTER TABLE [table name]
ADD CONSTRAINT [constraint name] FOREIGN KEY (column,...) REFERENCES table [(column,...)] [ON DELETE {CASCADE | SET NULL}]
ADD CONSTRAINT [constraint name]
FOREIGN KEY (column,...)
REFERENCES table [(column,...)]
[ON DELETE {CASCADE | SET NULL}];
```
例如:
```sql
ALTER TABLE employee
ADD CONSTRAINT fk_departament FOREIGN KEY (departmentId) REFERENCES departments(Id);
ADD CONSTRAINT fk_departament
FOREIGN KEY (departmentId)
REFERENCES departments(Id);
```
### 删除约束
@@ -482,13 +512,17 @@ INDEXES
```sql
CREATE [UNIQUE] INDEX index_name
ON table_name (column1, column2, . column_n)
ON table_name (
column1,
column2,
.
column_n
)
[ COMPUTE STATISTICS ];
```
`UNIQUE` 表示索引列中值的组合必须是唯一的
`COMPUTE STATISTICS` 告诉 Oracle 在创建索引期间收集统计信息。 然后优化器使用这些统计信息来选择执行语句时的最佳执行计划。例如:
- `UNIQUE` 表示索引列中值的组合必须是唯一的
- `COMPUTE STATISTICS` 告诉 Oracle 在创建索引期间收集统计信息。然后优化器使用这些统计信息来选择执行语句时的最佳执行计划。例如:
```sql
CREATE INDEX customer_idx
@@ -604,7 +638,8 @@ DBA 相关
创建用户的语法是:
```sql
CREATE USER username IDENTIFIED BY password;
CREATE USER username
IDENTIFIED BY password;
```
例如:
@@ -641,6 +676,90 @@ ALTER USER username IDENTIFIED BY password;
ALTER USER brian IDENTIFIED BY brianpassword;
```
### 查看表空间的名称以及大小
<!--rehype:wrap-class=col-span-2-->
```sql
SELECT t.table_name,
ROUND(SUM(bytes / (1024 * 1024)), 0) AS ts_size
FROM dba_tablespaces t,
dba_data_files d
WHERE t.table_name = d.table_name
GROUP BY t.table_name;
```
### 查看还没提交的事务
```sql
select * from v$locked_object;
select * from v$transaction;
```
### 查看数据库库对象
<!--rehype:wrap-class=col-span-2-->
```sql
SELECT owner, object_type, status, COUNT(*) AS count#
FROM all_objects
GROUP BY owner, object_type, status;
```
### 查看数据库的版本
```sql
SELECT version
FROM Product_component_version
WHERE SUBSTR(PRODUCT, 1, 6) = 'Oracle';
```
### 查看数据库的创建日期和归档方式
```sql
SELECT created, Log_Mode, Log_Mode
FROM v$Database;
```
### 查看控制文件
```sql
select name from v$controlfile;
```
### 查看日志文件
```sql
select member from v$logfile;
```
### 查看表空间的使用情況
<!--rehype:wrap-class=col-span-2-->
```sql
SELECT SUM(bytes)/(1024*1024) AS free_space,
tablespace_name
FROM dba_free_space
GROUP BY tablespace_name;
```
### 捕捉运行很久的SOL
```sql
COLUMN username FORMAT A12
COLUMN opname FORMAT A16
COLUMN progress FORMAT A8
SELECT username,
sid,
opname,
ROUND(sofar * 100 / totalwork, 0) || '%' AS progress,
time_remaining,
sql_text
FROM v$session_longops, v$sql
WHERE time_remaining <> 0
AND sql_address = address
AND sql_hash_value = hash_value;
```
另见
---

168
docs/pandoc.md Normal file
View File

@@ -0,0 +1,168 @@
Pandoc 备忘清单
===
Pandoc 是一个文档转换器,这个 [pandoc](https://pandoc.org/) 备忘单包含 pandoc 命令和一些常见的 pandoc 技巧
入门
---
### 语法
```bash
$ pandoc -s [source file] -o [output file]
```
---
- [Pandoc 官方文档](https://pandoc.org/)
#### 安装
安装命令 | 环境
:-|-
`$ brew install pandoc` | macos
`$ choco install pandoc` | windows
#### Debian/Ubuntu
```bash
$ sudo apt-get update
$ sudo apt-get install pandoc
```
#### Fedora
```bash
$ sudo dnf install pandoc
```
#### Arch Linux
```bash
$ sudo pacman -S pandoc
```
### 将 LaTeX 转换为 MS Word
<!--rehype:wrap-class=col-span-2-->
简单的 `.tex``.docx`
```bash
$ pandoc -s file.tex -o file.docx
```
`.tex` 转换为 `.docx` 并使用默认引文
```bash
$ pandoc -s file.tex --citeproc --bibliography=bib_library.bib -o file.docx
```
`.tex` 文件转换为 `.docx` 文件,并注明具体引文
```bash
$ pandoc -s file.tex --citeproc --bibliography=bib_library.bib --csl=apa.csl -o file.docx
```
`.tex``.docx`,带交叉引用
```bash
$ pandoc -s file.tex --filter pandoc-crossref -o file.docx
```
使用示例
---
### 转换文件格式
```bash
$ pandoc input.md -o output.pdf
```
### 支持的输入格式
```bash
$ pandoc -s input.txt -o output.html
```
### 自定义输出格式
```bash
$ pandoc input.md --to=latex -o output.tex
```
### 添加元数据
```bash
$ pandoc input.md -o output.pdf --metadata title="My Document"
```
<!--rehype:className=wrap-text-->
### 从 URL 转换
```bash
$ pandoc https://example.com/document.md -o output.pdf
```
<!--rehype:className=wrap-text-->
### 生成幻灯片
```bash
$ pandoc input.md -t beamer -o output.pdf
```
### 合并文件
```bash
$ pandoc file1.md file2.md -o output.pdf
```
### 指定样式文件
```bash
$ pandoc input.md -o output.pdf --css=style.css
```
<!--rehype:className=wrap-text-->
### 转换为 AsciiDoc
```bash
$ pandoc input.md -o output.asciidoc
```
### 转换为 Docx 格式
```bash
$ pandoc input.md -o output.docx
```
### 执行 Lua 过滤器
```bash
$ pandoc input.md --lua-filter=custom-filter.lua -o output.pdf
```
<!--rehype:className=wrap-text-->
### 自动生成目录
```bash
$ pandoc input.md -o output.pdf --toc
```
### 禁用目录编号
```bash
$ pandoc input.md -o output.pdf --toc --toc-depth=2
```
<!--rehype:className=wrap-text-->
### 显示详细信息
```bash
$ pandoc input.md -o output.pdf -v
```
### 查看支持的输出格式
```bash
$ pandoc --list-output-formats
```

177
docs/phpstorm.md Normal file
View File

@@ -0,0 +1,177 @@
PhpStorm 键盘快捷键
===
在 JetBrains PhpStorm 中发现的 96 个键盘快捷键的可视化备忘表
键盘快捷键
---
### 编辑
<!--rehype:wrap-class=row-span-5-->
快捷键 | 动作
---|---
`Ctrl` `Space` | 基本代码补全
`Alt` `Enter` | 显示意图操作和快速修复
`Ctrl` `P` | 参数信息(在方法调用参数中)
`Ctrl` `Q` | 快速文档查询
`Ctrl` `(鼠标悬停在代码上)` | 简要信息
`Alt` `Insert` | 生成代码...Getters、Setters、Constructors
`Ctrl` `O` | 覆盖方法
`Ctrl` `I` | 实现方法
`Ctrl` `Alt` `T` | 包围...(if..else, try..catch, for, 等)
`Ctrl` `/` | 使用行注释进行注释/取消注释
`Ctrl` `Shift` `/` | 使用块注释进行注释/取消注释
`Ctrl` `W` | 逐渐选择增加的代码块
`Ctrl` `Shift` `W` | 将当前选择减少到先前的状态
`Ctrl` `Alt` `L` | 重新格式化代码
`Ctrl` `Alt` `I` | 自动缩进行
`Ctrl` `D` | 复制当前行或选定的块
`Ctrl` `Y` | 删除插入符处的行
`Ctrl` `Shift` `J` | 智能行合并(仅限 HTML 和 JavaScript
`Ctrl` `Enter` | 智能行拆分(仅限 HTML 和 JavaScript
`Shift` `Enter` | 开始新行
`Ctrl` `Shift` `U` | 切换插入符处单词或选定的块的大小写
`Ctrl` `Shift` `[` | 选择至代码块开头
`Ctrl` `Shift` `]` | 选择至代码块结尾
`Ctrl` `Delete` | 删除至字词末尾
`Ctrl` `Backspace` | 删除至字词开头
`Ctrl` `+/-` | 展开/折叠代码块
`Ctrl` `F4` | 关闭活动编辑器标签
`Ctrl` `Shift` `V` | 从历史粘贴
<!--rehype:className=shortcuts-->
### 调试
<!--rehype:wrap-class=row-span-2-->
快捷键 | 动作
---|---
`F8` | 逐步执行
`F7` | 逐步进入
`Shift` `F8` | 逐步退出
`Alt` `F8` | 评估表达式
`F9` | 恢复程序
`Ctrl` `F8` | 切换断点
`Ctrl` `Shift` `F8` | 查看断点
<!--rehype:className=shortcuts-->
### 运行
快捷键 | 动作
---|---
`Shift` `F10` | 运行
`Shift` `F9` | 调试
`Ctrl` `Shift` `F10` | 从编辑器运行上下文配置
`Ctrl` `Shift` `X` | 运行命令行
<!--rehype:className=shortcuts-->
### 搜索/替换
快捷键 | 动作
---|---
`Ctrl` `F/R` | 查找/替换
`F3` | 查找下一个
`Shift` `F3` | 查找上一个
`Ctrl` `Shift` `F/R` | 在路径中查找/替换
<!--rehype:className=shortcuts-->
### 使用搜索
快捷键 | 动作
---|---
`Alt` `F7` | 查找用法
`Ctrl` `F7` | 在文件中查找用法
`Ctrl` `Shift` `F7` | 在文件中突出显示用法
`Ctrl` `Alt` `F7` | 显示用法
<!--rehype:className=shortcuts-->
### 导航
<!--rehype:wrap-class=row-span-3-->
快捷键 | 动作
---|---
`Ctrl` `N` | 转到类
`Ctrl` `Shift` `N` | 转到文件
`Ctrl` `Shift` `Alt` `N` | 转到符号
`Ctrl` `G` | 转到行
`Alt` `Left/Right` | 转到下一个/上一个编辑器标签
`Esc` | 转到编辑器(从工具窗口)
`Ctrl` `E` | 最近的文件弹出窗口
`Ctrl` `Alt` `Left/Right` | 后退/前进导航
`Ctrl` `Shift` `Backspace` | 转到上次编辑位置
`Alt` `F1` | 在任何视图中选择当前文件或符号
`Ctrl` `B` | 转到声明
`Ctrl` `Alt` `B` | 转到实现
`Ctrl` `Shift` `I` | 打开快速定义查找
`Ctrl` `Shift` `B` | 转到类型声明
`Ctrl` `U` | 转到超类/超方法
`Alt` `Up/Down` | 转到上一个/下一个方法
`Ctrl` `]/[` | 移动至代码块结束/开始
`F2` | 下一个突出显示的错误
`Shift` `F2` | 上一个突出显示的错误
`F4` | 编辑/查看源码
<!--rehype:className=shortcuts-->
### 重构
快捷键 | 动作
---|---
`F5/F6` | 复制/移动
`Alt` `Delete` | 安全删除
`Shift` `F6` | 重命名
`Ctrl` `Alt` `N` | 内联变量
`Ctrl` `Alt` `M/V/F/C` | 提取方法/变量/字段/常量
`Ctrl` `Alt` `Shift` `T` | 重构此处(显示所有可用的重构)
<!--rehype:className=shortcuts-->
### VCS/本地历史
快捷键 | 动作
---|---
`Alt` <code>\`</code> | VCS 快速弹出窗口
`Ctrl` `K` | 提交项目到 VCS
`Ctrl` `T` | 从 VCS 更新项目
`Alt` `Shift` `C` | 查看最近的更改
<!--rehype:className=shortcuts-->
### 通用
快捷键 | 动作
---|---
`Shift x2` | 到处搜索
`Ctrl` `Shift` `A` | 查找操作
`Alt` `1-9` | 打开对应的工具窗口
`Ctrl` `Alt` `F11` | 切换全屏模式
`Ctrl` `Shift` `F12` | 切换最大化编辑器
`Alt` `Shift` `F` | 添加到收藏夹
`Alt` `Shift` `I` | 使用当前配置文件检查当前文件
`Ctrl` `Alt` `S` | 打开设置对话框
`Ctrl` `Tab` | 在标签和工具窗口之间切换
<!--rehype:className=shortcuts-->
### 模板/代码片段
快捷键 | 动作
---|---
`Ctrl` `J` | 插入模板
`eco` | 'echo' 语句
`fore` | foreach(iterable_expr as $value) {...}
`forek` | foreach(iterable_expr as $key => $value) {...}
`inc/inco` | 'include'/'include_once' 语句
`prif` | 私有函数
`prof` | 受保护函数
`pubf` | 公共函数
`rqr/rqro` | 'require'/'require_once' 语句
<!--rehype:className=shortcuts-->
### 其他
快捷键 | 动作
---|---
`Ctrl` `Shift` `A` | 查找操作
<!--rehype:className=shortcuts-->
另见
----
- [PhpStorm 键盘快捷键](https://resources.jetbrains.com/storage/products/phpstorm/docs/PhpStorm_ReferenceCard.pdf) _(resources.jetbrains.com)_

376
docs/pinia.md Normal file
View File

@@ -0,0 +1,376 @@
Pinia 备忘清单
===
这是一份 [`Pinia`](https://pinia.vuejs.org/) 状态管理库的备忘单,列出了 Pinia 的常用命令和操作。
入门
---
### 安装 Pinia
```bash
npm install pinia
# or
yarn add pinia
# or
pnpm add pinia
```
### 定义 Store
<!--rehype:wrap-class=col-span-2 row-span-2-->
创建一个 store 文件(例如 `src/stores/counter.js`),并定义 `store`
```javascript
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', {
state: () => ({
count: 0
}),
actions: {
increment() {
this.count++
}
},
getters: {
doubleCount: (state) => state.count * 2
}
})
```
### 创建 Pinia 实例
```javascript
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
const app = createApp(App)
const pinia = createPinia()
app.use(pinia)
app.mount('#app')
```
在你的 [Vue](./vue.md) 应用中创建一个 Pinia 实例并将其传递给 [Vue](./vue.md)
### 热重载 Store
使用 Vite 时,你可以启用热重载功能:
```javascript
if (import.meta.hot) {
import.meta.hot.accept(acceptHMRUpdate(useCounterStore, import.meta.hot))
}
```
### 使用 Store
<!--rehype:wrap-class=row-span-2-->
在组件中使用 `store`
```javascript
<template>
<div>
<p>Count: {{ counterStore.count }}</p>
<p>Double Count: {{ counterStore.doubleCount }}</p>
<button @click="counterStore.increment">Increment</button>
</div>
</template>
<script>
import { useCounterStore } from '@/stores/counter'
export default {
setup() {
const counterStore = useCounterStore()
return {
counterStore
}
}
}
</script>
```
### Modules 模式
<!--rehype:wrap-class=row-span-2-->
Pinia 不使用传统的 Vuex 模块模式。相反,推荐使用独立的 store 文件:
```javascript
// src/stores/user.js
import { defineStore } from 'pinia'
export const useUserStore = defineStore('user', {
state: () => ({
name: 'Alice',
age: 25
}),
actions: {
setName(name) {
this.name = name
}
},
getters: {
isAdult: (state) => state.age >= 18
}
})
```
### 使用 Options API
如果你更喜欢 Options API可以这样使用 Pinia
```javascript
<script>
import { defineComponent } from 'vue'
import { useCounterStore } from '@/stores/counter'
export default defineComponent({
setup() {
const counterStore = useCounterStore()
return {
counterStore
}
}
})
</script>
```
高级用法
---
### 使用组合函数
你可以将 store 与组合函数一起使用:
```javascript
// src/composables/useCounter.js
import { useCounterStore } from '@/stores/counter'
export function useCounter() {
const counterStore = useCounterStore()
return {
count: counterStore.count,
doubleCount: counterStore.doubleCount,
increment: counterStore.increment
}
}
```
### 插件
<!--rehype:wrap-class=col-span-2-->
Pinia 支持插件。你可以编写插件来扩展 Pinia 的功能:
```javascript
// src/plugins/piniaPlugin.js
export function piniaPlugin({ store }) {
store.$onAction(({ name, store, args, after, onError }) => {
console.log(`Action ${name} was called with args:`, args)
})
}
// main.js
import { createPinia } from 'pinia'
import { piniaPlugin } from './plugins/piniaPlugin'
const pinia = createPinia()
pinia.use(piniaPlugin)
```
### 持久化状态
<!--rehype:wrap-class=row-span-4 col-span-2-->
#### 1. 安装 `pinia-plugin-persist`
<!--rehype:style=color:#228e6c;font-weight: bold;text-align: left;-->
```bash
npm pinia-plugin-persist
```
#### 2. 配置 Pinia 和 `pinia-plugin-persist`
<!--rehype:style=color:#228e6c;font-weight: bold;text-align: left;-->
在你的入口文件中配置 Pinia 和 `pinia-plugin-persist`
**⚠️ Vue 2 项目**
```javascript
import Vue from 'vue'
import vueCompositionApi from '@vue/composition-api'
import { createPinia, PiniaVuePlugin } from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
import App from './App.vue'
Vue.use(vueCompositionApi)
Vue.use(PiniaVuePlugin)
const pinia = createPinia()
pinia.use(piniaPersist)
new Vue({
pinia,
render: h => h(App)
}).$mount('#app')
```
**Vue 3 项目:**
```javascript
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
import App from './App.vue'
const pinia = createPinia()
pinia.use(piniaPersist)
createApp(App)
.use(pinia)
.mount('#app')
```
#### 3. 创建 Store 并启用持久化
<!--rehype:style=color:#228e6c;font-weight: bold;text-align: left;-->
创建一个 Pinia store并启用持久化存储。
```javascript
// stores/userStore.js
import { defineStore } from 'pinia'
export const useUserStore = defineStore('userStore', {
state: () => ({
firstName: 'S',
lastName: 'L',
accessToken: 'xxxxxxxxxxxxx'
}),
actions: {
setToken(value) {
this.accessToken = value
}
},
persist: {
enabled: true,
strategies: [
{
storage: localStorage,
paths: ['accessToken']
}
]
}
})
```
#### 4. 使用 Store
<!--rehype:style=color:#228e6c;font-weight: bold;text-align: left;-->
在组件中使用创建好的 store。
```javascript
// src/components/SomeComponent.vue
<template>
<div>
<p>{{ userStore.firstName }} {{ userStore.lastName }}</p>
<p>{{ userStore.accessToken }}</p>
</div>
</template>
<script>
import { useUserStore } from '@/stores/userStore'
export default {
setup() {
const userStore = useUserStore()
return { userStore }
}
}
</script>
```
### SSR 支持
Pinia 支持服务端渲染 (SSR)。在你的 SSR 入口文件中创建 Pinia 实例:
```javascript
import { createPinia } from 'pinia'
export function createApp() {
const app = createSSRApp(App)
const pinia = createPinia()
app.use(pinia)
return { app, pinia }
}
```
明白了,让我们来结合 `pinia-plugin-persist` 插件完善 Pinia 备忘清单。
### 使用 Vue Devtools
Pinia 可以与 Vue Devtools 一起使用。确保你安装了最新版本的 Vue Devtools然后你可以在 Devtools 中查看和调试你的 Pinia store。
### 使用异步 Actions
Pinia 支持在 actions 中使用异步代码:
```javascript
// src/stores/todo.js
import { defineStore } from 'pinia'
import axios from 'axios'
export const useTodoStore = defineStore('todo', {
state: () => ({
todos: []
}),
actions: {
async fetchTodos() {
const response = await axios.get('/api/todos')
this.todos = response.data
}
}
})
```
### 测试 Pinia Store
你可以使用 Vue Test Utils 和 Jest 来测试你的 Pinia store
```javascript
// __tests__/counterStore.test.js
import { setActivePinia, createPinia } from 'pinia'
import { useCounterStore } from '@/stores/counter'
describe('Counter Store', () => {
beforeEach(() => {
setActivePinia(createPinia())
})
it('increments the count', () => {
const counterStore = useCounterStore()
expect(counterStore.count).toBe(0)
counterStore.increment()
expect(counterStore.count).toBe(1)
})
it('returns double count', () => {
const counterStore = useCounterStore()
counterStore.count = 2
expect(counterStore.doubleCount).toBe(4)
})
})
```
另见
---
- [Pinia 官方文档](https://pinia.vuejs.org/)
- [Pinia GitHub 仓库](https://github.com/vuejs/pinia)
- [Pinia 快速上手](https://pinia.vuejs.org/getting-started.html)
- [pinia-plugin-persist 官方文档](https://seb-l.github.io/pinia-plugin-persist/basic-usage.html)

279
docs/pnpm.md Normal file
View File

@@ -0,0 +1,279 @@
pnpm 备忘清单
===
这是一份 [`pnpm`](https://pnpm.io/) 软件包管理器备忘单,其中列出了 `pnpm` 常用命令使用清单。
入门
---
### pnpm 与 npm 命令比较
<!--rehype:wrap-class=col-span-2 row-span-2-->
npm | pnpm | 说明
:- | :- | :-
`npm install` | `pnpm install` | 安装依赖
`npm init` | `pnpm init` | 创建 `package.json` 文件
`npm install <package>` | `pnpm add <package>` | 安装包
`npm install -g <package>` | `pnpm add -g <package>` | 全局安装包
`npm update` | `pnpm update` | 更新包
`npm cache clean` | `pnpm cache clean` | 清理缓存
参考 [npm](./npm.md) 备忘清单
### pnpm list
```shell
# 列出所有已安装的包
pnpm list
# 列出全局安装的包
pnpm list -g
# 查找过时的包
pnpm outdated
```
### pnpm why
```shell
# 显示为什么安装了某个包
pnpm why <package>
```
### pnpm install
<!--rehype:wrap-class=row-span-3-->
pnpm | 说明
:- | :-
`--no-lockfile` | 不生成 pnpm-lock.yaml 锁定文件
`--force` | 强制覆盖现有的 node_modules
`--frozen-lockfile` | 忽略 pnpm-lock.yaml 中的更改
`--offline` | 离线模式,不尝试从远程仓库安装包
`--shamefully-hoist` | 类似于 npm 的 hoist 行为
`--strict-peer-dependencies` | 严格检查 peer dependencies
<!--rehype:className=style-list-arrow-->
这些选项可用于 `pnpm install`
### pnpm add
<!--rehype:wrap-class=row-span-3-->
pnpm | 说明
:- | :-
`--save` | 将包添加到 dependencies
`--save-dev` | 将包添加到 devDependencies
`--global` | 全局安装包
`--exact` | 安装精确版本号的包
`--shamefully-hoist` | 类似于 npm 的 hoist 行为
`--strict-peer-dependencies` | 严格检查 peer dependencies
<!--rehype:className=style-list-arrow-->
这些选项可用于 `pnpm add`
### pnpm update
```shell
# 更新所有包
pnpm update
# 更新特定包
pnpm update <package>
# 更新到最新版本(包括 major 版本)
pnpm update --latest
```
### pnpm remove
```shell
# 从依赖中删除包
pnpm remove <package>
# 删除全局依赖包
pnpm remove -g create-react-app
# 删除特定版本的依赖包
pnpm remove lodash@4.17.21
```
### pnpm cache
```shell
# 清理 pnpm 缓存
pnpm cache clean
# 查看缓存中所有的包
pnpm cache list
```
示例
---
### 安装包
```bash
# 将包添加到“dependencies”
pnpm add <package>
# 将包添加到“devDependencies”
pnpm add -D <package>
# 将包作为精确版本添加
pnpm add --exact <package>
# 在全局范围内安装包
pnpm add -g <package>
# 安装特定版本的包
pnpm add <package>@<version>
```
### 移除包
```bash
pnpm remove <package>
# 删除多个依赖包
pnpm remove lodash express
# 删除全局依赖包
pnpm remove -g create-react-app
# 删除特定版本的依赖包
pnpm remove lodash@4.17.21
```
### 查看包
```bash
# 列出已安装的包
pnpm list
# 列出顶级安装的包
pnpm list --depth 0
# 列出全局安装的包
pnpm list -g
# 根据模式和深度列出包
pnpm list --pattern "lodash" --depth 1
```
### 清除
```bash
# 清理 node_modules 并删除不必要的文件
pnpm prune
# 检查过时的包
pnpm outdated
```
### 信息
```bash
# 显示关于安装包的原因的信息
pnpm why <package>
```
### 清理缓存
```bash
# 清除 pnpm 的全局缓存
pnpm cache clean
```
此外,您可以指定一个或多个要清理的包。
Monorepo
---
### 创建 Monorepo 工作区
<!--rehype:wrap-class=row-span-3-->
- 创建一个新的 pnpm 工作区:
```bash
pnpm init -w
```
- 将在项目的根目录中创建一个 `pnpm-workspace.yaml` 文件,内容如下:
```yaml
packages:
- 'packages/**'
- 'apps/**'
```
- 在 `pnpm-workspace.yaml` 中定义您的工作区结构:
```yaml
packages:
- 'packages/*'
- 'apps/*'
```
<!--rehype:className=style-timeline-->
### 添加包到 Monorepo 工作区
```bash
pnpm add <package> -w # 在工作区中添加包
```
### 运行脚本
<!--rehype:wrap-class=row-span-2-->
```bash
# 在所有包中运行脚本
pnpm -r run <script>
# 仅在某个包中运行脚本
pnpm --filter <package> run <script>
# 在某个包及其依赖中运行脚本
pnpm --filter <package>... run <script>
```
### 添加工作区范围的依赖
```bash
# 添加依赖到工作区根目录
pnpm add <package> -w
# 添加开发依赖到工作区根目录
pnpm add -D <package> -w
```
### 创建新的包
在 `packages` 目录中创建新的包,例如:
```bash
mkdir packages/new-package
cd packages/new-package
pnpm init
```
### 链接本地包
```bash
# 将本地包链接到当前工作区
pnpm link <local-package-path>
# 链接工作区中的包
pnpm add <local-package-name> --workspace
```
高级用法
---
### 工作区
```bash
# 创建工作区
pnpm init -w
# 在工作区中添加包
pnpm add <package> -w
```
### 链接
```bash
# 链接一个全局包到当前项目
pnpm link <package>
# 链接本地包到全局
pnpm link --global <package>
```
### 运行脚本
```bash
# 运行 package.json 中的脚本
pnpm run <script>
# 运行根目录中的包的脚本
pnpm run -w <script>
```
另见
---
- [pnpm 官方文档网站](https://pnpm.io/)
- [pnpm 常见问题解答](https://pnpm.io/motivation)

View File

@@ -1851,6 +1851,12 @@ brew upgrade pipenv # homebrew
```
```shell
# 将 pipenv 命令加入到系统环境变量 $PATH 中 (Unix and MacOS)
dir=$(python -c 'import site; print(site.USER_BASE + "/bin")') # 打印 python site-packages bin 路径
echo 'export PATH="'$dir':$PATH"' >> ~/.zshrc # 将 dir 路径加入到 PATH 中
source ~/.zshrc
# 安装 package
pipenv install <package name> # 不指定版本
pipenv install <package name>==<version> # 精确指定版本

View File

@@ -13,6 +13,7 @@ Pytorch 是一种开源机器学习框架,可加速从研究原型设计到生
- [Pytorch 官方备忘清单](https://pytorch.org/tutorials/beginner/ptcheat.html) _(pytorch.org)_
### 认识 Pytorch
<!--rehype:wrap-class=row-span-2-->
```python
from __future__ import print_function
@@ -32,6 +33,7 @@ tensor([
Tensors 张量: 张量的概念类似于Numpy中的ndarray数据结构, 最大的区别在于Tensor可以利用GPU的加速功能.
### 创建一个全零矩阵
<!--rehype:wrap-class=row-span-2-->
```python
x = torch.zeros(5, 3, dtype=torch.long)
@@ -95,6 +97,7 @@ tensor([[ 1.6978, -1.6979, 0.3093],
```
### 加法操作(4)
<!--rehype:wrap-class=row-span-2-->
```python
y.add_(x)
@@ -118,6 +121,7 @@ tensor([-2.0902, -0.4489, -0.1441, 0.8035, -0.8341])
<!--rehype:className=wrap-text-->
### 张量形状
<!--rehype:wrap-class=row-span-2-->
```python
x = torch.randn(4, 4)
@@ -174,6 +178,85 @@ tensor([2., 2., 2., 2., 2.], dtype=torch.float64)
注意: 所有在CPU上的Tensors, 除了CharTensor, 都可以转换为Numpy array并可以反向转换.
### squeeze函数
```python
>>> x = torch.rand(1, 2, 1, 28, 1)
# squeeze不加参数默认去除所有为1的维度
>>> x.squeeze().shape
torch.Size([2, 28])
# squeeze加参数去除指定为1的维度
>>> x.squeeze(dim=0).shape
torch.Size([2, 1, 28, 1])
# squeeze加参数如果不为1则不变
>>> x.squeeze(1).shape
torch.Size([1, 2, 1, 28, 1])
# 既可以是函数,也可以是方法
>>> torch.squeeze(x,-1).shape
torch.Size([1, 2, 1, 28])
```
### unsqueeze函数
```python
>>> x = torch.rand(2, 28)
# unsqueeze必须加参数 _ 2 _ 28 _
>>> x.unsqueeze(0).shape
# 参数代表在哪里添加维度 0 1 2
torch.Size([1, 2, 28])
# 既可以是函数,也可以是方法
>>> torch.unsqueeze(x, -1).shape
torch.Size([2, 28, 1])
```
Cuda 相关
---
### 检查 Cuda 是否可用
```python
>>> import torch.cuda
>>> torch.cuda.is_available()
>>> True
```
### 列出 GPU 设备
<!--rehype:wrap-class=col-span-2 row-span-2-->
```python
import torch
device_count = torch.cuda.device_count()
print("CUDA 设备")
for i in range(device_count):
device_name = torch.cuda.get_device_name(i)
total_memory = torch.cuda.get_device_properties(i).total_memory / (1024 ** 3)
print(f"├── 设备 {i}: {device_name}, 容量: {total_memory:.2f} GiB")
print("└── (结束)")
```
### 将模型、张量等数据在 GPU 和内存之间进行搬运
```python
import torch
# 将 0 替换为您的 GPU 设备索引或者直接使用 "cuda"
device = f"cuda:0"
# 移动到GPU
tensor_m = torch.tensor([1, 2, 3])
tensor_g = tensor_m.to(device)
model_m = torch.nn.Linear(1, 1)
model_g = model_m.to(device)
# 向后移动
tensor_m = tensor_g.cpu()
model_m = model_g.cpu()
```
导入 Imports
---
@@ -182,28 +265,71 @@ tensor([2., 2., 2., 2., 2.], dtype=torch.float64)
```python
# 根包
import torch
# 数据集表示和加载
```
数据集表示和加载
```python
from torch.utils.data import Dataset, DataLoader
```
<!--rehype:className=wrap-text-->
### 神经网络 API
<!--rehype:wrap-class=row-span-2-->
```python
# 计算图
import torch.autograd as autograd
# 计算图中的张量节点
from torch import Tensor
# 神经网络
```
神经网络
```python
import torch.nn as nn
# 层、激活等
import torch.nn.functional as F
# 优化器,例如 梯度下降、ADAM等
import torch.optim as optim
# 混合前端装饰器和跟踪 jit
```
混合前端装饰器和跟踪 jit
```python
from torch.jit import script, trace
```
### ONNX
<!--rehype:wrap-class=row-span-2-->
```python
torch.onnx.export(model, dummy data, xxxx.proto)
# 导出 ONNX 格式
# 使用经过训练的模型模型dummy
# 数据和所需的文件名
```
<!--rehype:className=wrap-text-->
加载 ONNX 模型
```python
model = onnx.load("alexnet.proto")
```
检查模型IT 是否结构良好
```python
onnx.checker.check_model(model)
```
打印一个人类可读的,图的表示
```python
onnx.helper.printable_graph(model.graph)
```
### Torchscript 和 JIT
```python
@@ -218,25 +344,8 @@ torch.jit.trace()
装饰器用于指示被跟踪代码中的数据相关控制流
### ONNX
```python
torch.onnx.export(model, dummy data, xxxx.proto)
# 导出 ONNX 格式
# 使用经过训练的模型模型dummy
# 数据和所需的文件名
model = onnx.load("alexnet.proto")
# 加载 ONNX 模型
onnx.checker.check_model(model)
# 检查模型IT 是否结构良好
onnx.helper.printable_graph(model.graph)
# 打印一个人类可读的,图的表示
```
<!--rehype:className=wrap-text-->
### Vision
<!--rehype:wrap-class=col-span-2-->
```python
# 视觉数据集,架构 & 变换

View File

@@ -80,9 +80,9 @@ npm run start # 监听 md 文件编译输出 HTML
<!--rehype:class=home-card-->
```
首页导航图标存放在 `scripts/assets` 目录中,如果你的备忘清单定义为 `docs/cron.md`,那么你的图标就定义为 `cron.svg` 存放到 `scripts/assets` 目录中,重新编译首页当行菜单就拥有了图标。
首页导航图标存放在 `/assets` 目录中,如果你的备忘清单定义为 `docs/cron.md`,那么你的图标就定义为 `cron.svg` 存放到 `/assets` 目录中,重新编译首页当行菜单就拥有了图标。
- 图标存放在 [`scripts/assets`](https://github.com/jaywcjlove/reference/blob/main/scripts/assets) 目录中
- 图标存放在 [`/assets`](https://github.com/jaywcjlove/reference/tree/main/assets) 目录中
- 图片名称与清单名称保持一致 `cron.md` -> `cron.svg` (注意大小写)
- SVG 图标尺寸 `<svg height="1em" width="1em"`
- SVG 图标颜色使用继承颜色值 `<svg fill="currentColor"`
@@ -197,23 +197,37 @@ license = "支持 HTML 字符串"
```
### 支持更多配置加载
<!--rehype:wrap-class=col-span-2-->
```bash
.refsrc .refsrc.json
.refsrc.json5 .refsrc.jsonc
.refsrc.yaml .refsrc.yml
.refsrc.toml .refsrc.ini
.refsrc.js .refsrc.ts
.refsrc.cjs .refsrc.mjs
.config/refsrc .config/refsrc.json
.config/refsrc.json5 .config/refsrc.jsonc
.config/refsrc.yaml .config/refsrc.yml
.config/refsrc.toml .config/refsrc.ini
.config/refsrc.js .config/refsrc.ts
.config/refsrc.cjs .config/refsrc.mjs
refs.config.js refs.config.ts
refs.config.cjs refs.config.mjs
```
- `.refsrc`
- `.refsrc.json`
- `.refsrc.json5`
- `.refsrc.jsonc`
- `.refsrc.yaml`
- `.refsrc.yml`
- `.refsrc.toml`
- `.refsrc.ini`
- `.refsrc.js`
- `.refsrc.ts`
- `.refsrc.cjs`
- `.refsrc.mjs`
- `.config/refsrc`
- `.config/refsrc.json`
- `.config/refsrc.json5`
- `.config/refsrc.jsonc`
- `.config/refsrc.yaml`
- `.config/refsrc.yml`
- `.config/refsrc.toml`
- `.config/refsrc.ini`
- `.config/refsrc.js`
- `.config/refsrc.ts`
- `.config/refsrc.cjs`
- `.config/refsrc.mjs`
- `refs.config.js`
- `refs.config.ts`
- `refs.config.cjs`
- `refs.config.mjs`
<!--rehype:className=cols-3 style-none-->
### 环境变量
@@ -798,7 +812,7 @@ H2 部分
### Title 6
```
在 `Title 1` 标题添加 `col-span-2` 和 `row-span-2` 占位类,使用 `空格` 间隔。
[#](https://github.com/jaywcjlove/reference/blob/8fad19506946ae84139002ff367e2f2bca9b0696/docs/quickreference.md?plain=1#L774-L775)<!--rehype:target=__blank--> 在 `Title 1` 标题添加 `col-span-2` 和 `row-span-2` 占位类,使用 `空格` 间隔。
表格
---
@@ -813,14 +827,14 @@ H2 部分
`%A, %B %e, %Y` | Sunday, June 5, 2013
`%b %e %a` | Jun 5 Sun
#### Time
#### Time (H4)
:- | :-
:- | :-
`%H:%M` | 23:05
`%I:%M %p` | 11:05 PM
标题为 `H4` 的基本表格。
[#](https://github.com/jaywcjlove/reference/blob/8fad19506946ae84139002ff367e2f2bca9b0696/docs/quickreference.md?plain=1#L806-L823)<!--rehype:target=__blank--> 标题为 `H4` 的基本表格。
### 快捷键
@@ -833,6 +847,9 @@ H2 部分
`R` | Rectangle
`O` | Oval
`U` | Rounded
<!--rehype:className=shortcuts-->
[#](https://github.com/jaywcjlove/reference/blob/8fad19506946ae84139002ff367e2f2bca9b0696/docs/quickreference.md?plain=1#L827-L836)<!--rehype:target=__blank--> `<!--rehype:className=shortcuts-->`
### 展示标题
@@ -843,7 +860,7 @@ H2 部分
`/` | `/html/body/div` | Root
<!--rehype:className=show-header-->
`<!--rehype:className=show-header-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L839-L844)<!--rehype:target=__blank--> `<!--rehype:className=show-header-->`
### 列表样式展示表格
@@ -854,7 +871,7 @@ H2 部分
`titleBarStyle.default` | 分别返回 _mac_ 或者 _win_ 的标准标题栏
<!--rehype:className=style-list-->
`<!--rehype:className=style-list-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L850-L855)<!--rehype:target=__blank--> `<!--rehype:className=style-list-->`
### 列表箭头样式展示表格
@@ -865,7 +882,7 @@ H2 部分
`titleBarStyle.default` | 分别返回 _mac_ 或者 _win_ 的标准标题栏
<!--rehype:className=style-list-arrow-->
`<!--rehype:className=style-list-arrow-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L861-L866)<!--rehype:target=__blank--> `<!--rehype:className=style-list-arrow-->`
### 隐藏表头强制小尺寸自动换行
@@ -876,7 +893,7 @@ H2 部分
`titleBarStyle.default` | 分别返回 _mac_ 或者 _win_ 的标准标题栏
<!--rehype:className=auto-wrap-->
`<!--rehype:className=auto-wrap-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L872-L877)<!--rehype:target=__blank--> `<!--rehype:className=auto-wrap-->`
### 表格末尾列左对齐
<!--rehype:wrap-class=col-span-2-->
@@ -887,7 +904,7 @@ H2 部分
`./` | Relative
<!--rehype:className=show-header left-align-->
默认表格末尾列`右对齐`,添加 `<!--rehype:className=left-align-->` 类让其`左对齐`
[#示例](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L884-L888)<!--rehype:target=__blank--> 默认表格末尾列`右对齐`,添加 `<!--rehype:className=left-align-->` 类让其`左对齐`
### 强制 code 不换行
@@ -897,7 +914,7 @@ H2 部分
| `adb reboot bootloader` | Reboots the device into fastboot |
<!--rehype:className=show-header code-nowrap-->
添加 `<!--rehype:className=code-nowrap-->` 注释
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L894-L898)<!--rehype:target=__blank--> 添加 `<!--rehype:className=code-nowrap-->`
列表
---
@@ -908,6 +925,8 @@ H2 部分
- Item 2
- Item 3
[#示例](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L905-L909)<!--rehype:target=__blank-->
### 四列
- Item 1
@@ -920,7 +939,7 @@ H2 部分
- Item 8
<!--rehype:className=cols-4-->
`<!--rehype:className=cols-4-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L913-L921)<!--rehype:target=__blank--> `<!--rehype:className=cols-4-->`
### 列表步骤
<!--rehype:wrap-class=row-span-2-->
@@ -944,7 +963,7 @@ H2 部分
```
<!--rehype:className=style-timeline-->
`<!--rehype:className=style-timeline-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L928-L945)<!--rehype:target=__blank--> `<!--rehype:className=style-timeline-->`
### 没有标记
@@ -959,7 +978,7 @@ H2 部分
- Item 9
<!--rehype:className=cols-3 style-none-->
`<!--rehype:className=cols-3 style-none-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L951-L960)<!--rehype:target=__blank--> `<!--rehype:className=cols-3 style-none-->`
### 圆圈标记
@@ -968,7 +987,7 @@ H2 部分
- Item 3
<!--rehype:className=style-round-->
`<!--rehype:className=style-round-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L966-L969)<!--rehype:target=__blank--> `<!--rehype:className=style-round-->`
### 箭头标记
@@ -977,7 +996,7 @@ H2 部分
- Item 3
<!--rehype:className=style-arrow-->
`<!--rehype:className=style-arrow-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L975-L978)<!--rehype:target=__blank--> `<!--rehype:className=style-arrow-->`
H2 部分 - 5列效果展示
---
@@ -990,6 +1009,8 @@ H2 部分 - 5列效果展示
...
```
[#示例](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L986-L991)<!--rehype:target=__blank-->
### Two
```
@@ -1024,7 +1045,7 @@ H3 部分 - 占位效果展示
...合并两行
```
`<!--rehype:wrap-class=row-span-2-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L1020-L1027)<!--rehype:target=__blank--> `<!--rehype:wrap-class=row-span-2-->`
### col-span-2
<!--rehype:wrap-class=col-span-2-->
@@ -1033,7 +1054,7 @@ H3 部分 - 占位效果展示
...合并两列
```
`<!--rehype:wrap-class=col-span-2-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L1020-L1027)<!--rehype:target=__blank--> `<!--rehype:wrap-class=col-span-2-->`
### 红色标题
<!--rehype:style=background:#e91e63;-->
@@ -1042,7 +1063,7 @@ H3 部分 - 占位效果展示
...红色标题配置
```
`<!--rehype:style=background:#e91e63;-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L1038-L1043)<!--rehype:target=__blank--> `<!--rehype:style=background:#e91e63;-->`
### 黄色标题
<!--rehype:style=background:#d7a100;-->
@@ -1051,18 +1072,16 @@ H3 部分 - 占位效果展示
...黄色标题配置
```
`<!--rehype:style=background:#d7a100;-->`
[#](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L1047-L1052)<!--rehype:target=__blank--> `<!--rehype:style=background:#d7a100;-->`
### col-span-3
<!--rehype:wrap-class=col-span-3-->
```
...
```
... [#示例](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L1056-L1061)<!--rehype:target=__blank--> 三列合并
### 卡片子项
每个部分可以有以下子项:
[#示例](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L1063-L1077)<!--rehype:target=__blank--> 每个部分可以有以下子项:
#### H4 子标题
@@ -1080,13 +1099,15 @@ H3 部分 - 占位效果展示
每个盒子(卡片)都是一个 `H3` 部分。 盒子将包含 `H3` 自身内的所有东西。
这是一个包含段落的基本部分
[#示例](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L1079-L1083)<!--rehype:target=__blank--> 这是一个包含段落的基本部分
### H3 部分背景颜色
<!--rehype:wrap-style=background: #1b5064;-->
<!--rehype:wrap-style=background: #1e7da173;-->
```markdown
注释配置:
`<!--rehype:wrap-style=background: #1b5064;-->`
`<!--rehype:wrap-style=background: #1e7da173;-->`
```
<!--rehype:className=wrap-text -->
[#示例](https://github.com/jaywcjlove/reference/blob/ee03850619440e3700ed68ccc2ed21d3591a1490/docs/quickreference.md?plain=1#L1085-L1087)<!--rehype:target=__blank-->

295
docs/r.md Normal file
View File

@@ -0,0 +1,295 @@
R 备忘清单
===
该备忘单提供了使用 R 语言的示例,涵盖 R 语言基础知识、控制流、类型、结构/类、运算符、函数方法等
入门
---
### 获取帮助
访问帮助文件
```r
?mean
# 获取特定功能的帮助
help.search('weighted mean')
# 在帮助文件中搜索单词或短语
help(package = 'dplyr')
# 查找软件包的帮助。
```
有关对象的更多信息
```r
str(iris)
# 获取对象结构的摘要
class(iris)
# 查找对象所属的类
```
### 下载和使用库
```r
install.packages('dplyr')
# 从 CRAN 下载并安装软件包
install.packages(BiocManager)
library(BiocManager)
BiocManager::install("dplyr")
# 使用Bioconductor的BiocManager包下载并安装软件包
devtools::install_github("clusterProfiler")
# 直接从github中下载并安装软件包
library(dplyr)
# 将包加载到会话中,使所有其功能可供使用
dplyr::select
# 使用包中的特定函数
data(iris)
# 将内置数据集加载到环境中。
```
### 工作目录
查找当前工作目录(其中找到输入并发送输出)
```r
getwd()
```
更改当前工作目录
```r
setwd(C://file/path)
```
使用 RStudio 中的项目来设置工作目录到您正在使用的文件夹
基础入门
---
### 变量和赋值
```R
x <- 10 # 使用箭头赋值
y = 20 # 或者直接使用等号赋值
```
### 数据类型
```R
numeric_var <- 3.14 # 数值型
character_var <- "hello" # 字符串
logical_var <- TRUE # 逻辑型
```
### 向量和列表
<!--rehype:wrap-class=row-span-2-->
```R
# 向量
numeric_vector <- c(1, 2, 3, 4)
character_vector <- c("apple", "orange", "banana")
# 列表
my_list <- list(name = "John", age = 30, city = "New York")
```
<!--rehype:className=wrap-text-->
向量和操作
```r
# 创建向量
numbers <- c(1, 2, 3, 4, 5)
# 计算向量的和
sum_result <- sum(numbers)
# 计算向量的平均值
mean_result <- mean(numbers)
```
### 数据框(Data Frame)
```R
my_df <- data.frame(name = c("John", "Alice"), age = c(30, 25))
# 创建数据框
student_data <- data.frame(
name = c("John", "Alice", "Bob"),
age = c(25, 23, 22),
grade = c("A", "B", "C")
)
# 显示数据框
print(student_data)
```
<!--rehype:className=wrap-text-->
### 函数
```R
# 定义函数
add_numbers <- function(a, b) {
result <- a + b
return(result)
}
# 调用函数
sum_result <- add_numbers(10, 5)
```
### 条件语句
```R
if (x > 0) {
print("Positive")
} else {
print("Non-positive")
}
```
### for 循环语句
```R
for (i in 1:5) {
print(i)
}
```
### while 循环
```r
counter <- 1
while (counter <= 5) {
print(counter)
counter <- counter + 1
}
```
### 数据读取和输出
```R
# 读取数据
my_data <- read.csv("data.csv")
# 输出数据
write.csv(my_data, "output.csv")
```
### 清理工作空间
```r
# 清空所有变量
rm(list = ls())
# 退出 R
q()
```
图形绘制
---
### 散点图
```R
plot(x, y)
```
### 直方图
```R
hist(data)
```
### 线图
```R
plot(x, y, type = "l")
```
### 绘制散点图
```R
x <- c(1, 2, 3, 4, 5)
y <- c(2, 4, 5, 6, 7)
plot(x, y, main = "Scatter Plot", xlab = "X-axis", ylab = "Y-axis")
```
<!--rehype:className=wrap-text-->
### 绘制直方图
```R
data <- c(1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5)
hist(data, main = "Histogram", xlab = "Value", col = "lightblue")
```
<!--rehype:className=wrap-text-->
### 绘制折线图
```R
x <- c(1, 2, 3, 4, 5)
y <- c(2, 4, 5, 6, 7)
plot(x, y, type = "l", main = "Line Plot", xlab = "X-axis", ylab = "Y-axis")
```
<!--rehype:className=wrap-text-->
向量
---
### 创建向量
<!--rehype:wrap-class=col-span-2-->
:- | - | -
-------|-------|-------
`c(2, 4, 6)` | 2 4 6 | 将元素连接成向量
`2:6` | 2 3 4 5 6 | 整数序列
`seq(2, 3, by=0.5)` | 2.0 2.5 3.0 | 复杂的序列
`rep(1:2, times=3)` | 1 2 1 2 1 2 | 重复向量
`rep(1:2, each=3)` | 1 1 1 2 2 2 | 重复向量的元素
### 选择向量元素
<!--rehype:wrap-class=row-span-2-->
#### 按位置
:- | -
----|----
`x[4]` | 第四个元素
`x[-4]` | 除了第四个之外的所有
`x[2:4]` | 元素二到四
`x[-(2:4)]` | 除二到四之外的所有元素
`x[c(1, 5)]` | 元素一和元素五
<!--rehype:className=left-align-->
#### 按值
:- | -
----|----
`x[x == 10]` | 等于 10 的元素
`x[x < 0]` | 所有元素小于零
`x[x %in% c(1, 2, 5)]` | 集合 1, 2, 5 中的元素
<!--rehype:className=left-align-->
#### 命名向量
:- | -
----|----
`x['apple']` | 名为“apple”的元素。
<!--rehype:className=left-align-->
### 重复向量的元素
:- | -
----|----
`sort(x)` | 返回排序后的 x
`rev(x)` | 返回 x 的反转
`table(x)` | 查看值的计数
`unique(x)`| 查看唯一值
<!--rehype:className=left-align-->
另见
---
- [全面了解Base R](https://blanket58.github.io/books/study-notes-of-R/) _(github.io)_
- [R 语言官网](https://www.r-project.org/) _(r-project.org)_
- [数据科学 R](https://r4ds.hadley.nz/) _(hadley.nz)_
- [使用 R 进行整洁的建模](https://www.tmwr.org/) _(tmwr.org)_
- [在 R 中使用 mlr3 进行应用机器学习](https://mlr3book.mlr-org.com/) _(mlr-org.com)_
- [深度学习](https://srdas.github.io/DLBook/) _(github.io)_
- [搜索任何与 R 相关的内容](https://rdrr.io/) _(rdrr.io)_
- [R 文档](https://www.rdocumentation.org/) _(rdocumentation.org)_

View File

@@ -10,12 +10,18 @@ RegEX 备忘清单
这是开始使用正则表达式(Regex)的快速备忘单。
- [Python 中的 Regex](#python-中的正则表达式) _(Quick Reference)_
- [JavaScript 中的 Regex](#javascript-中的正则表达式) _(Quick Reference)_
- [PHP 中的 Regex](#php中的正则表达式) _(Quick Reference)_
- [Java 中的 Regex](#java-中的正则表达式) _(Quick Reference)_
- [MySQL 中的 Regex](#mysql中的正则表达式) _(Quick Reference)_
- [Vim 中的 Regex](./vim#vim-搜索和替换) _(Quick Reference)_
- [Python 中的 Regex](#python-中的正则表达式)
_(速查手册)_
- [JavaScript 中的 Regex](#javascript-中的正则表达式)
_(速查手册)_
- [PHP 中的 Regex](#php中的正则表达式)
_(速查手册)_
- [Java 中的 Regex](#java-中的正则表达式)
_(速查手册)_
- [MySQL 中的 Regex](#mysql中的正则表达式)
_(速查手册)_
- [Vim 中的 Regex](./vim#vim-搜索和替换)
_(速查手册)_
- [在线 Regex 测试器](https://regex101.com/) _(regex101.com)_
- [轻松学习 Regex](https://github.com/ziishaned/learn-regex/blob/master/translations/README-cn.md) _(github.com)_
- [正则表达式实例搜集](https://jaywcjlove.github.io/regexp-example) _(jaywcjlove.github.io)_
@@ -32,6 +38,7 @@ RegEX 备忘清单
`[0-9]` | 范围内的数字:`0-9`
`[a-zA-Z]` | 范围内的字符:<br>`a-z``A-Z`
`[a-zA-Z0-9]` | 范围内的字符:<br>`a-z``A-Z``0-9`
<!--rehype:className=left-align-->
### 量词
@@ -47,24 +54,27 @@ RegEX 备忘清单
`a*` | 贪心量词
`a*?` | 惰性量词
`a*+` | 占有量词
<!--rehype:className=left-align-->
### 常用元字符
- \^
- \{
- \+
- \<
- \[
- \*
- \)
- \>
- \.
- \(
- \|
- \$
- \\
- \?
<!--rehype:className=cols-3 style-none-->
模式 | 描述
:-|-
`^` | 匹配字符串的开头
`{` | 开始一个数量限定符,指定出现次数
`+` | 匹配前面的元素一次或多次
`<` | 非标准的正则表达式元字符(在 HTML 中常用)
`[` | 开始一个字符类
`*` | 匹配前面的元素零次或多次
`)` | 结束捕获组
`>` | 非标准的正则表达式元字符(在 HTML 中常用)
`.` | 匹配除换行符之外的任意字符
`(` | 开始一个捕获组
`\|` | 在正则表达式模式中作为逻辑或操作
`$` | 匹配字符串的结尾
`\` | 转义元字符,使其具有字面意义
`?` | 匹配前面的元素零次或一次
<!--rehype:className=left-align-->
使用 `\` 转义这些特殊字符
@@ -126,6 +136,7 @@ RegEX 备忘清单
`\z` | 字符串的绝对结尾
`\b` | 一个词的边界
`\B` | 非单词边界
<!--rehype:className=left-align-->
### 替代
@@ -144,6 +155,7 @@ RegEX 备忘清单
`\U` | 大写转换
`\L` | 小写转换
`\E` | 终止任何转换
<!--rehype:className=left-align-->
### 组构造
@@ -160,6 +172,7 @@ RegEX 备忘清单
`(?P<name>...)` | 命名捕获组
`(?imsxXU)` | 内联修饰符
`(?(DEFINE)...)` | 在使用它们之前预定义模式
<!--rehype:className=left-align-->
### 断言
@@ -368,6 +381,7 @@ RegEX 备忘清单
:-|-
`(in\|out)put` | 匹配 <yel>input</yel><yel>output</yel>
`\d{5}(-\d{4})?` | 美国邮政编码 _(“+ 4”可选)_
<!--rehype:className=left-align-->
如果组后匹配失败,解析器会尝试每个替代方案。
<br>
@@ -395,10 +409,13 @@ RegEX 备忘清单
:-|-
`(?>red\|green\|blue)` | 比非捕获更快
`(?>id\|identity)\b` | 匹配 <yel>id</yel>,但不匹配 <yel>id</yel>entity
<!--rehype:className=left-align-->
"id" 匹配,但 `\b` 在原子组之后失败,
<yel>id</yel> 匹配,但 `\b` 在原子组之后失败,
解析器不会回溯到组以重试“身份”
---
如果替代品重叠,请从长到短命令。
### 零宽度断言 Lookaround(前后预查)
@@ -648,7 +665,7 @@ M(?(?=.*?\bher\b)s|r)\.
<!--rehype:className=show-header-->
Python 中的正则表达式
---------------
---
### 入门
@@ -662,6 +679,7 @@ import re
<!--rehype:wrap-class=col-span-2 row-span-3-->
#### re.search()
<!--rehype:style=text-align: left;color: var(--primary-color);-->
```python
>>> sentence = 'This is a sample string'
@@ -672,6 +690,7 @@ False
```
#### re.findall()
<!--rehype:style=text-align: left;color: var(--primary-color);-->
```python
>>> re.findall(r'\bs?pare?\b', 'par spar apparent spare part pare')
@@ -681,6 +700,7 @@ False
```
#### re.finditer()
<!--rehype:style=text-align: left;color: var(--primary-color);-->
```python
>>> m_iter = re.finditer(r'[0-9]+', '45 349 651 593 4 204')
@@ -689,6 +709,7 @@ False
```
#### re.split()
<!--rehype:style=text-align: left;color: var(--primary-color);-->
```python
>>> re.split(r'\d+', 'Sample123string42with777numbers')
@@ -696,6 +717,7 @@ False
```
#### re.sub()
<!--rehype:style=text-align: left;color: var(--primary-color);-->
```python
>>> ip_lines = "catapults\nconcatenate\ncat"
@@ -706,6 +728,7 @@ False
```
#### re.compile()
<!--rehype:style=text-align: left;color: var(--primary-color);-->
```python
>>> pet = re.compile(r'dog')

419
docs/rxjs.md Normal file
View File

@@ -0,0 +1,419 @@
RxJS 备忘清单
===
[RxJS](https://rxjs.dev/)Reactive Extensions for JavaScript是一个强大的库用于处理异步事件和数据流。以下是 RxJS 的一些关键概念、操作符和方法的总结。
## 入门
### 安装 RxJS
```bash
npm install rxjs
```
### 清晰
<!--rehype:wrap-class=row-span-2-->
RxJS 的强大之处在于它使用纯函数生成值的能力。这意味着您的代码更不容易出错。通常情况下,您会创建一个不纯的函数,而代码的其他部分可能会弄乱您的状态。
```js
let count = 0;
document.addEventListener('click', () => {
console.log(`Clicked ${++count} times`)
});
```
使用 `RxJS` 可以隔离状态。
```js
import { fromEvent, scan } from 'rxjs';
fromEvent(document, 'click')
.pipe(scan((count) => count + 1, 0))
.subscribe((count) => {
console.log(`Clicked ${count} times`)
});
```
扫描操作符的工作原理与数组的 `reduce` 类似。它接受一个暴露给回调函数的值。回调的返回值将成为下次回调运行时公开的下一个值。
### 流
<!--rehype:wrap-class=row-span-2-->
`RxJS` 拥有一整套运算符,可以帮助您控制事件如何流经您的可观察对象。这是使用纯 JavaScript 每秒最多允许一次点击的方式:
```js
let count = 0;
let rate = 1000;
let lastClick = Date.now() - rate;
document.addEventListener('click', () => {
if (Date.now() - lastClick >= rate) {
console.log(`Clicked ${++count}times`);
lastClick = Date.now();
}
});
```
使用 RxJS
```js
import { fromEvent, throttleTime, scan
} from 'rxjs';
fromEvent(document, 'click')
.pipe(throttleTime(1000),
scan((count) => count + 1, 0)
)
.subscribe((count) => {
console.log(`Clicked ${count} times`)
});
```
### 第一个示例
通常情况下,您需要注册事件监听器。
```js
document.addEventListener('click', () => {
console.log('Clicked!')
});
```
使用 [RxJS](https://rxjs.dev/),您可以创建一个可观察对象。
```js
import { fromEvent } from 'rxjs';
fromEvent(document, 'click')
.subscribe(() => {
console.log('Clicked!')
});
```
### 导入所需的 Observable 和操作符
<!--rehype:wrap-class=col-span-2-->
```javascript
import { Observable, of, from, interval, fromEvent } from 'rxjs';
import { map, filter, switchMap, mergeMap, catchError, debounceTime,
distinctUntilChanged, take, tap, concatMap, delay, retryWhen, scan,
combineLatest, concat, merge, forkJoin, withLatestFrom, startWith, reduce
} from 'rxjs/operators';
```
## 创建 Observable
### of
```javascript
const obs = of(1, 2, 3);
obs.subscribe(console.log);
// 输出: 1 2 3
```
创建一个立即发送指定值并完成的 `Observable`
### from
```javascript
const obs = from([1, 2, 3]);
obs.subscribe(console.log);
// 输出: 1 2 3
```
从 Promise、数组、可迭代对象创建 `Observable`
### interval
```javascript
const obs = interval(1000);
obs.subscribe(console.log);
// 每秒输出一次递增的数字
```
创建一个定时发送递增整数的 `Observable`
### fromEvent
<!--rehype:wrap-class=col-span-2-->
```javascript
const button = document.querySelector('button');
const obs = fromEvent(button, 'click');
obs.subscribe(event => {
console.log('Button clicked!', event)
});
```
从 DOM 事件创建 `Observable`
## 操作符
### map
```javascript
const obs = of(1, 2, 3).pipe(
map(x => x * 2)
);
obs.subscribe(console.log);
// 输出: 2 4 6
```
`Observable` 发出的每个值应用一个函数
### filter
```javascript
const obs = of(1, 2, 3).pipe(
filter(x => x % 2 === 0)
);
obs.subscribe(console.log);
// 输出: 2
```
过滤 `Observable` 发出的值
### switchMap
```javascript
const obs = interval(1000).pipe(
switchMap(() => of('Hello'))
);
obs.subscribe(console.log);
// 每秒输出一次 "Hello"
```
`Observable` 每个值映射成 `Observable` 并订阅,前一个订阅将被取消
### mergeMap
```javascript
const obs = interval(1000).pipe(
mergeMap(() => of('Hello'))
);
obs.subscribe(console.log);
// 每秒输出一次 "Hello"
```
类似 `switchMap`,但允许多个内部 `Observable` 并发执行
### catchError
```javascript
const obs = of(1, 2, 3).pipe(
map(x => {
if (x === 2) throw 'Error!';
return x;
}),
catchError(err => of('发现一个错误:'+err))
);
obs.subscribe(console.log);
// 输出: 1 发现一个错误Error!
```
捕获 `Observable` 链中的错误
### debounceTime
```javascript
const obs = fromEvent(document,'mousemove')
.pipe(debounceTime(300));
obs.subscribe(event => {
console.log('Mouse moved!', event)
});
```
延迟处理,直到源 `Observable` 停止发出数据一定时间
### distinctUntilChanged
```javascript
const obs = of(1, 1, 2, 2, 3, 3).pipe(
distinctUntilChanged()
);
obs.subscribe(console.log);
// 输出: 1 2 3
```
忽略连续重复的值
### take
```javascript
const obs = interval(1000).pipe(
take(3)
);
obs.subscribe(console.log);
// 输出: 0 1 2
```
只发出前 n 个值
## 组合操作符
### combineLatest
```javascript
const obs1 = interval(1000);
const obs2 = of('A', 'B', 'C');
const combined = combineLatest(
[obs1, obs2]
);
combined.subscribe(console.log);
// 每秒输出一次两个 observables 的最新值
```
当两个 `Observable` 都发出新的值时,发出它们的组合
### concat
```javascript
const obs1 = of(1, 2, 3);
const obs2 = of(4, 5, 6);
const combined = concat(obs1, obs2);
combined.subscribe(console.log);
// 输出: 1 2 3 4 5 6
```
按顺序连接多个 `Observable`
### merge
```javascript
const obs1 = interval(1000).pipe(
map(x => 'A' + x)
);
const obs2 = interval(500).pipe(
map(x => 'B' + x)
);
const combined = merge(obs1, obs2);
combined.subscribe(console.log);
// 每秒输出 "A" 和 "B" 开头的递增数字
```
将多个 `Observable` 合并为一个
### forkJoin
```javascript
const obs1 = of(1, 2, 3);
const obs2 = of('A', 'B', 'C');
const combined = forkJoin([obs1, obs2]);
combined.subscribe(console.log);
// 输出: [3, 'C']
```
等待所有 `Observable` 完成,然后发出它们的最后一个值的数组
## 错误处理
### retryWhen
<!--rehype:wrap-class=col-span-2-->
```javascript
const obs = throwError('出了些问题!')
.pipe(
retryWhen(errors =>
errors.pipe(delayWhen(() => interval(1000)))
)
);
obs.subscribe(console.log, console.error);
// 输出: 出了些问题! (每秒重试一次)
```
`Observable` 发出错误时重试
## 实用操作符
### tap
```javascript
const obs = of(1, 2, 3).pipe(
tap(x => console.log(`Before: ${x}`)),
map(x => x * 2),
tap(x => console.log(`After: ${x}`))
);
obs.subscribe();
// 输出: Before: 1, After: 2, Before: 2,
// After: 4, Before: 3, After: 6
```
用于记录、测量或执行副作用操作
### startWith
```javascript
const obs = of(1, 2, 3).pipe(
startWith(0)
);
obs.subscribe(console.log);
// 输出: 0 1 2 3
```
`Observable` 序列前添加值
### scan
```javascript
const obs = of(1, 2, 3).pipe(
scan((acc, value) => acc + value, 0)
);
obs.subscribe(console.log);
// 输出: 1 3 6
```
`Observable` 发出的每个值应用累加器函数
### reduce
<!--rehype:wrap-class=col-span-2-->
```javascript
const obs = of(1, 2, 3).pipe(reduce((acc, value) => acc + value, 0));
obs.subscribe(console.log);
// 输出: 6
```
`Observable` 发出的值进行累加
### delay
```javascript
const obs = of('Hello').pipe(delay(2000));
obs.subscribe(console.log);
// 输出: 'Hello' (延迟2秒)
```
延迟 `Observable` 发出数据的时间
调度器
---
### 调度器说明
调度器Scheduler控制着 RxJS 操作的执行时机。常见的调度器有:
- `asyncScheduler`:异步执行任务
- `queueScheduler`:按队列顺序执行任务
- `animationFrameScheduler`:在浏览器的下一次重绘前执行任务
### 示例
<!--rehype:wrap-class=col-span-2-->
```javascript
const obs = of(1, 2, 3).pipe(observeOn(asyncScheduler));
console.log('Before subscribe');
obs.subscribe(console.log);
console.log('After subscribe');
// 输出: Before subscribe, After subscribe, 1, 2, 3
```
## 另见
- [RxJS 官方文档](https://rxjs.dev/)
- [RxJS 学习资源](https://rxjs.dev/guide/overview)
- [RxJS 操作符参考](https://rxjs.dev/guide/operators)

389
docs/sdkman.md Normal file
View File

@@ -0,0 +1,389 @@
SDKMAN 备忘清单
====
[SDKMAN](http://sdkman.io) 是一款管理 java 体系中的各类 SDK 版本的工具,可以用于大多数基于 Uinx 的系统
入门
---
### 安装
macOS/Linux
```bash
curl -s "https://get.sdkman.io" \| bash
```
Windows 需要 (WSL Approach) 或者 (Git Bash Approach)
```bash
curl -s "https://get.sdkman.io" \| bash
```
初始化 SDKMAN
```bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
```
查看 sdkman 是否安装成功
```bash
$ sdk version
```
### 获取帮助
您可以通过运行以下命令获得基本帮助:
```bash
$ sdk help
```
这将提供一个有用的顶级帮助页面。您可以向该命令添加限定符以获得有关特定子命令的帮助
```bash
$ sdk help install
```
### 查看
列出所有可用的 SDKs
```bash
sdk list
```
查看当前使用的 SDK
```bash
$ sdk current
```
查看特定 SDK 的版本列表例如Java
```bash
$ sdk list java
```
### 安装卸载
<!--rehype:wrap-class=row-span-2-->
安装特定版本的 SDK例如Java
```bash
$ sdk install java <version>
```
使用已安装的 SDK例如Java
```bash
$ sdk use java <version>
```
使用已安装的 SDK例如Java
```bash
$ sdk use java <version>
```
卸载 SDK例如Java
```bash
$ sdk uninstall java <version>
```
列出所有已安装的 SDKs
```bash
$ sdk list installed
```
删除一个指定版本
```bash
$ sdk uninstall scala 3.4.1
```
### 更新
更新 SDKMAN 自身
```bash
$ sdk selfupdate
```
更新已安装的 SDKs
```bash
$ sdk update
```
设置默认的 SDK 版本例如Java
```bash
$ sdk default java <version>
```
### 帮助
查看 SDKMAN 所有可用的命令
```bash
$ sdk help
```
这些命令可以帮助你安装、管理和使用不同版本的 SDK如 Java、Groovy、Gradle、Maven 等。
### 安装本地版本
使用快照版本?已经在本地安装了吗?通过指定本地安装的路径来安装本地版本:
```bash
$ sdk install groovy 3.0.0-SNAPSHOT /path/to/groovy-3.0.0-SNAPSHOT
```
<!--rehype:className=wrap-text-->
```bash
$ sdk install java 17-zulu /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
```
<!--rehype:className=wrap-text-->
### 使用版本
查看已安装的 SDKs**
```bash
$ sdk list installed
```
切换使用特定版本的 SDK例如Java
```bash
$ sdk use java <version>
$ sdk use scala 3.4.1
```
设置默认使用的 SDK 版本例如Java
```bash
$ sdk default java <version>
$ sdk default scala 3.4.1
```
### 查看当前使用的版本
要查 sdk 当前使用的版本:
```shell
$ sdk current java
Using java version 21.0.2-tem
```
要查看所有 sdk 当前使用的版本:
```shell
$ sdk current
Using:
groovy: 4.0.20
java: 21.0.2-tem
scala: 3.4.1
```
### 配置 ENV
<!--rehype:wrap-class=row-span-3-->
切换到特定的 JDK 或 SDK通过项目基本目录中的 `.sdkmanrc` 文件来实现。执行下面命令自动生配置文件:
```bash
$ sdk env init
```
现在已经在当前目录中创建了一个包含以下内容的配置文件:
```shell
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=21.0.2-tem
```
<!--rehype:className=wrap-text-->
切换到 `.sdkmanrc`文件中的配置,只需发出以下命令:
```bash
$ sdk env
# 您应该看到如下输出:
# Using java version 21.0.2-tem in this shell.
```
<!--rehype:className=wrap-text-->
通过下面命令,将 SDK 重置为默认版本
```shell
$ sdk env clear
```
安装 `.sdkmanrc` 配置文件中指定丢失的 SDK
```shell
$ sdk env install
```
在 cd 到目录中时自动切换 SDK 版本,可以通过在 sdkman 配置中设置 `sdkman_auto_env=true` 来实现。请注意这也会在离开目录时将任何特定于项目的SDK重置为默认版本。
### 升级版本
升级特定 SDK 到最新版本
```shell
$ sdk upgrade springboot
```
要查看所有 SDK 的过时内容:
```shell
$ sdk upgrade
```
### SDKMAN 版本
```shell
$ sdk version
SDKMAN!
script: 5.7.0
native: 0.1.3
```
### 自动更新
安装新版本的 `SDKMAN` 如果可用
```bash
$ sdk selfupdate
```
通过将 force 参数传递给命令强制重新安装:
```bash
$ sdk selfupdate force
```
自动每日检查新版本的SDKMAN也将代表用户执行。
### Home
获取 SDK 所在位置的绝对路径
```shell
$ sdk home java 21.0.2-tem
# /home/myuser/.sdkman/candidates/java/21.0.2-tem
```
<!--rehype:className=wrap-text-->
### Flush
应该很少需要刷新 `SDKMAN` 。flush 命令有助于实现这一点,因此您不需要删除任何目录。
```bash
$ sdk flush
```
手动删除像 `.sdkman/tmp` 目录这样的目录会破坏 sdkman请始终使用 flush 命令!
### 离线模式
启用强制脱机模式
```shell
$ sdk offline enable
```
重新启用联机模式
```shell
$ sdk offline disable
```
离线模式下显示当前安装的和活动的版本:
```shell
$ sdk list groovy
# ---------------------------
#
# 离线模式仅显示已安装的groovy版本
# --------------------------
# >
# > 2.4.4
#
# - 2.4.3
#
# --------------------------
#
# - - installed
# >
# > - currently in use
# >
# ---------------------------
```
当互联网可用/不可用时,离线模式也将自动禁用/启用。当然,需要互联网连接的命令不会起作用,但会发出警告。
### 更新
当 SDK 元数据可能变得过时时,会显示一条警告,并说明如何更新。
```shell
WARNING: SDKMAN is out-of-date and requires an update.
```
<!--rehype:className=wrap-text-->
只需运行以下命令,就可以刷新 SDK 缓存,并且可以安装新的 SDK 缓存:
```shell
$ sdk update
# Adding new candidates(s): kotlin
```
<!--rehype:className=wrap-text-->
定期更新 `SDKMAN` 需要更新以了解新的或已删除的SDK。
### 配置
可以在 `~/.sdkman/etc/config` 文件中找到配置。要编辑配置,可以发出 `sdk-config` 命令在系统编辑器中编辑此文件。以下配置可用:
```ini
# 使 sdkman 成为非交互式的,适用于 CI 环境
sdkman_auto_answer=true|false
# 检查更新版本并提示更新
sdkman_selfupdate_feature=true|false
# 禁用 SSL 证书验证
# https://github.com/sdkman/sdkman-cli/issues/327
# HERE BE DRAGONS....
sdkman_insecure_ssl=true|false
# 配置 curl 超时
sdkman_curl_connect_timeout=5
sdkman_curl_continue=true
sdkman_curl_max_time=10
# 订阅测试版频道
sdkman_beta_channel=true|false
# 启用详细调试
sdkman_debug_mode=true|false
# 启用色彩模式
sdkman_colour_enable=true|false
# 启用自动环境
sdkman_auto_env=true|false
# 启用 bash 或 zsh 自动完成功能
sdkman_auto_complete=true|false
```
<!--rehype:className=wrap-text-->

View File

@@ -6,129 +6,230 @@ Sketch 备忘清单
快捷键
---
### 插入
### 常规
<!--rehype:wrap-class=row-span-3-->
| 快捷键 | 描述 |
| ----- | ---- |
| `a` | (New Artboard) 新画板 |
| `s` | (Slice) 切片 |
| `r` | (Rectangle) 长方形 |
| `d` | (Rounde) 圆形 |
| `u` | (Rectangle) 长方形 |
| `o` | (Oval) 椭圆形 |
| `l` | (Line) 线 |
| `v` | (Vector Point) 向量点 |
| `p` | (Pencil) 铅笔 |
| `t` | (Text) 文本 |
<!--rehype:className=shortcuts-->
快捷键 | 操作
---|---
`Cmd` `C` | 复制
`Cmd` `X` | 剪切
`Cmd` `V` | 粘贴
`Cmd` `Shift` `V` | 覆盖选择粘贴
`Space` `(拖动)` | 平移画布
`Cmd` `Shift` `N` | 新建页面
`Fn` `Up` | 上一页
`Fn` `Down` | 下一页
`Cmd` `+` | 放大
`Cmd` `-` | 缩小
`Ctrl` `R` | 切换标尺
`Ctrl` `P` | 切换像素
`Ctrl` `X` | 切换像素网格
`Ctrl` `G` | 切换网格
`Ctrl` `L` | 切换布局
`Ctrl` `E` | 切换切片
`Ctrl` `F` | 切换原型设计
`Cmd` `F` | 在图层列表中过滤
`Cmd` `Ctrl` `K` | 运行自定义插件
`Cmd` `Z` | 撤销
`Cmd` `Shift` `Z` | 重做
`Cmd` `N` | 新建文档
`Cmd` `Shift` `N` | 新建云文档
`Cmd` `O` | 打开文档
`Cmd` `Shift` `O` | 打开云文档
`Cmd` `W` | 关闭窗口
`Cmd` `S` | 保存文档
`Cmd` `Shift` `S` | 复制文档
`Cmd` `Shift` `Opt` `S` | 另存为...
`Cmd` `Shift` `P` | 页面设置
`Cmd` `,` | 打开首选项窗口
`Cmd` `H` | 隐藏 Sketch
`Cmd` `Q` | 退出 Sketch
`Cmd` `Shift` `?` | 打开帮助菜单
`Cmd` `P` | 打开预览窗口
<!--rehype:className=left-align shortcuts-->
### 类型
<!--rehype:wrap-class=row-span-2-->
### 插入图层
| 快捷键 | 类型 |
| ----- | ---- |
| `Cmd + B` | 加粗 |
| `Cmd + I` | 斜体 |
| `Cmd + U` | 下划线 |
| `Alt + Cmd (+) +` | 增加字体大小 |
| `Alt + Cmd (+) ` | 减小字体大小 |
| `Alt + Control + L` | 增加字符间距 |
| `Alt + Control + T` | 减少字符间距 |
| `Cmd + T` | 更改字体 |
| `Shift + Cmd + O` | 将文本转换为轮廓 |
| `Cmd + Shift + {` | 左对齐 |
| `Cmd + Shift + \` | 居中对齐 |
| `Cmd + Shift + }` | 右对齐 |
| `Control + Cmd + Space` | 特殊字符 |
<!--rehype:className=shortcuts-->
快捷键 | 操作
---|---
`R` | 矩形
`O` | 椭圆
`L` | 直线
`U` | 圆角矩形
`V` | 矢量工具
`P` | 铅笔工具
`T` | 文本工具
`A` | 画板工具
`S` | 切片工具
`H` | 热点工具
<!--rehype:className=left-align shortcuts-->
### 画布视图
### 选择图层
<!--rehype:wrap-class=row-span-2-->
快捷键 | 操作
---|---
`Cmd` `A` | 全选
`Cmd` `Shift` `A` | 选择所有画板
`Fn` `Right` | 选择下一个画板
`Fn` `Left` | 选择上一个画板
`Cmd` `Shift` `J` | 在图层列表中显示所选内容
<!--rehype:className=left-align shortcuts-->
| 画布视图 | 快捷键 |
| ----- | ---- |
| `Cmd (+) +` | 放大 |
| `Cmd (+) -` | 缩小 |
| `Cmd + 0` | 实际尺寸 |
| `Cmd + 1` | 中心画布 |
| `Cmd + 2` | 缩放选择 |
| `Cmd + 3` | 中心选择 |
| `§` | 临时缩放到实际大小 |
| `Alt + Tab` | 关注第一个输入字段 |
| `Control + R` | 切换标尺 |
| `Control + G` | 切换网格 |
| `Control + L` | 切换图层指南 |
| `Control + P` | 切换像素 |
| `Control + H` | 切换选择手柄 |
| `Control + X` | 切换像素网格 |
| `Space + Drag` | 移动画布 |
<!--rehype:className=shortcuts-->
### 移动和调整图层大小
### 窗口
| 快捷键 | Window |
| ----- | ---- |
| `Cmd + ~` | 在文档之间切换 |
| `Alt + Cmd + 1` | 切换层列表 |
| `Alt + Cmd + 2` | 切换检查器 |
| `Alt + Cmd + 3` | 切换图层、检查器 |
| `Alt + Cmd + T` | 切换工具栏 |
| `Cmd + .` | 演示模式 |
| `Control + Cmd + F` | 进入全屏 |
<!--rehype:className=shortcuts-->
### 编辑形状
| 编辑形状 | 快捷键 |
| ----- | ---- |
| `Cmd + Alt` | 保留当前选择 |
| `Control + Cmd + M` | 用作蒙版跨度`(适用于图层和组)` |
| `Alt + Cmd + U` | 联盟 |
| `Alt + Cmd + S` | 减去 |
| `Alt + Cmd + I` | 相交 |
| `Alt + Cmd + X` | 区别 |
| `Cmd + Arrows` | 更改对象大小 |
| `Shift + Cmd + Arrows` | 将单位更改 10 |
| `1, 2, 3, 4` | 更改矢量点样式 |
<!--rehype:className=shortcuts-->
快捷键 | 操作
---|---
`Opt` | 显示到其他图层的距离(悬停时)
`Cmd` `D` | 复制
`(箭头键)` | 将图层向任何方向微调1像素
`Shift` `(箭头键)` | 将图层向任何方向微调10像素
`Cmd` `K` | 缩放图层
`Cmd` `Right/Down` | 增加1像素
`Cmd` `Left/Up` | 减少1像素
`Cmd` `Shift` `Right/Down` | 增加10像素
`Cmd` `Shift` `Left/Up` | 减少10像素
`Ctrl` `Opt` | 在文本图层上显示基线或大写字母高度的距离(悬停时)
<!--rehype:className=left-align shortcuts-->
### 编辑图层
<!--rehype:wrap-class=row-span-2-->
| 快捷键 | 编辑图层 |
| ----- | ---- |
| `Alt` | 显示到其他图层的距离 |
| `Alt + Cmd` | 显示到组内其他图层的距离 |
| `Alt + Drag` | 复制(用 ⌘D 重复) |
| `Alt + Cmd + C` | 复制样式 |
| `Alt + Cmd + V` | 粘贴样式 |
| `Control + C` | 选色器 |
| `Cmd + T` | 转换 |
| `Shift + Cmd + R` | 旋转 |
| `F` | 切换填充 |
| `B` | 切换边框 |
<!--rehype:className=shortcuts-->
快捷键 | 操作
---|---
`Enter` | 编辑图层
`Esc` | 完成编辑
`Opt` `Tab` | 聚焦检查器中的X位置输入字段
`Del` | 删除图层
`Cmd` `Opt` `C` | 复制样式
`Cmd` `Opt` `V` | 粘贴样式
`Ctrl` `S` | 同步共享样式
`Opt` `Ctrl` `S` | 重置共享样式
`W` | 为画板添加链接
`F` | 切换填充
`B` | 切换边框
`Ctrl` `C` | 选择颜色
`0-9` | 编辑图层不透明度
`Cmd` `Shift` `T` | 变换形状
`Cmd` `Shift` `R` | 旋转图层
`Cmd` `Ctrl` `M` | 用作蒙版
`Cmd` `Esc` | 返回实例
`Cmd` `Opt` `U` | 合并多个图层
`Cmd` `Opt` `S` | 减去多个图层
`Cmd` `Opt` `I` | 与多个图层相交
`Cmd` `Opt` `X` | 差异多个图层
<!--rehype:className=left-align shortcuts-->
### 排列图层、组和画板
### 矢量编辑
| 排列图层、组和画板 | 快捷键 |
| ----- | ---- |
| `Alt + Cmd + ↑` | 向前进 |
| `Control + Alt + Cmd + ↑` | 带到前面 |
| `Alt + Cmd + ↓` | 向后发送 |
| `Control + Alt + Cmd + ↓` | 送回 |
| `Shift + Cmd + H` | 隐藏 |
| `Shift + Cmd + L` | 锁 |
| `Cmd + R` | 改名 |
| `Cmd + G` | 图层组 |
| `Shift + Cmd + G` | 取消组合图层 |
| `Shift + Tab` | 选择上层 |
| `Tab` | 选择下面的图层 |
| `Esc` | 选择父画板 |
| `Cmd + F` | 按名称查找图层 |
| `Fn + ↑` | 选择上方页面 |
| `Fn + ↓` | 选择下面的页面 |
<!--rehype:className=shortcuts-->
快捷键 | 操作
---|---
`Cmd` `Opt` `O` | 打开或关闭路径
`Tab` | 选择下一个点
`Opt` | 显示所有控制点
`1` | 直线点类型
`2` | 镜像点类型
`3` | 断开连接的点类型
`4` | 非对称点类型
<!--rehype:className=left-align shortcuts-->
### 文本编辑
<!--rehype:wrap-class=row-span-2-->
快捷键 | 操作
---|---
`Cmd` `Shift` `Opt` `V` | 以富文本方式粘贴
`Cmd` `T` | 更改字体
`Cmd` `B` | 粗体
`Cmd` `I` | 斜体
`Cmd` `U` | 下划线
`Cmd` `Opt` `+` | 增大字体大小
`Cmd` `Opt` `-` | 减小字体大小
`Ctrl` `Opt` `L` | 增大字符间距
`Ctrl` `Opt` `T` | 减小字符间距
`Cmd` `Shift` `[` | 左对齐
`Cmd` `Shift` `\` | 居中对齐
`Cmd` `Shift` `]` | 右对齐
`Cmd` `Opt` `Space` | 表情符号和符号
`Cmd` `Opt` `O` | 转换为轮廓
`Shift` `Enter` | 插入换行符
<!--rehype:className=left-align shortcuts-->
### 排列图层
<!--rehype:wrap-class=row-span-2-->
快捷键 | 操作
---|---
`Cmd` `G` | 分组
`Cmd` `Shift` `G` | 解组
`Cmd` `R` | 重命名图层
`Tab` | 在组内选择下一图层
`Shift` `Tab` | 在组内选择上一图层
`Enter` | 在组内选择图层
`Esc` | 选择父组
`Cmd` `]` | 上移一层
`Cmd` `Opt` `]` | 移至顶层
`Cmd` `[` | 下移一层
`Cmd` `Opt` `[` | 移至底层
`Cmd` `Shift` `Opt` `Up` | 向上移动,移出组或画板
`Cmd` `Ctrl` `H` | 水平分布
`Cmd` `Ctrl` `V` | 垂直分布
`Cmd` `Shift` `H` | 隐藏或显示图层
`Cmd` `Shift` `L` | 锁定或解锁图层
<!--rehype:className=left-align shortcuts-->
### 导出图层
快捷键 | 操作
---|---
`Cmd` `Shift` `E` | 导出
`Cmd` `E` | 导出选定的图层
<!--rehype:className=left-align shortcuts-->
### 缩放和焦点
快捷键 | 操作
---|---
`Cmd` `0` | 缩放至100%
`Cmd` `1` | 缩放至画布上的所有元素
`Cmd` `2` | 缩放至选定的图层
`Cmd` `3` | 将选定的图层居中于画布
`Shift` <code>\`</code> | 临时缩小至100%
`Cmd` `Ctrl` `F` | 切换全屏
`Cmd` `Opt` `1` | 显示或隐藏图层列表
`Cmd` `Opt` `2` | 显示或隐藏检查器
`Cmd` `.` | 进入演示模式
`Cmd` `Opt` `T` | 显示或隐藏工具栏
<!--rehype:className=left-align shortcuts-->
### 文本字段
快捷键 | 操作
---|---
`Opt` `Tab` | 聚焦检查器
`Tab` | 选择下一字段
`Shift` `Tab` | 选择上一字段
`Enter` | 确认更改
`Esc` | 清除更改
`Up` | 将值增加1
`Down` | 将值减少1
`Shift` `Up` | 将值增加10
`Shift` `Down` | 将值减少10
`Opt` `Up` | 将值增加0.1
`Opt` `Down` | 将值减少0.1
<!--rehype:className=left-align shortcuts-->
### 杂项
快捷键 | 操作
---|---
`Shift` | 以禁用所有插件的状态启动 Sketch启动时按住
`Cmd` `Ctrl` `D` | 从符号分离
`Cmd` `Ctrl` `Opt` `D` | 从符号分离所有内容
`Cmd` `Shift` `D` | 刷新数据
`Cmd` `Ctrl` `R` | 再次运行上次使用的插件
`0-9` | 选择渐变停止点后将其定位在0%和100%之间
`=` | 将选定的渐变停止点直接定位在两个现有停止点之间
<!--rehype:className=left-align shortcuts-->
另见
----

636
docs/springboot.md Normal file
View File

@@ -0,0 +1,636 @@
Spring Boot 备忘清单
===
此快速参考备忘单提供了使用 Spring Boot 的用法
注:开发 springboot 需要要基本的 java 基础和 maven 基础。
入门
---
### 介绍
Spring Boot 是一个用于简化 Spring 应用程序开发的框架。它提供了一种简单的方式来创建、运行和部署 Spring 应用程序,并简化了配置和依赖管理。
### 项目创建与配置
<!--rehype:wrap-class=col-span-2-->
- 使用 [`Spring Initializr`](https://start.spring.io) 创建项目
- 国内可以使用阿里云的 [`Spring Initializr`](https://start.aliyun.com/) 创建项目选择依赖项如Web、JPA、Security和 Spring Boot 版本
- 添加所需的依赖项到 `pom.xml`(Maven) 或 `build.gradle`(Gradle) 文件中
-`src/main/resources` 目录下创建 `application.properties``application.yml` 文件,配置应用程序属性,例如数据库连接信息、端口号等
配置
---
### 配置文件说明
<!--rehype:wrap-class=row-span-2-->
在Spring Boot应用程序中通常使用YAML格式`.yml`文件)来配置应用程序的属性和设置。相比于传统的`.properties`文件YAML格式更加清晰易读并且支持层级结构和列表等复杂数据类型。以下是一些常用的Spring Boot YAML配置字段及其说明
- `server.port`: 配置应用程序的端口号。
- `spring.application.name`: 配置应用程序的名称。
- `spring.datasource.url`: 配置数据库连接的URL。
- `spring.datasource.username`: 配置数据库连接的用户名。
- `spring.datasource.password`: 配置数据库连接的密码。
- `logging.level`: 配置日志记录的级别,如`DEBUG``INFO``WARN``ERROR`等。
- `management.endpoints.web.exposure.include`: 配置哪些管理端点(如`health``info`可以通过Web访问。
- `spring.jpa.hibernate.ddl-auto`: 配置Hibernate的DDL模式`update``create``create-drop`等。
### 1. 应用程序配置
```yaml
spring:
application:
name: my-application
```
`spring.application.name`: 应用程序的名称。在集成服务发现和配置管理时特别有用也会影响Actuator端点的路径。
### 2. 服务器端口配置
```yaml
server:
port: 8080
```
`server.port`: 应用程序监听的HTTP端口号。默认为8080可以根据需要进行配置。
### 3. 数据源配置
<!--rehype:wrap-class=col-span-2-->
```yaml
spring:
datasource:
url: jdbc:mysql://localhost:3306/mydatabase
username: root
password: password
driver-class-name: com.mysql.cj.jdbc.Driver
```
#### 说明
- `spring.datasource.url`: 数据库连接URL。
- `spring.datasource.username``spring.datasource.password`: 数据库的用户名和密码。
- `spring.datasource.driver-class-name`: 数据库驱动类名。
### 4. **JPA 配置**
```yaml
spring:
jpa:
show-sql: true
hibernate:
ddl-auto: update
```
#### 说明
- `spring.jpa.show-sql`: 是否在控制台显示SQL语句。
- `spring.jpa.hibernate.ddl-auto`: Hibernate自动建表策略`update``create``validate`等。
### 5. 日志配置
```yaml
logging:
level:
org.springframework: INFO
com.example: DEBUG
```
#### 说明
- `logging.level`: 日志级别配置,可以针对不同的包或类设置不同的日志级别。
### 6. Spring Security 配置
```yaml
spring:
security:
user:
name: user
password: password
basic:
enabled: true
```
#### 说明
- `spring.security.user.name``spring.security.user.password`: 基本认证的用户名和密码。
- `spring.security.basic.enabled`: 是否启用基本认证。
### 7. Actuator 配置
```yaml
management:
endpoints:
web:
exposure:
include: health, info
```
#### 说明
- `management.endpoints.web.exposure.include`: 暴露给外部的Actuator端点可以设置为`*`来暴露所有端点。
### 8. 多环境配置
```yaml
spring:
profiles:
active: dev
```
#### 说明
- `spring.profiles.active`: 指定当前激活的环境配置文件,可以根据需要选择`dev``prod`等不同的配置文件。
### 9. **自定义属性配置**
```yaml
myapp:
custom:
property: value
```
#### 说明
- 自定义应用程序属性,可以在应用程序中通过`@Value`注解或`Environment`对象访问。
依赖管理
---
### 依赖管理介绍
- 在 Spring Boot 中,依赖管理是非常重要的一部分。
- 它通过简化依赖项的引入和版本管理,大大简化了项目的构建和维护过程。
- Spring Boot采用了 Starter 依赖项的概念,通过提供预配置的依赖项集合来简化项目的初始化和配置。
### Starter 依赖项
<!--rehype:wrap-class=row-span-2 col-span-2-->
Spring Boot 的 Starter 依赖项是预先配置的一组依赖项集合,它们以 `spring-boot-starter-*` 的命名格式提供。这些 Starter 依赖项可以按照功能领域进行分类,例如:
- `spring-boot-starter-web`: 支持构建Web应用程序包括Spring MVC和内嵌的Servlet容器如Tomcat
- `spring-boot-starter-data-jpa`: 支持使用Spring Data JPA访问数据库包括Hibernate和JPA实现。
- `spring-boot-starter-security`: 支持Spring Security用于身份验证和授权。
- `spring-boot-starter-test`: 支持单元测试和集成测试包括JUnit、Mockito等。
- `spring-boot-starter-actuator`: 支持集成Actuator用于监控和管理应用程序。
引入Starter依赖项可以快速添加特定功能Spring Boot会自动配置所需的组件和设置减少手动配置工作量。
### 自动依赖解析和版本管理
<!--rehype:wrap-class=row-span-2-->
Spring Boot的BOMBill of Materials集中管理各个 Starter 依赖项的版本,通过在`pom.xml`Maven`build.gradle`Gradle中引入 BOM可以简化依赖项版本管理。例如在 Maven 项目中:
```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.6.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
```
这样一来,当你在项目中引入 Spring Boot 的 Starter 依赖项时不需要显式声明版本号Maven 会自动使用 BOM 中指定的版本。
### 自定义依赖管理
尽管Spring Boot提供了丰富的Starter依赖项和依赖管理功能但有时你可能需要自定义特定的依赖项或版本。在这种情况下你可以在`pom.xml``build.gradle`中显式声明所需的依赖项而不使用Starter依赖项。
例如在Maven项目中你可以这样声明一个依赖项
```xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.6.0</version>
</dependency>
```
这样做可以覆盖Spring Boot BOM中指定的版本允许你使用特定版本的依赖项。
### 排除和冲突解决
在实际项目中可能会遇到依赖项之间的冲突或不兼容性问题。Spring Boot允许你通过`<exclusions>`标签来排除Starter依赖项中的某些传递性依赖以解决冲突问题。
例如在Maven项目中排除传递性依赖
```xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
```
这种排除机制使得你可以更精确地控制项目中依赖项的版本和组合,以避免不必要的冲突。
Spring Boot 核心功能
---
<!--rehype:body-class=cols-2-->
### 依赖注入Dependency Injection
依赖注入是Spring框架的核心概念之一它通过控制反转IoCInversion of Control的方式管理对象之间的依赖关系从而实现松耦合、可测试和可维护的代码结构。Spring Boot通过自动配置的方式支持依赖注入以下是一些关键点
#### 自动装配Auto-configuration
Spring Boot根据类路径中的依赖项自动配置应用程序上下文。这包括自动扫描和注册带有特定注解`@Component``@Service``@Repository`的Bean以及自动解析和注入这些Bean之间的依赖关系。
#### Bean的声明和管理
开发者可以使用`@Autowired`注解在需要依赖注入的地方注入其他BeanSpring Boot会自动解析和注入所需的依赖。例如
```java
@RestController
public class MyContr {
private final MyService myService;
@Autowired
public MyContr(MyService myService) {
this.myService = myService;
}
// Controller methods
}
```
在上面的例子中,`MyController`中的`MyService`依赖通过构造函数注入。
#### 条件化注入
Spring Boot支持根据条件选择性地注入Bean。例如可以使用 `@Conditional` 注解或 `@ConditionalOnProperty` 注解根据特定的条件决定是否创建和注入Bean。
### 面向切面编程Aspect-Oriented Programming
面向切面编程是一种软件开发方法用于分离横切关注点cross-cutting concerns例如日志、事务管理、安全性等以便更好地模块化和管理应用程序。Spring Boot通过整合Spring AOP框架支持面向切面编程以下是相关的说明
#### 切面Aspect
切面是一个模块化的类它包含了横切关注点的逻辑。在Spring Boot中可以使用`@Aspect`注解标记一个类作为切面,并通过`@Before``@After``@Around`等注解定义切面的具体行为。
#### 切点Pointcut
切点定义了在应用程序中哪些位置应用切面逻辑。切点表达式使用`execution`关键字指定要拦截的方法调用。例如:
```java
@Aspect
@Component
public class LoggingAspect {
@Before("execution(* com.example.service.*.*(..))")
public void beforeServiceMethods(JoinPoint joinPoint) {
// Advice logic before service method execution
}
// Other advices (e.g., @After, @Around) can be defined similarly
}
```
#### 通知Advice
通知是在切点处执行的具体逻辑,包括`@Before``@AfterReturning``@AfterThrowing``@Around`等。例如,在上面的例子中,`beforeServiceMethods`方法就是一个`@Before`通知,它在目标方法执行之前执行。
#### 配置和启用
Spring Boot通过自动配置和注解扫描使得使用AOP变得非常简单。通常情况下只需在切面类上加上`@Aspect`注解并确保它被Spring Boot的组件扫描机制扫描到即可。
Web 开发
---
### 1. 创建一个新的 Spring Boot 项目
<!--rehype:wrap-class=row-span-3-->
你可以使用 Spring Initializr 创建一个新的 Spring Boot 项目。访问 [start.spring.io](https://start.spring.io/) 并按照以下配置创建项目:
- **Project**: Maven 或 Gradle选择你的构建工具
- **Language**: Java
- **Spring Boot**: 选择最新的稳定版本
- **Project Metadata**:
- **Group**: com.example或者你喜欢的 Group ID
- **Artifact**: helloworld或者你喜欢的 Artifact ID
- **Dependencies**: 选择 "Spring Web"
点击 "Generate" 下载项目的 zip 文件。
### 2. 将项目导入到你的 IDE 中
解压下载的文件并导入到你喜欢的 IDE 中(如 IntelliJ IDEA、Eclipse 等)。
### 3. 实现 Hello World Controller
<!--rehype:wrap-class=row-span-3-->
在 IDE 中打开你的项目,导航到 `src/main/java/com/example/helloworld`。你会看到一个名为 `HelloworldApplication.java` 的类文件,这是 Spring Boot 应用程序的入口类。
在这个类的同级目录下创建一个新的 Java 类文件,例如 `HelloController.java`,并添加以下内容:
```java
package com.example.helloworld;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@GetMapping("/")
public String hello() {
return "Hello, World!";
}
}
```
### 4. 运行应用程序
使用 Maven 或 Gradle 构建项目并启动应用程序。可以通过 IDE 的运行功能或者命令行执行以下命令:
```bash
mvn spring-boot:run
```
或者
```bash
./gradlew bootRun
```
### 5. 访问 Hello World 页面
在浏览器中访问 `http://localhost:8080/`,你应该能够看到显示 "Hello, World!" 的页面。
这样,你就成功创建了一个简单的 Spring Boot Web 应用程序,并实现了一个基本的 "Hello, World!" 示例。
## **数据访问**
### 1.创建过程和 web 项目示例一样
注意:需要选择 jpa 和对应数据库的驱动
### 2. 配置数据库连接
默认情况下Spring Boot 使用 H2 Database 作为内嵌数据库。如果你想使用其他数据库,可以在 `application.properties`(或 `application.yml`)文件中配置数据库连接信息。
例如,使用 H2 Database 的默认配置:
```properties
# application.properties
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=username
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto=update
```
### 5. 创建一个简单的控制器来测试
<!--rehype:wrap-class=row-span-3-->
创建一个简单的控制器 `UserController`,用来处理 HTTP 请求,并操作 `UserRepository` 来访问数据库。
```java
package com.example.userdemo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/users")
public class UserController {
@Autowired
private UserRepository userRepository;
// 获取所有用户
@GetMapping("/")
public List<User> getAllUsers() {
return userRepository.findAll();
}
// 通过 id 获取用户
@GetMapping("/{id}")
public User getUserById(@PathVariable("id") Long id) {
return userRepository.findById(id).orElse(null);
}
// POST 创建新用户
@PostMapping("/")
public User addUser(@RequestBody User user) {
return userRepository.save(user);
}
// PUT 更新用户
@PutMapping("/{id}")
public User updateUser(@PathVariable("id") Long id, @RequestBody User userDetails) {
User user = userRepository.findById(id).orElse(null);
if (user != null) {
user.setUsername(userDetails.getUsername());
user.setAge(userDetails.getAge());
user.setSex(userDetails.getSex());
return userRepository.save(user);
}
return null;
}
// DELETE 删除用户
@DeleteMapping("/{id}")
public void deleteUser(@PathVariable("id") Long id) {
userRepository.deleteById(id);
}
}
```
### 4. 创建 UserRepository 接口
<!--rehype:wrap-class=col-span-2-->
在同样的目录下创建一个接口 `UserRepository`,继承自 `JpaRepository<User, Long>`,这样 Spring Data JPA 将会自动实现一些基本的数据库操作方法。
```java
package com.example.userdemo;
import org.springframework.data.jpa.repository.JpaRepository;
public interface UserRepository extends JpaRepository<User, Long> {
}
```
### 3. 创建实体类 `User`
`src/main/java/com/example/userdemo` 目录下创建一个名为 `User` 的实体类:
```java
package com.example.userdemo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long userId;
private String username;
private Integer age;
private String sex;
// Constructors, getters, and setters 省略
}
```
### 6. 运行应用程序并测试
使用 Maven 或 Gradle 构建并运行你的应用程序。然后,可以使用 Postman 或浏览器访问以下 API 来测试你的应用程序:
- **GET** `http://localhost:8080/users/`
获取所有用户
- **GET** `http://localhost:8080/users/{id}`
根据用户ID获取用户信息
- **POST** `http://localhost:8080/users/`
添加新用户Body 中包含 JSON 数据)
- **PUT** `http://localhost:8080/users/{id}`
更新用户信息Body 中包含 JSON 数据)
- **DELETE** `http://localhost:8080/users/{id}`
删除用户
测试
---
### 1. 创建一个简单的项目
`src/main/java/com/example/demo` 目录下创建一个名为 `HelloController.java` 的类:
```java
package com.example.demo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@GetMapping("/hello")
public String hello() {
return "Hello, World!";
}
}
```
创建过程同 web 项目创建
### 2. 编写测试类
<!--rehype:wrap-class=col-span-2-->
`src/test/java/com/example/demo` 目录下创建一个名为 `HelloControllerTest.java` 的测试类:
```java
package com.example.demo;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
@SpringBootTest
@AutoConfigureMockMvc
public class HelloControllerTest {
@Autowired
private MockMvc mockMvc;
@Test
public void helloTest() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.get("/hello"))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.content().string("Hello, World!"))
.andDo(print());
}
}
```
### 3. 解释测试类的关键点
<!--rehype:wrap-class=col-span-2-->
- `@SpringBootTest`: 这个注解告诉 Spring Boot 在测试时启动整个 Spring 应用程序上下文。
- `@AutoConfigureMockMvc`: 这个注解确保在测试中自动配置 MockMvc 实例,用于模拟 HTTP 请求。
- `@Autowired private MockMvc mockMvc`: 注入 MockMvc 实例,用于执行 HTTP 请求并验证响应。
- `@Test public void helloTest()`: 这是一个 JUnit 测试方法,用来测试 `HelloController` 中的 `hello()` 方法。
- `mockMvc.perform(...)`: 执行一个 GET 请求到 `/hello` 接口。
- `andExpect(MockMvcResultMatchers.status().isOk())`: 预期响应的状态码是 200 OK。
- `andExpect(MockMvcResultMatchers.content().string("Hello, World!"))`: 预期响应的内容是 "Hello, World!"。
- `andDo(print())`: 打印请求和响应的详细信息,方便调试。
### 4. 运行测试
运行测试,确保程序正确.
部署与扩展
---
### 1. 打包方式
<!--rehype:wrap-class=col-span-2-->
Spring Boot 应用程序可以打包为以下几种方式之一:
#### 可执行 JAR 文件
- 最常见的方式是将 Spring Boot 应用程序打包成一个可执行的 JAR 文件Java Archive
- JAR 文件中包含了所有的依赖项,可以通过 `java -jar` 命令来运行。
#### WAR 文件
- 如果你需要将 Spring Boot 应用程序部署到外部的 Servlet 容器(如 Tomcat、Jetty 等),你可以将应用程序打包成一个 WAR 文件Web Application Archive
- WAR 文件适合传统的 Java Web 应用程序部署方式。
### 3. 打包过程概述
<!--rehype:wrap-class=row-span-2-->
当你运行 Maven 的构建命令时,它们会执行以下几个主要步骤来打包你的应用程序:
- `依赖项解析和下载`:构建工具会检查你项目中的依赖项,下载缺失的依赖并构建整个依赖树。
- `编译代码`:构建工具会编译你的 Java 代码、资源文件等。
- `运行测试`:通常会执行单元测试和集成测试,确保代码质量和功能正确性。
- `打包应用程序`
- 对于可执行 JAR 文件:构建工具会将编译后的类文件、资源文件和依赖项打包到一个 JAR 文件中。同时,它会生成一个 MANIFEST.MF 文件指定应用程序的入口点main class
- 对于 WAR 文件:构建工具会将编译后的类文件、资源文件和依赖项打包成一个 WAR 文件,包括 WEB-INF 目录和其他必要的内容。
- `输出结果`:构建工具会在指定的目录下生成打包好的 JAR 或 WAR 文件,通常位于 `target` 目录下Maven
<!--rehype:className=style-timeline-->
在你的 Spring Boot 项目中,通常有一个入口类(如 `Application.java` 或者根据你的项目命名)。这个类使用 `@SpringBootApplication` 注解标记,它包含了 `main` 方法用来启动应用程序。
### 2. 打包工具
通常使用以下两种构建工具来打包 Spring Boot 应用程序:
#### **Maven**
- 使用 Maven 的 `mvn package` 命令可以将应用程序打包为 JAR 或 WAR 文件。
-`pom.xml` 文件中Spring Boot 应用程序通常会依赖于 `spring-boot-starter-parent` 父项目,这简化了 Maven 配置和依赖管理。
### 4. 示例
假设你有一个简单的 Spring Boot 应用程序,并且已经配置好了 Maven 或 Gradle。运行以下命令即可进行打包
- **Maven**`mvn clean package`
构建工具会执行以上步骤,生成可执行的 JAR 文件或 WAR 文件,你可以根据需要进行部署和运行。

1046
docs/stylex.md Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -386,6 +386,8 @@ switch secondaryColor {
print("红色和黄色的混合")
case "purple":
print("红色和蓝色的混合")
case "green":
print("蓝色和黄色的混合")
default:
print("这可能不是辅助颜色")
}
@@ -522,8 +524,8 @@ let zeroToThree = 0...3
### stride() 函数
```swift
for oddNum in stride(from: 1, to: 5, by: 2) {
print(oddNum)
for num in stride(from: 1, to: 5, by: 2) {
print(num)
}
// 打印: 1
// 打印: 3
@@ -542,6 +544,7 @@ for char in "hehe" {
```
### continue 关键字
<!--rehype:wrap-class=row-span-2-->
```swift
for num in 0...5 {
@@ -558,6 +561,7 @@ for num in 0...5 {
`continue` 关键字将强制循环继续进行下一次迭代
### break 关键字
<!--rehype:wrap-class=row-span-2-->
```swift
for char in "supercalifragilistice" {
@@ -584,21 +588,58 @@ for _ in 1...3 {
// 打印: Olé
```
### 遍历指定范围
```swift
for i in 0...10 {
print(i) //0 到 10
}
```
封闭指定范围操作符(...
### while 循环
```swift
var counter = 1
var stopNum = Int.random(in: 1...10)
// 循环打印,直到满足停止条件
while counter < stopNum {
print(counter)
counter += 1
}
// 循环打印,直到满足停止条件
```
`while` 循环接受一个条件,并在所提供的条件为 `true` 时持续执行其主体代码。如果条件从不为假,则循环将继续运行,程序将陷入`无限循环`
### repeate while
```swift
var counter = 1
repeat {
print(counter)
counter += 1
} while counter <= 5
```
至少执行一次
### 遍历字典对象
```swift
// 创建一个字典
var myDictionary = [
"name": "John", "age": 25
]
// 使用for-in循环遍历字典
for (key, value) in myDictionary {
print("\(key): \(value)")
}
```
数组和集合
----
@@ -727,7 +768,7 @@ oddNumbers.remove(2)
oddNumbers.removeAll()
```
### .contains()
### .contains() 检测数组中的值
```swift
var names: Set = ["Rosa", "Doug", "Waldo"]
@@ -1001,6 +1042,8 @@ func washCar() -> Void {
}
```
返回值为空的函数void
### 调用函数
```swift
@@ -1103,7 +1146,7 @@ greet(person: "Aliya") // Hello Aliya
```swift
var currentSeason = "冬天"
func season(month: Int, name: inout String) {
func season(month:Int, name:inout String) {
switch month {
case 1...2:
name = "冬天 ⛄️"
@@ -1142,9 +1185,67 @@ func getFirstInitial(from name: String?) -> String? {
return name?.first
}
```
<!--rehype:className=wrap-text-->
函数可以接受可选类型并返回可选类型。当一个函数不能返回请求类型的合理实例时,它应该返回 `nil`
### 省略 return 关键字
```swift
func multiply(x: Int, y: Int) -> Int {
x * y
}
```
### 额外指定参数命名标签
<!--rehype:wrap-class=row-span-2-->
```swift
func calculate(of numbers: Int...) -> Int {
var sum = 0
for number in numbers {
sum += number
}
return sum
}
// 调用函数时,使用外部参数名
let result = calculate(of: 1, 2, 3, 4, 5)
print("Sum: \(result)")
```
### 函数作为参数
<!--rehype:wrap-class=row-span-2-->
```swift
func doMath(
operation: (Int, Int) -> Int,
a: Int, b: Int
) -> Int {
return operation(a, b)
}
// 定义一些可以作为参数传递的函数
func add(_ a: Int, _ b: Int) -> Int {
return a + b
}
// 使用 doMath 函数,并将 add 函数作为参数传递
let result = doMath(5, 3, operation: add)
print("Addition Result: \(result)")
```
### 闭包
```swift
let add: (Int, Int) -> Int = { (a, b) in
return a + b
}
// 调用闭包
let result = add(3, 5)
print("Sum: \(result)")
```
结构
----
@@ -1401,6 +1502,17 @@ let resolution = Resolution(width: 1920)
let someVideoMode = VideoMode()
```
### 类的扩展
```swift
extension String {
var boolValue: Bool {
return self == "1"
}
}
let isTure = "0".boolValue
```
枚举
----
@@ -1429,8 +1541,8 @@ enum Dessert {
case brownie
}
let customerOrder: Dessert = .cake(flavor: "红色天鹅绒")
switch customerOrder {
let custom: Dessert = .cake(flavor: "红色")
switch custom {
case let .cake(flavor):
print("你点了一个 \(flavor) 蛋糕")
case .brownie:
@@ -1476,29 +1588,37 @@ enum Dessert {
case brownie
}
let order: Dessert = .cake(flavor: "红色天鹅绒")
let order: Dessert = .cake(flavor: "红色")
```
### 实例方法
### 枚举的可赋值性
<!--rehype:wrap-class=row-span-2-->
```swift
enum Traffic {
case light
case heavy
mutating func reportAccident() {
self = .heavy
}
enum Content {
case empty
case text(String)
case number(Int)
}
var currentTraffic: Traffic = .light
currentTraffic.reportAccident()
// currentTraffic 现在是 .heavy
```
就像类和结构一样,枚举也可以有实例方法。如果实例方法改变了枚举的值,则需要将其标记为 `mutating`
使用 switch 处理可赋值枚举
```swift
let content = Content.text("Hello")
switch content {
case .empty:
print("Value is empty")
case .text(let value):
print("Value is \(value)")
case .number(_): //不调用时,可以省略
print("Value is a number")
}
// 或者
if case .text(let value) = content {
print("Value is \(value)")
}
```
### 从原始值初始化
@@ -1528,6 +1648,147 @@ enum ShirtSize: String {
}
```
### 遍历字符串
```swift
enum Currency: String {
case euro = "EUR"
case dollar = "USD"
case pound = "GBP"
}
```
输出枚举的原始值
```swift
let euroSymbol = Currency.euro.rawValue
print("欧元的货币符号是 \(euroSymbol)")
```
### 实例方法
```swift
enum Traffic {
case light
case heavy
mutating func reportAccident() {
self = .heavy
}
}
```
枚举也可以有实例方法
```swift
var currentTraffic: Traffic = .light
currentTraffic.reportAccident()
// currentTraffic 现在是 .heavy
```
实例方法改变了枚举的值,则需要将其标记为 `mutating`
扩展
---
### 声明扩展
```swift
struct Person {
var name: String
var age: Int
func eat() {}
}
extension Person {
// 添加新功能
}
extension Person: SomeProtocol {
// 实现协议方法、属性
}
```
### 扩展构造器
<!--rehype:wrap-class=col-span-2-->
```swift
// 给CGRect结构体提供允许center和size的构造器
extension CGRect {
init(center: CGPoint, size: CGSize) {
let x: CGFloat = center.x - size.width * 0.5
let y: CGFloat = center.y - size.height * 0.5
self.init(origin: CGPoint(x: x, y: y),
size: size)
}
}
let frame = CGRect(center: CGPoint(x: 100, y: 100),
size: CGSize(width: 50, height: 50))
print("Origin is \(frame.origin)")
```
### 扩展可变实例方法
```swift
extension Double {
mutating func cube() {
self = self * self * self
}
}
var boxCube: Double = 2.0
boxCube.cube()
print(boxCube)
```
### 扩展方法
<!--rehype:wrap-class=col-span-2-->
```swift
extension String {
func deletingPrefix(_ prefix: String) -> String {
guard self.hasPrefix(prefix) else {
return self
}
return String(self.dropFirst(prefix.count))
}
}
print("Hello World".deletingPrefix("He"))
```
### 扩展计算属性
```swift
// 扩展可以添加计算属性,不能添加存储属性
extension Double {
var km: Double { self * 1000 }
var m: Double { self }
var cm: Double { self / 100.0 }
var mm: Double { self / 1000.0 }
}
let metric: Double = 30.48.cm
print("1 metric is \(metric.m) meter")
print("1 metric is \(metric.km) kilometer")
```
### 扩展存储属性
<!--rehype:wrap-class=col-span-2-->
```swift
// 但可以通过 objc_getAssociatedObject/objc_setAssociatedObject 实现添加存储属性
private var fuchsiaKey = "fuchsiaKey"
extension UIColor {
var fuchsia: UIColor? {
get {
return objc_getAssociatedObject(self, &fuchsiaKey) as? UIColor
}
set {
objc_setAssociatedObject(self, &fuchsiaKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
}
}
```
另见
----

View File

@@ -1199,6 +1199,172 @@ struct SheetDetail: Identifiable {
文档 - [ActionSheet](https://developer.apple.com/documentation/swiftui/actionsheet)
SwiftData
---
### SwiftData声明
```swift
import SwiftData
// 通过@Model宏来定义模型schema
// 支持基础值类型String、Int、CGFloat等
// 支持复杂类型Struct、Enum、Codable、集合等
@Model
class Person {
var id: String
var name: String
var age: Int
init(name: String, age: Int) {
self.id = UUID().uuidString
self.name = name
self.age = age
}
}
```
### 声明@Attribute
```swift
@Model
class Person {
// @Attribute(.unique)为id添加唯一约束
@Attribute(.unique) var id: String
var name: String
var age: Int
init(name: String, age: Int) {
self.id = UUID().uuidString
self.name = name
self.age = age
}
}
```
### 声明@Relationship
```swift
@Model
class Person {
@Attribute(.unique)
var id: String
var name: String
var age: Int
// @Relationship(deleteRule: .cascade)
// 使得Person在数据库里被删除时
// 删除掉所有关联的students
@Relationship(deleteRule: .cascade)
var students: [Student]? = []
init(name: String, age: Int) {
self.id = UUID().uuidString
self.name = name
self.age = age
}
}
```
### 声明Transient
```swift
@Model
class Person {
@Attribute(.unique)
var id: String
var name: String
// @Transient表示不要持久化这个属性
// 需要提供一个默认值
@Transient
var age: Int = 0
init(name: String) {
self.id = UUID().uuidString
self.name = name
}
}
```
### @Query
<!--rehype:wrap-class=col-span-2-->
```swift
struct ContentView: View {
// Query 可以高效地查询大型数据集,并自定义返回内容的方式,如排序、过滤
@Query(sort: \.age, order: .reverse) var persons: [Person]
@Environment(\.modelContext) var modelContext
var body: some View {
NavigationStack() {
List {
ForEach(trips) { trip in
// ...
}
}
}
}
}
```
### 构建ModelContainer
<!--rehype:wrap-class=col-span-2-->
```swift
// 用 Schema 进行初始化
let container = try ModelContainer(for: Person.self)
// 用配置ModelConfiguration初始化
let container = try ModelContainer(
for: Person.self,
configurations: ModelConfiguration(url: URL("path"))
)
// 通过View 和 Scene 的修饰器来快速关联一个 ModelContainer
struct SwiftDataDemoApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
.modelContainer(for: Person.self)
}
}
```
### 构建ModelContext
```swift
// 在配置Model Container完成后
// 通过Environment 来访问到 modelContext
struct ContextView : View {
@Environment(\.modelContext)
private var context
}
// 或者直接获取共享的主Actor context
let context = container.mainContext
// 或者直接初始化一个新的Context
let context = ModelContext(container)
```
### 增、删、改
```swift
let person = Person(name: "Lily", age: 10)
// Insert a new person
context.insert(person)
// Delete an existing person
context.delete(person)
// Manually save changes to the context
try context.save()
```
### 查询
<!--rehype:wrap-class=col-span-2-->
```swift
let personPredicate = #Predicate<Person> {
$0.name == "Lily" &&
$0.age == 10
}
let descriptor = FetchDescriptor<Person>(predicate: personPredicate)
let persons = try? context.fetch(descriptor)
```
另见
---

321
docs/tauri.md Normal file
View File

@@ -0,0 +1,321 @@
tauri 备忘清单
===
这个 [tauri](https://tauri.app/) 快速参考备忘单显示了它的常用命令使用清单
入门
---
### 快速开始
<!--rehype:wrap-class=row-span-3-->
Bash
```bash
sh <(curl https://create.tauri.app/sh)
```
PowerShell
```bash
C:\> irm https://create.tauri.app/ps | iex
```
Cargo
```bash
$ cargo install create-tauri-app --locked
$ cargo create-tauri-app
```
npm/yarn/pnpm/bunx
```bash
$ npm create tauri-app@latest
$ yarn create tauri-app
$ pnpm create tauri-app
$ bunx create-tauri-app
```
#### 依赖环境
软件 | 描述
:- |:-
[rust](https://www.rust-lang.org/tools/install)| rust安装
[nodejs](https://nodejs.org/en)| nodejs安装
[Windows Build Tools](https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/)| Microsoft C++ 生成工具 (for windows)
[Android Studio](https://developer.android.google.cn/studio?hl=zh-cn)|安卓开发工具
### 启动 Tauri 开发窗口
```bash
$ npm run tauri dev
$ yarn tauri dev
$ pnpm tauri dev
$ bunx tauri dev
$ cargo tauri dev
```
### 检测最新版本的 Tauri
```bash
$ npm outdated @tauri-apps/cli
$ yarn outdated @tauri-apps/cli
$ pnpm add -D @tauri-apps/cli
$ npm outdated @tauri-apps/cli
```
### 更新 npm 包
<!--rehype:wrap-class=col-span-2-->
```bash
$ npm install @tauri-apps/cli@latest @tauri-apps/api@latest
$ yarn upgrade @tauri-apps/cli @tauri-apps/api --latest
$ yarn up @tauri-apps/cli @tauri-apps/api
$ pnpm update @tauri-apps/cli @tauri-apps/api --latest
$ bun update @tauri-apps/cli @tauri-apps/api
```
### 更新 Cargo 包
打开 `src-tauri/Cargo.toml` 并更改 `tauri``tauri-build`
```ini
[build-dependencies]
tauri-build = "%version%"
[dependencies]
tauri = { version = "%version%" }
```
其中 `%version%` 是上面相应的版本号
```bash
$ cd src-tauri
$ cargo update
```
### 应用程序调试
代码中输出日志方法
```rust
println!("Message from Rust: {}", msg);
```
在 Linux 和 macOS 上通过下面命令重新运行
```bash
RUST_BACKTRACE=1 tauri dev
```
Window 上这样开启
```bash
set RUST_BACKTRACE=1
tauri dev
```
### 以编程方式打开 Devtools
<!--rehype:wrap-class=col-span-2-->
```rust
use tauri::Manager;
tauri::Builder::default()
.setup(|app| {
#[cfg(debug_assertions)] // 仅在调试构建时包含此代码
{
let window = app.get_window("main").unwrap();
window.open_devtools();
window.close_devtools();
}
Ok(())
});
```
### 在生产中使用检查器
```bash
$ npm run tauri build -- --debug
$ yarn tauri build --debug
$ pnpm tauri build --debug
$ bunx tauri build --debug
$ cargo tauri build --debug
```
### 启用开发工具功能
<!--rehype:wrap-class=col-span-2-->
```ini
[dependencies]
tauri = { version = "...", features = ["...", "devtools"] }
```
在文件 `src-tauri/Cargo.toml` 中启用 `devtools Cargo` 功能
安卓开发
---
### 环境变量
<!--rehype:wrap-class=col-span-2-->
`JAVA_HOME`
`ANDROID_HOME`
`NDK_HOME`
### 准备目标
<!--rehype:wrap-class=col-span-2-->
```bash
$ npm install @tauri-apps/cli@next @tauri-apps/api@next
$ npm run tauri migrate
$ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
$ rm -r src-tauri/gen
$ npm run tauri android init
$ npm run tauri icon
```
修改应用名:%app_path%\src-tauri\gen\android\app\src\main\res\values\strings.xml
### 编译
<!--rehype:wrap-class=col-span-2-->
```bash
$ npm run tauri android dev
$ npm run tauri android build
```
### 签名
<!--rehype:wrap-class=col-span-2-->
```bash
$ keytool -genkey -alias android.keystore -keyalg RSA -validity 20000 -keystore android.keystore
$ zipalign -p -f -v 4 unsigned.apk release.apk
$ apksigner sign --ks android.keystore release.apk
```
配置
---
### 配置结构
<!--rehype:wrap-class=row-span-2-->
默认配置 `tauri.conf.json`,还支持 `tauri.conf.json5``Tauri.toml`
-- | --
:--- | ---
`package` | 包设置
`tauri` | Tauri 配置
`build` | 构建配置
`plugins` | 插件配置
下面配置能与主配置进行合并
- `tauri.linux.conf.json``Tauri.linux.conf.toml`
- `tauri.windows.conf.json``Tauri.windows.conf.toml`
- `tauri.macos.conf.json``Tauri.macos.conf.toml`
示例
```json
{
"build": { ... },
"package": { ... },
"tauri": { ... }
}
```
### Tauri 配置
<!--rehype:wrap-class=col-span-2-->
配置 | Type | 描述
:--- | --- | ---
`pattern` | [PatternKind](#patternkind) | 应用程序名称
`version` | [WindowConfig\[\]](#windowconfig) | 应用程序版本
`cli` | [CliConfig](#cliconfig) | CLI 配置
`bundle` | BundleConfig | 打包器配置
`allowlist` | AllowlistConfig | 允许列表配置
`security` | SecurityConfig | 安全配置
`updater` | UpdaterConfig | 更新程序配置
`systemTray` | [SystemTrayConfig](#systemtrayconfig) | 配置应用系统托盘
`macOSPrivateApi` | boolean | macOS 私有API配置
<!--rehype:className=left-align-->
### CliConfig
<!--rehype:wrap-class=col-span-2-->
配置 | Type | 描述
:--- | --- | ---
`description` | string? | 将显示在帮助信息中
`longDescription` | string? | 将显示在帮助信息中
`beforeHelp` | string? | 该信息显示在自动生成的帮助信息之前。这通常用于标题信息
`afterHelp` | string? | 显示在自动生成的帮助信息之后。通常用于描述如何使用参数,或者需要注意的注意事项
`args` | array? | 命令的参数列表
`subcommands` | object? | 该命令的子命令列表
<!--rehype:className=left-align-->
描述 CLI 配置
### Package 配置
配置 | 描述
:--- | ---
`productName` | 应用程序名称
`version` | 应用程序版本
### WindowConfig
<!--rehype:wrap-class=col-span-2 row-span-2-->
窗口配置对象
配置 | Type | 默认值 | 描述
:--- | --- | --- | ---
`label` | string | null | 窗口标识符
`url` | [WindowUrl](#windowurl) | view | 窗口的 webview URL
`userAgent` | userAgent? | null | webview 的用户代理
`fileDropEnabled` | boolean | true | 是否在 Web 视图上启用文件放置
`center` | boolean | false | 窗口是否开始居中
`x` | number? | null | 窗口左上角的水平位置
`y` | number? | null | 窗口左上角的水平位置
`width` | number | 800 | 窗口宽度
`height` | number | 600 | 窗口高度
`minWidth` | number | null | 最小窗口宽度
`minHeight` | number | null | 最小窗口高度
### PatternKind
应用模式。可以是以下类型中的任意一种:
#### 棕地模式
```json
{ "use": "brownfield" }
```
#### 隔离模式。建议出于安全目的
```json
{
"use": "isolation",
"options": { "dir": string }
}
```
### WindowUrl
要在 Tauri Web 视图窗口中打开的 URL。可以是以下任何一种类型
- `string` (format: `uri`):外部 URL。
- `string`:应用程序 URL 的路径部分。例如,要加载 `tauri://localhost/users/john`,只需在此配置中提供 `users/john`
### SystemTrayConfig
<!--rehype:wrap-class=col-span-2-->
配置 | Type | 默认值 | 描述
:--- | --- | --- | ---
`iconPath` | string(必填) | null | 系统托盘上使用的默认图标的路径
`iconAsTemplate` | boolean | false | 用于确定图像是否代表 macOS 上的[模板](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc)图像
`menuOnLeftClick` | boolean | true | 确定在 macOS 上托盘图标收到左键点击时菜单是否应该出现
`title` | string? | null | MacOS 托盘标题
<!--rehype:className=left-align-->
应用程序系统托盘图标的配置

112
docs/twitter.md Normal file
View File

@@ -0,0 +1,112 @@
Twitter(X)
===
[Twitter](https://x.com) 上的 26 个键盘快捷键和高级搜索参考备忘清单
键盘快捷键
----
### 动作
快捷键 | 动作
---|---
`N` | 新推文
`L` | 喜欢推文
`R` | 回复推文
`T` | 转推
`M` | 直接消息
`U` | 静音账号
`B` | 屏蔽账号
`Enter` | 打开推文详情
`O` | 展开图片
`/` | 搜索
`Ctrl` `Enter` | 发送推文
<!--rehype:className=shortcuts-->
### 导航
快捷键 | 动作
---|---
`?` | 完整键盘菜单
`J` | 下一个推文
`K` | 上一个推文
`Space` | 向下翻页
`.` | 加载新推文
<!--rehype:className=shortcuts-->
### 时间线
快捷键 | 动作
---|---
`G` `N` | 主页时间线
`G` `O` | 瞬间
`G` `N` | 通知选项卡
`G` `R` | 提及
`G` `P` | 个人资料
`G` `L` | 喜欢选项卡
`G` `I` | 列表选项卡
`G` `M` | 直接消息
`G` `S` | 设置和隐私
`G` `U` | 访问某人的资料
<!--rehype:className=shortcuts-->
高级搜索
----
### 搜索词
<!--rehype:wrap-class=row-span-3-->
搜索词 | 搜索结果
---|---
`watching now` | 同时包含 “watching” 和 “now” 的推文(默认搜索模式)
`"happy hour"` | 包含完整的短语 “happy hour” 的推文
`love OR hate` | 包含 "love” 或 "hate”或同时包含两个词的推文
`beer -root` | 包含 "beer",但不包含 "root” 的推文
`#haiku` | 包含 Twitter 话题 “haiku” 的推文
`from:interior` | 由 Twitter 账户 “interior” 发布的推文(用于抓取指定用户的推文)
`list: NASA/astronauts-in-space-now` | 由 NASA 列表 astronauts-in-space-now 中的 Twitter 账户发布的推文
`to: NASA` | 回复Twitter账户 “NASA” 的推文
`@NASA` | 提到 Twitter 账户 “NASA” 的推文(即@指定Twitter账户的推文
<!--rehype:className=style-list-->
### 内容筛选
<!--rehype:wrap-class=row-span-3-->
内容条件 | 搜索结果
---|---
`politics filter:safe` | 包含“puppy”且过滤被可能包含潜在敏感信息的推文
`puppy filter:media` | 包含“puppy”且包含图片或视频
`puppy -filter:retweets` | 包含“puppy”且不包含转推(用于过滤转推推文)
`puppy filter:native_video` | 包含“puppy”且包含一个上传的视频
`puppy filter:periscope` | 包含“puppy”且包含一个可展示为视频的链接
`puppy filter:images` | 包含“puppy ,且包含一个图片
`puppy filter:links` | 包含“puppy且包含一个链接
`puppy url:amazon` | 包含“puppy”且包含一个内容包括"amazon”的Url链接
<!--rehype:className=style-list-->
### 导航
- [Twitter 官网](https://twitter.com)<!--rehype:target=__blank-->
- [Twitter 的高级搜索](https://twitter.com/search-advanced)<!--rehype:target=__blank-->
### 时间筛选
Operator | Finds Tweets..
---|---
`puppy since:2020-6-4` | 包含“puppy“目发布时间晚于2020.06.04包含2020.06.04
`puppy until: 2020-6-4` | 包含"puppy目发布时间早于2020,06.04不包含2020,06.04
<!--rehype:className=style-list-->
### 其它技巧
搜索词 | 搜索结果
---|---
`关键字+min_faves:10` | 超过 10 个<red>`点赞`</red>有关相应关键字的推文;
`关键字+min_replies:9` | 超过 9 个<red>`回复`</red>有关相应关键字的推文;
`关键字+min_retweets:11` | 超过 11 个<red>`转发`</red>有关相应关键字的推文;
<!--rehype:className=style-list-->
另请参阅
--------
- [Twitter 的键盘快捷键](https://help.twitter.com/en/using-twitter/how-to-tweet) _(help.twitter.com)_

View File

@@ -403,9 +403,9 @@ Vim 搜索和替换
:- | -
:- | -
`/foo` | 向搜索
`/foo\c` | 向搜索 _(不区分大小写)_
`?foo` | 向搜索
`/foo` | 向搜索
`/foo\c` | 向搜索 _(不区分大小写)_
`?foo` | 向搜索
`/\v\d+` | 使用 [regex](./regex.md) 搜索
`n` | 下一个匹配的搜索模式
`N` | 上一个匹配的搜索

174
docs/vimium.md Normal file
View File

@@ -0,0 +1,174 @@
Vimium 备忘清单
===
这是开始使用 [Vimium](https://github.com/philc/vimium) 浏览器扩展的快速参考备忘单,可以帮助用户更高效地浏览网页
入门
----
### 功能特点
#### 键盘导航
- 使用类似 Vim 的快捷键进行网页滚动、打开链接、管理标签页等操作
#### 快捷键自定义
- 用户可根据个人习惯自定义快捷键,提升使用体验
#### 无鼠标操作
- 通过键盘快捷键完成几乎所有浏览器操作,减少对鼠标的依赖,提高效率
### 安装
**Chrome 浏览器**
- [Chrome web store](https://chromewebstore.google.com/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb)
**Edge 浏览器**
- [Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/vimium/djmieaghokpkpjfbpelnlkfgfjapaopa)
**Firefox 浏览器**
- [Firefox Add-ons](https://addons.mozilla.org/en-GB/firefox/addon/vimium-ff/)
### 快捷键自定义
```json
{
"customKeybindings": {
"scrollUp": "k",
"scrollDown": "j",
"scrollLeft": "h",
"scrollRight": "l",
"reload": "r",
"openLinkInCurrentTab": "f",
"openLinkInNewTab": "F"
}
}
```
键盘快捷键
---
### 基本导航
<!--rehype:wrap-class=row-span-3-->
快捷键 | 功能
:-- | ---
`?` | 显示帮助对话框,列出所有可用按键
`h` | 向左滚动
`j` | 向下滚动
`k` | 向上滚动
`l` | 向右滚动
`gg` | 滚动到页面顶部
`G` | 滚动到页面底部
`d` | 向下滚动半页
`u` | 向上滚动半页
`f` | 在当前标签页中打开链接
`F` | 在新标签页中打开链接
`r` | 重新加载页面
`gs` | 查看页面源代码
`I` | 进入插入模式 -- 所有命令将被忽略,直到你按下 Esc 退出
`yy` | 复制当前网址到剪贴板
`yf` | 复制链接地址到剪贴板
`gf` | 向前切换到下一个框架
`gF` | 聚焦主框架/顶部框架
<!--rehype:className=shortcuts left-align-->
### 导航到新页面
快捷键 | 功能
:-- | ---
`o` | 打开网址、书签或历史记录条目
`O` | 在新标签页中打开网址、书签或历史记录条目
`b` | 打开书签
`B` | 在新标签页中打开书签
<!--rehype:className=shortcuts left-align-->
### 浏览您的历史
快捷键 | 功能
:-- | ---
`H` | 后退到历史记录
`L` | 前进到历史记录
<!--rehype:className=shortcuts left-align-->
### 操作选项卡
<!--rehype:wrap-class=row-span-2-->
快捷键 | 功能
:-- | ---
`J, gT` | 向左切换一个标签页
`K, gt` | 向右切换一个标签页
`g0` | 跳转到第一个标签页</br>使用 ng0 跳转到第 n 个标签页
`g$` | 跳转到最后一个标签页
`^` | 访问上一个访问过的标签页
`t` | 创建新标签页
`yt` | 复制当前标签页
`x` | 关闭当前标签页
`X` | 恢复关闭的标签页(撤销 'x' 命令)
`T` | 搜索打开的标签页
`W` | 将当前标签页移动到新窗口
`<a-p>` | 固定/取消固定当前标签页
<!--rehype:className=shortcuts left-align-->
### 链接操作
| 快捷键 | 功能 |
| -------- | -------------------------- |
| `f` | 打开链接 |
| `F` | 在新标签页中打开链接 |
| `gf` | 打开下一个框架 |
| `gu` | 进入当前URL的父级路径 |
| `gU` | 进入当前URL的根路径 |
<!--rehype:className=shortcuts left-align-->
### 标签页操作
| 快捷键 | 功能 |
| -------- | -------------------------- |
| `J` | 切换到左边的标签页 |
| `K` | 切换到右边的标签页 |
| `t` | 创建新标签页 |
| `x` | 关闭当前标签页 |
| `X` | 恢复最近关闭的标签页 |
| `T` | 搜索打开的标签页 |
<!--rehype:className=shortcuts left-align-->
### 搜索与复制
| 快捷键 | 功能 |
| -------- | -------------------------- |
| `/` | 在页面中搜索 |
| `n` | 下一个搜索结果 |
| `N` | 上一个搜索结果 |
| `yy` | 复制当前页面的URL |
| `yf` | 复制链接 |
<!--rehype:className=shortcuts left-align-->
### 插入模式
| 快捷键 | 功能 |
| -------- | -------------------------- |
| `i` | 进入插入模式 |
| `I` | 进入插入模式(已聚焦元素) |
<!--rehype:className=shortcuts left-align-->
### 开发者工具
| 快捷键 | 功能 |
| -------- | -------------------------- |
| `gi` | 聚焦第一个输入框 |
| `gI` | 聚焦最后一个输入框 |
| `gs` | 查看页面源代码 |
| `gf` | 打开下一个框架 |
| `gF` | 打开所有框架 |
<!--rehype:className=shortcuts left-align-->
另见
----
- [Vimium 官方文档](https://github.com/philc/vimium)

View File

@@ -1,6 +1,6 @@
{
"name": "@wcj/reference",
"version": "1.42.0",
"version": "1.44.0",
"description": "为开发人员分享快速参考备忘单(主要是方便自己)。",
"author": "jaywcjlove",
"license": "MIT",
@@ -8,7 +8,7 @@
"funding": "https://jaywcjlove.github.io/#/sponsor",
"private": false,
"scripts": {
"prepare": "husky install",
"prepare": "husky",
"build": "refs-cli",
"start": "refs-cli --watch",
"prettier": "prettier --write '**/*.{mjs,css,json,prettierrc,lintstagedrc}'",
@@ -28,12 +28,12 @@
"docs/*.md": "markdownlint --fix"
},
"devDependencies": {
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"husky": "^9.0.0",
"lint-staged": "^15.0.0",
"prettier": "^3.0.0",
"refs-cli": "^1.5.1",
"markdownlint": "^0.27.0",
"markdownlint-cli": "^0.33.0"
"markdownlint": "^0.33.0",
"markdownlint-cli": "^0.39.0"
},
"engines": {
"node": ">=16.0.0"