Compare commits
695 Commits
v1.41.0
...
78f60f418c
Author | SHA1 | Date | |
---|---|---|---|
78f60f418c | |||
9e66decded | |||
4e2bc83644 | |||
d2585a431c | |||
1abd69f13f | |||
13ce84c95a | |||
43effcf0cb | |||
5cdd5d8d89 | |||
4ab24ae284 | |||
102b0862b9 | |||
0b9af04f70 | |||
68b804b7f5 | |||
ce0b7c6cd0 | |||
007394b051 | |||
3577721578 | |||
e0b540d174 | |||
7650bbac40 | |||
ffb15d6542 | |||
4a9e2d0ed7 | |||
3e732813c8 | |||
4381fe820e | |||
1c866c011f | |||
856094374d | |||
4ca8110520 | |||
cb8d9dfb45 | |||
fb3e277fed | |||
c2454acd73 | |||
3301d5a7ee | |||
d37f9c6442 | |||
4661fdc6b9 | |||
3f064a5457 | |||
582d26a6d9 | |||
0cb2ec73cc | |||
e4dda9a41a | |||
6937111dce | |||
27d597c801 | |||
04676e51df | |||
340934876e | |||
95da603a74 | |||
975ddb3193 | |||
ee9a764b8f | |||
d9a0c8cf07 | |||
4c7c88626b | |||
3ca296f8f7 | |||
fe07d5fd8c | |||
5b256b077e | |||
2655ce4914 | |||
1d6db04e39 | |||
1b4be7d870 | |||
ba9b4a5ca1 | |||
15cf70fb50 | |||
b463143e63 | |||
740b2b8871 | |||
9eb9edd04a | |||
882efb7310 | |||
a1dfc43d67 | |||
c9e729bc7e | |||
46e0ef5443 | |||
c9ae7d673e | |||
adf39710da | |||
b7f0db51fe | |||
c99af98f7d | |||
2e96576084 | |||
17921854d3 | |||
f401c87bbf | |||
a9974dfd20 | |||
0fd9e8af65 | |||
9f2ad7a295 | |||
0c618e1c01 | |||
19e258c591 | |||
13701d39ee | |||
a5759ea2d3 | |||
0c78352ef7 | |||
5e5666d347 | |||
884e8dbeff | |||
e3dbd1b196 | |||
828afdad47 | |||
c99f3c8788 | |||
cec3255efc | |||
a0a957483c | |||
8ec4235082 | |||
6f95c250e6 | |||
792451b75f | |||
d57b60064c | |||
3ec25b8951 | |||
6d86d679f0 | |||
95d21e81a9 | |||
99c30d38fd | |||
7cb9f0e058 | |||
f945549091 | |||
229b4af4a5 | |||
b673ede608 | |||
2297475e5a | |||
03e52c1126 | |||
e544b8f7b3 | |||
a7b01e4ce0 | |||
ea4637c28f | |||
fe047b1e5a | |||
4c8694d784 | |||
61046b519b | |||
8af3950731 | |||
3f329c15ec | |||
485d80489b | |||
0eb3ac6165 | |||
869f3de520 | |||
da9780f4a7 | |||
8807e483fc | |||
d5d79d72c6 | |||
db215dcb2d | |||
7f4fd32453 | |||
81d60eacaf | |||
453a8b9a05 | |||
b00b74f695 | |||
21b8c17818 | |||
a54ceebf02 | |||
2771b42a96 | |||
579d1de673 | |||
daaa4c5f09 | |||
b414893b15 | |||
072ddcca73 | |||
5e773f0696 | |||
3bcb61d409 | |||
ad9aaf759e | |||
211809a177 | |||
e7b8958368 | |||
d7df8bc6fe | |||
ba05c9d952 | |||
d02dc80480 | |||
eb1157523d | |||
6c8217202a | |||
b3893d8478 | |||
006c4bf587 | |||
0c7e4081a5 | |||
cfac374221 | |||
579d25d3a1 | |||
2cbafe0ef5 | |||
a9e3fb135e | |||
44e775a1ee | |||
933b1957e4 | |||
20ecc2eef2 | |||
4750e61a30 | |||
91b022bf4d | |||
ad3c46c009 | |||
4917ecf3a7 | |||
cf997d6ac0 | |||
435cfdf739 | |||
4412bf6a01 | |||
da39a1ad3d | |||
02bb059452 | |||
5b28ed2caf | |||
7eb30c080a | |||
3c6c459b17 | |||
5cb04086b1 | |||
27c3a9578f | |||
d7b1d03761 | |||
f03cc68c0d | |||
3a41d66cef | |||
0f52c6fdfe | |||
c63d27edcf | |||
6b9ef0aa43 | |||
7c220e3efc | |||
a73f837fc1 | |||
4ccef1281f | |||
f0cfadf240 | |||
67c9cc4d8e | |||
a92759f0ed | |||
e9a61371f0 | |||
881dfa5df3 | |||
bbd2fa2ebf | |||
af5e05b7d8 | |||
3986b1ca29 | |||
416e1ff9fd | |||
1f0fc6c925 | |||
ad2fd7b642 | |||
345e968c4c | |||
72b973a923 | |||
8ae69f2386 | |||
29bb4e487c | |||
3519f863f4 | |||
df32d5a429 | |||
e3e0896834 | |||
71c4aea9ca | |||
3662bb703c | |||
2c6244b6f8 | |||
292551a8f2 | |||
af2f380a18 | |||
9411c434a8 | |||
02f1d13471 | |||
37f8c7d69e | |||
aa52a25839 | |||
d41aaa9569 | |||
32cd8e4d5d | |||
cf9c76d5c7 | |||
15323378b5 | |||
7fb6ce9190 | |||
145aa54a4e | |||
1e22344f72 | |||
596bff3f4a | |||
30f8feb59b | |||
81596b6c88 | |||
612f874723 | |||
51d30f35d2 | |||
804e6ef7eb | |||
e3628fc62d | |||
184ec1c187 | |||
0be49cd510 | |||
f6fe236778 | |||
b6d62f4f74 | |||
4c67490ade | |||
3749de233c | |||
a69be1efba | |||
b0444f82bf | |||
c1dd21bf0c | |||
c249e0e609 | |||
0fc608a1ff | |||
c0d987694e | |||
a74c7e2092 | |||
88559b491c | |||
eeb42297ac | |||
70842a31b5 | |||
5ffc6faf3d | |||
ade6fbe3d0 | |||
feba5e1704 | |||
ce1e1a0c1d | |||
661ee94e68 | |||
93e3166fc5 | |||
33909b96f8 | |||
001388aa4a | |||
33683eab41 | |||
77b2c7a133 | |||
f510d354af | |||
f549244389 | |||
2bac216f98 | |||
acf4c11182 | |||
dbc29e409a | |||
0fb45105c9 | |||
ddc7f2dd47 | |||
660dfe103d | |||
cdeeeb14bb | |||
22f2c1472b | |||
ea3391734b | |||
5f90dd9265 | |||
638fb0bbce | |||
58efbde216 | |||
d604a0d557 | |||
c4ebb484cd | |||
2307a5796a | |||
5ea93312bd | |||
f0da2a3397 | |||
8963525b9a | |||
4e1a4bb641 | |||
1a37518aab | |||
01757edbef | |||
f36bb4bcbb | |||
d42cbc7d2c | |||
f80b5795bc | |||
90b9b407b3 | |||
1a0415d432 | |||
e6dab60332 | |||
58991c482e | |||
eea1a03da8 | |||
a3d3d4b0dd | |||
8c8b721015 | |||
ec6d1677d6 | |||
e25753169f | |||
ca6a407ca8 | |||
d7ea92c019 | |||
f25137d53d | |||
3e40d6e54f | |||
145bdf9119 | |||
daccdf940a | |||
29b9e61adb | |||
708329d8f2 | |||
fac5af10c8 | |||
a45e63a966 | |||
6c3b017099 | |||
68aaed2cef | |||
a05328f389 | |||
707e939bf6 | |||
94a5baec46 | |||
0d7f6653b6 | |||
4f4ac84ec9 | |||
a8fbc4f8e1 | |||
3cbec70a5e | |||
8e9132f900 | |||
aadda3d5c5 | |||
031b7f1976 | |||
34bf61c2fb | |||
3e05d637d3 | |||
658abb0e00 | |||
5dc858cfe5 | |||
29c4430e3a | |||
229193a584 | |||
222f5bc604 | |||
4b22796c36 | |||
eb01adb655 | |||
ebc7ef957a | |||
91e0fb3af7 | |||
3b817385a8 | |||
d19915eac8 | |||
3478e345eb | |||
70b561c710 | |||
60fae2b928 | |||
85d74eb81a | |||
99c34277e1 | |||
1013713630 | |||
942f2c9563 | |||
0be71ca830 | |||
121db975c4 | |||
8f54901b92 | |||
09fd8603cb | |||
1fb3dd7c34 | |||
819704c974 | |||
41e7f5e2ce | |||
3fa46ae173 | |||
d4115b3044 | |||
60c463b1cb | |||
aadb7e664b | |||
deeed5ec0b | |||
c0903a400c | |||
80761d5cf6 | |||
2fbe314f16 | |||
e657882897 | |||
04b0b48d94 | |||
7e32739eb6 | |||
9659f0f074 | |||
e1b5344903 | |||
f5c4e78c11 | |||
08edd2ad3d | |||
9f7014bc52 | |||
8197b8f641 | |||
1c55ee64bf | |||
8cca95af19 | |||
4138d22968 | |||
9529667952 | |||
6730b65788 | |||
a527cb28a0 | |||
100297d821 | |||
7ef107d114 | |||
864da459ef | |||
44e5c5a248 | |||
a3dab064ce | |||
4b9ff8a35e | |||
fa2c86a964 | |||
d7008594f8 | |||
df9c2ac08b | |||
7494981f5f | |||
ae490e878e | |||
ae594eb45a | |||
8fad195069 | |||
8dbec19255 | |||
8880d82092 | |||
ee03850619 | |||
9acc906680 | |||
05191c8c2c | |||
3b0416a2c3 | |||
10dfe11942 | |||
a0480a90dd | |||
1bb046db08 | |||
1cbc663abf | |||
29a3787140 | |||
e28914b3c7 | |||
6d9782c019 | |||
8727334a7c | |||
861d35482a | |||
5708867a5d | |||
02240aaab0 | |||
1189c92fd7 | |||
a1a1bd60f8 | |||
739b18048d | |||
bcd60d6020 | |||
afbe61aebc | |||
f2183a90c3 | |||
a10d0f850d | |||
167fef356f | |||
5e22e28a2d | |||
3a1d780bbe | |||
a2b8fc493b | |||
7eaa5786d1 | |||
2dbcac300f | |||
127f2752dd | |||
19ed3fa3b2 | |||
c808475d59 | |||
63725cf4ab | |||
fad6a20b13 | |||
1c5850b8e9 | |||
a64e21d466 | |||
fcda71cfd3 | |||
450d3d8f0e | |||
f24b08489d | |||
443f2ba7b0 | |||
da0c16aab7 | |||
35e2e58205 | |||
b9e327cfb7 | |||
01c8c04b30 | |||
1b1ad3453c | |||
70e94f5cc9 | |||
d70b190edc | |||
1df034e846 | |||
88d6e50319 | |||
265bffe9c1 | |||
ffa69578a6 | |||
73106942ca | |||
9446bc0ab9 | |||
4c86b97c40 | |||
6f16c43dc5 | |||
7c005d8e8a | |||
1a829ec469 | |||
4d638b26c5 | |||
22ecbc56a6 | |||
3d2c2d4d25 | |||
6f0ec249f6 | |||
654dc15eb6 | |||
c71ea7d356 | |||
f6a29c9e9e | |||
bec51fa09f | |||
aaf6d1669b | |||
0c4c020aaf | |||
5456dbfa24 | |||
3ceb796324 | |||
87554d1616 | |||
69d5fe0b2a | |||
404f5f1070 | |||
c0b8eb4da7 | |||
7fa1528be5 | |||
564ef54c1b | |||
dd0d19cf1c | |||
5c34078de5 | |||
4e21fd05d1 | |||
d1fb7ad8cb | |||
43397a9cf7 | |||
166cbbd02f | |||
d52c7c2abc | |||
21ddcb51cb | |||
ac70a8d913 | |||
b28c141fdf | |||
a9552508a0 | |||
2c61572a99 | |||
d3ece9328d | |||
d3e778ee35 | |||
187fe9e8c0 | |||
fe5d52682e | |||
642aa08cd6 | |||
8c80f47c99 | |||
e8e1a83240 | |||
c0ebe199d1 | |||
ebcae6d5cd | |||
a39f00461b | |||
73099249f4 | |||
4db4c7a750 | |||
9db13825c5 | |||
444f2c8c91 | |||
e8af72372c | |||
d8e1bdf6ca | |||
55587bd145 | |||
9684f7c9e4 | |||
51336f8b86 | |||
f682690b9f | |||
6e46907d5c | |||
b0df70a952 | |||
55be092001 | |||
7cf8fae835 | |||
8b3784038d | |||
f000ab5d67 | |||
599e776b1a | |||
959afe6bf7 | |||
be81f1bfcb | |||
3cee78a29e | |||
742c4b0018 | |||
e1d523036e | |||
38bbf5d6d3 | |||
0bced7ac0f | |||
104f34dff9 | |||
c3197fe24b | |||
d5e6cb3b62 | |||
99e41b2798 | |||
93d760298e | |||
62777d1690 | |||
881033ca36 | |||
00cc7f7330 | |||
8c7cecb128 | |||
d4000a3c02 | |||
7bb91f3f60 | |||
1b9437656d | |||
2b6b58d7fb | |||
8dca5a8765 | |||
ce4e16fb75 | |||
ae10c15d2a | |||
844bc6d307 | |||
c343cb3587 | |||
7f0709f502 | |||
d8427d22a9 | |||
626b7ec961 | |||
278ebee2c0 | |||
822af71d7f | |||
b5f9d14ab1 | |||
0a012311dd | |||
c49b7002ce | |||
bb605ea530 | |||
a3ffdd16fc | |||
b880c23f05 | |||
df3e46f34d | |||
a45fcfef20 | |||
3b65deb8d1 | |||
3fdfa19b74 | |||
8d60181b96 | |||
cb5df68489 | |||
88f43a924a | |||
6f50c1adfd | |||
c6d9901d5e | |||
bd2d631b02 | |||
e25412175f | |||
b6ca1e5166 | |||
3d0ce212a9 | |||
2a4c08a69e | |||
3ddb8959c5 | |||
37906f6548 | |||
ce2640f9cf | |||
9e42db6fcb | |||
fd85b9d819 | |||
2dd3fd1e84 | |||
21dc25c2a4 | |||
ea8d6b3391 | |||
1efbb7155b | |||
22194283aa | |||
56d8186e0a | |||
9e5e671a1a | |||
dc3005bc99 | |||
dedb8b9475 | |||
6f978c8df0 | |||
8ce7714bca | |||
f8b4ef611f | |||
057eddb4b2 | |||
6dfc13ee6d | |||
b77f29a1c2 | |||
55f807f407 | |||
2e2b3b8ee4 | |||
234da6d914 | |||
36068c9ad3 | |||
359b81a44f | |||
20b3a1969d | |||
d59d128bd1 | |||
f5ce635f97 | |||
d6121b3ce9 | |||
e5ccf68774 | |||
f3699e12cd | |||
88452a8b07 | |||
2d8753a6a5 | |||
a7a5d029d5 | |||
dabb4b2cd7 | |||
f318e2456d | |||
8250615bca | |||
f7c2d6555f | |||
a15bd68a59 | |||
5d82708d56 | |||
fda807a97b | |||
c076d32fc1 | |||
da7cccb50b | |||
349d811c66 | |||
4c7e86893d | |||
b040885e8b | |||
925a2913c4 | |||
76785c6c55 | |||
13991b8b5e | |||
e5ad863e2d | |||
3c2e52f47e | |||
137210c886 | |||
60e83d0e0b | |||
338b54f3c5 | |||
5fc5c065df | |||
435fdead51 | |||
61f4697406 | |||
6122942c95 | |||
57d42b29ba | |||
ee97d75160 | |||
cff4119203 | |||
4dfb3c8e9f | |||
50526ab7a4 | |||
6a9c656af6 | |||
ee1c50166c | |||
18189760b7 | |||
e8c86ad588 | |||
d9ff20b22c | |||
c03deba9a5 | |||
6358f19144 | |||
8ef5df72f0 | |||
704ba7332e | |||
bc4e48c5fd | |||
587aa7e304 | |||
bacaf4df44 | |||
1da65002ba | |||
11dc28cea3 | |||
8c21b7126a | |||
7da5b74811 | |||
893391cc3b | |||
20c2bfdbef | |||
4e40ae2b1d | |||
52fc7597ca | |||
f176bf6f56 | |||
67c7a0ef49 | |||
04a12487c0 | |||
4305ed8bd9 | |||
2f66dbc882 | |||
9d8e885aec | |||
fbbc5195f7 | |||
72109ba7b6 | |||
f263431ab1 | |||
fae20e6a71 | |||
706fe7855f | |||
f5e5357de7 | |||
cb434e1180 | |||
df9bf1f5e9 | |||
a0754c5397 | |||
997e176017 | |||
8f9da1cf83 | |||
6b29e84fda | |||
317f2db41f | |||
2c7400d446 | |||
9549a30646 | |||
77b4802177 | |||
7f9b132db9 | |||
58745e7a4d | |||
1d9d2f798c | |||
8e11109e6f | |||
2f6c263221 | |||
b8d46f0cee | |||
70367ebff8 | |||
c60876d078 | |||
e391ce4cd3 | |||
f28f625a93 | |||
bfc4a0198d | |||
9436578123 | |||
fd88141567 | |||
2c10272d01 | |||
a6bb4625d7 | |||
cb1c236f5c | |||
466c3c073d | |||
56f1ce20a1 | |||
119df317f2 | |||
532cb88cf0 | |||
b5f5c95680 | |||
9d0cfca668 | |||
4c02dfd878 | |||
83655d42a5 | |||
e4bc989560 | |||
05dae25ae7 | |||
f500aae1e7 | |||
adcf084901 | |||
3cabca0a7a | |||
6d6ee93d7c | |||
7663e0aa72 | |||
70518c3d9a | |||
26f49c9bc6 | |||
76dc31a30c | |||
3bdcc831c4 | |||
a2795d4691 | |||
fa55cc17d1 | |||
7f66d28d56 | |||
de76161779 | |||
b935a35165 | |||
e1fad67e75 | |||
063369866e | |||
1f6bcaabdf | |||
1ee3fb8bed | |||
a0bd5f7304 | |||
534f39c6a7 | |||
6cb067ce06 | |||
c8aba156f7 | |||
53693bdeba | |||
2dd35ecb40 | |||
c278fb2454 | |||
ab0d82e7f5 | |||
f726b3c6d4 | |||
300aa903bd | |||
e332fa127f | |||
6653bed2eb | |||
3f822852bf | |||
3e71fee21c | |||
3a8b1a2cd7 | |||
bfe8934e88 | |||
6b737583ee | |||
108c8005d4 | |||
75830aa8bc | |||
7e8f89418c | |||
6f94d01850 | |||
bd9c837102 | |||
d29ac4215c | |||
a548bac591 | |||
0f22978db4 | |||
4b8567131f | |||
6c0c6508ab | |||
08b48b842f | |||
6e2f615551 | |||
fed14313e4 | |||
9c7c381849 |
5
.gitattributes
vendored
@ -1,3 +1,4 @@
|
||||
Dockerfile linguist-documentation=false
|
||||
.husky/* linguist-vendored
|
||||
*.md linguist-detectable=true
|
||||
|
||||
*.svg linguist-language=md
|
||||
*.md linguist-detectable=true
|
||||
|
5
.github/FUNDING.yml
vendored
@ -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"]
|
33
.github/workflows/ci.yml
vendored
@ -9,13 +9,14 @@ jobs:
|
||||
if: github.repository == 'jaywcjlove/reference'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
- run: cp -rp icons ./dist
|
||||
|
||||
- name: Generate Contributors Images
|
||||
uses: jaywcjlove/github-action-contributors@main
|
||||
@ -29,6 +30,7 @@ jobs:
|
||||
uses: jaywcjlove/github-action-modify-file-content@main
|
||||
with:
|
||||
path: CONTRIBUTING.md
|
||||
trim_whitespace: false
|
||||
body: |
|
||||
${{steps.contributors.outputs.htmlList}}
|
||||
|
||||
@ -36,6 +38,7 @@ jobs:
|
||||
uses: jaywcjlove/github-action-modify-file-content@main
|
||||
with:
|
||||
path: README.md
|
||||
trim_whitespace: false
|
||||
body: |
|
||||
${{steps.contributors.outputs.htmlList}}
|
||||
|
||||
@ -74,7 +77,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 +87,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: |
|
||||
[](https://jaywcjlove.github.io/#/sponsor)
|
||||
|
||||
@ -124,15 +129,17 @@ jobs:
|
||||
```
|
||||
|
||||
# Create Docker Image
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- 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: .
|
||||
@ -140,7 +147,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
|
||||
|
8
.github/workflows/win.yml
vendored
@ -9,10 +9,10 @@ jobs:
|
||||
if: github.repository == 'jaywcjlove/reference'
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
@ -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
@ -1,4 +1 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx --no-install lint-staged
|
||||
|
@ -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
|
||||
|
11
.refsrc.json
@ -13,6 +13,17 @@
|
||||
"github": {
|
||||
"url": "https://github.com/jaywcjlove/reference"
|
||||
},
|
||||
"favicon": "{{RELATIVE_PATH}}icons/favicon.svg",
|
||||
"meta": [
|
||||
{ "name": "author", "content": "jaywcjlove" },
|
||||
{ "name": "license", "content": "MIT" },
|
||||
{ "name": "funding", "content": "https://jaywcjlove.github.io/#/sponsor" },
|
||||
{ "rel": "apple-touch-icon", "href": "{{RELATIVE_PATH}}icons/touch-icon-iphone.png" },
|
||||
{ "rel": "apple-touch-icon", "sizes": "152x152", "href": "{{RELATIVE_PATH}}icons/touch-icon-ipad.png" },
|
||||
{ "rel": "apple-touch-icon", "sizes": "180x180", "href": "{{RELATIVE_PATH}}icons/touch-icon-iphone.png" },
|
||||
{ "rel": "apple-touch-icon", "sizes": "167x167", "href": "{{RELATIVE_PATH}}icons/touch-icon-ipad-retina.png" },
|
||||
{ "rel": "apple-touch-icon", "sizes": "120x120", "href": "{{RELATIVE_PATH}}icons/touch-icon-iphone-retina.png" }
|
||||
],
|
||||
"giscus": {
|
||||
"src": "https://giscus.app/client.js",
|
||||
"data-repo": "jaywcjlove/reference",
|
||||
|
647
CONTRIBUTING.md
@ -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
|
||||
@ -147,7 +264,7 @@ REF_LABEL=网站首页
|
||||
- [linzhe.top](https://linzhe.top/)
|
||||
- [xushanxiang.com](https://xushanxiang.com/ref/)
|
||||
- [winnerzr01.github.io](https://winnerzr01.github.io/Quick-Reference/index.html)
|
||||
- [hestudio.org](https://quickref.hestudio.org)
|
||||
- [quickref.hestudio.net](https://quickref.hestudio.net)
|
||||
- [surcode.cn](https://ref.surcode.cn)
|
||||
- [cms.im](https://quickref.cms.im/)
|
||||
- [nuomiphp.com](https://reference.tool.nuomiphp.com/)
|
||||
@ -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,348 +328,189 @@ 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/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/Alex-Programmer-Bro" title="Alex">
|
||||
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
|
||||
</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/LufsX" title="LufsX">
|
||||
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
|
||||
</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/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/mailbaoer" title="baoer">
|
||||
<img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/>
|
||||
</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/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/undefined-hestudio" title="undefined">
|
||||
<img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"/>
|
||||
</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/XYZscratcher" title="XYZ">
|
||||
<img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/>
|
||||
</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/mancuoj" title="mancuoj">
|
||||
<img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/>
|
||||
</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/partoneplay" title="partoneplay">
|
||||
<img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/>
|
||||
</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/catcto" title="catcto">
|
||||
<img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="catcto"/>
|
||||
</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/wsypower" title="魏">
|
||||
<img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/>
|
||||
</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/dousha0w0" title="dousha0w0">
|
||||
<img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/>
|
||||
</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/ch3nnn" title="chentong">
|
||||
<img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="chentong"/>
|
||||
</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/ohto-ai" title="Choo">
|
||||
<img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/>
|
||||
</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/dasferco" title="Dasferco">
|
||||
<img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/>
|
||||
</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/eeeeeio" title="EEEEE">
|
||||
<img src="https://avatars.githubusercontent.com/u/20723545?v=4" width="42;" alt="EEEEE"/>
|
||||
</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/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/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/Ding-Kyoma" title="HooinKyoma">
|
||||
<img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/>
|
||||
</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/JetSquirrel" title="JetSquirrel">
|
||||
<img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/>
|
||||
</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/Lihuagreek" title="Lihuagreek">
|
||||
<img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/>
|
||||
</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/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/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/Moeyuuko" title="Moeyuuko">
|
||||
<img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/>
|
||||
</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/HanaNoryu" title="Noryu">
|
||||
<img src="https://avatars.githubusercontent.com/u/109856546?v=4" width="42;" alt="Noryu"/>
|
||||
</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/PipecraftNet" title="Pipecraft">
|
||||
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
|
||||
</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/QDelta" title="QDelta">
|
||||
<img src="https://avatars.githubusercontent.com/u/60222316?v=4" width="42;" alt="QDelta"/>
|
||||
</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/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/SkylarLeo" title="SkylarLeo">
|
||||
<img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="SkylarLeo"/>
|
||||
</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/whb1998a" title="WHB">
|
||||
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
|
||||
</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/hi-liyan" title="嘉木旅人">
|
||||
<img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="嘉木旅人"/>
|
||||
</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/dfshizhiqiang" title="Zech">
|
||||
<img src="https://avatars.githubusercontent.com/u/7030019?v=4" width="42;" alt="Zech"/>
|
||||
</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/zhu0629" title="cc">
|
||||
<img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="cc"/>
|
||||
</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/y52y" title="Zyj">
|
||||
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
|
||||
</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/chyok" title="chyok">
|
||||
<img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/>
|
||||
</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/cool9203" title="cool9203">
|
||||
<img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/>
|
||||
</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/fjqz177" title="fjqz177">
|
||||
<img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/>
|
||||
</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/godotc" title="godot42">
|
||||
<img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godot42"/>
|
||||
</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/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/hua03" title="hua03">
|
||||
<img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/>
|
||||
</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/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/liliangrong777" title="liliangrong777">
|
||||
<img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/>
|
||||
</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/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/onewesong" title="onewesong">
|
||||
<img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/>
|
||||
</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/Mowmowj" title="nexo">
|
||||
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/>
|
||||
</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/wannima66" title="tmen">
|
||||
<img src="https://avatars.githubusercontent.com/u/26410255?v=4" width="42;" alt="tmen"/>
|
||||
</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/xing133" title="xing133">
|
||||
<img src="https://avatars.githubusercontent.com/u/5336490?v=4" width="42;" alt="xing133"/>
|
||||
</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/zhouhw0306" title="zhouhw0306">
|
||||
<img src="https://avatars.githubusercontent.com/u/82752681?v=4" width="42;" alt="zhouhw0306"/>
|
||||
</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/lvzhenbo" title="吕振波">
|
||||
<img src="https://avatars.githubusercontent.com/u/32427677?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/ZIDOUZI" title="ZIDOUZI">
|
||||
<img src="https://avatars.githubusercontent.com/u/53157536?v=4" width="42;" alt="ZIDOUZI"/>
|
||||
</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/HuaChan233" title="花开花落">
|
||||
<img src="https://avatars.githubusercontent.com/u/75212820?v=4" width="42;" alt="花开花落"/>
|
||||
</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/qwxingzhe" title="行者">
|
||||
<img src="https://avatars.githubusercontent.com/u/7071651?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/Zeng-qh" title="都一样">
|
||||
<img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/>
|
||||
</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/zhangymPerson" title="zhangym"><img src="https://avatars.githubusercontent.com/u/40376181?v=4" width="42;" alt="zhangym"/></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/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/h7ml" title="h7ml"><img src="https://avatars.githubusercontent.com/u/55233292?v=4" width="42;" alt="h7ml"/></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/aixcyi" title="阿羽"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="阿羽"/></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/alex-reinfoce" title="Alex"><img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/></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/richuff" title="richuff"><img src="https://avatars.githubusercontent.com/u/162144087?v=4" width="42;" alt="richuff"/></a>
|
||||
<a href="https://github.com/Harris-H" title="Hao He"><img src="https://avatars.githubusercontent.com/u/57698783?v=4" width="42;" alt="Hao He"/></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/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/Willxup" title="Will"><img src="https://avatars.githubusercontent.com/u/51990395?v=4" width="42;" alt="Will"/></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/chaos-cn" title="chaos"><img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/></a>
|
||||
<a href="https://github.com/QinIndexCode" title="fault"><img src="https://avatars.githubusercontent.com/u/177287013?v=4" width="42;" alt="fault"/></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/wangdaodao" title="王叨叨"><img src="https://avatars.githubusercontent.com/u/2317442?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/buyfakett" title="buyfakett"><img src="https://avatars.githubusercontent.com/u/46560426?v=4" width="42;" alt="buyfakett"/></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/zine0" title="zine yu"><img src="https://avatars.githubusercontent.com/u/46991452?v=4" width="42;" alt="zine yu"/></a>
|
||||
<a href="https://github.com/witt-bit" title="witt"><img src="https://avatars.githubusercontent.com/u/52407727?v=4" width="42;" alt="witt"/></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="佐博"><img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="佐博"/></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/AmosHuKe" title="Amos"><img src="https://avatars.githubusercontent.com/u/32262985?v=4" width="42;" alt="Amos"/></a>
|
||||
<a href="https://github.com/qjksxy" title="Apin"><img src="https://avatars.githubusercontent.com/u/81305669?v=4" width="42;" alt="Apin"/></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/Kisa-Dong" title="Kisa-Dong"><img src="https://avatars.githubusercontent.com/u/84782008?v=4" width="42;" alt="Kisa-Dong"/></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/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></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/SuperDiscovery" title="SuperDiscovery"><img src="https://avatars.githubusercontent.com/u/49646863?v=4" width="42;" alt="SuperDiscovery"/></a>
|
||||
<a href="https://github.com/ThanatosXingYu" title="Thanatos"><img src="https://avatars.githubusercontent.com/u/53430376?v=4" width="42;" alt="Thanatos"/></a>
|
||||
<a href="https://github.com/izven" title="Zhang"><img src="https://avatars.githubusercontent.com/u/2149051?v=4" width="42;" alt="Zhang"/></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/hweining" title="hweining"><img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/></a>
|
||||
<a href="https://github.com/icer233" title="icer"><img src="https://avatars.githubusercontent.com/u/74440627?v=4" width="42;" alt="icer"/></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="J.Chen"><img src="https://avatars.githubusercontent.com/u/61578993?v=4" width="42;" alt="J.Chen"/></a>
|
||||
<a href="https://github.com/jldxpm" title="jldxjldx"><img src="https://avatars.githubusercontent.com/u/128905630?v=4" width="42;" alt="jldxjldx"/></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/kcmeven" title="Evan-k"><img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="Evan-k"/></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="yujian(larry) xue"><img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="yujian(larry) xue"/></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/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></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/yanxuplay" title="hupilan"><img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/></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/godot42x" 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/fenglielie" title="fenglielie"><img src="https://avatars.githubusercontent.com/u/51266402?v=4" width="42;" alt="fenglielie"/></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/emoji-share" title="emoji-share🤪"><img src="https://avatars.githubusercontent.com/u/192275245?v=4" width="42;" alt="emoji-share🤪"/></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="Coder Duan"><img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="Coder Duan"/></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/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
|
||||
<a href="https://github.com/binscor" title="binscor"><img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="binscor"/></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/lisheng741" title="芦荟柚子茶"><img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/></a>
|
||||
<a href="https://github.com/rainbowatcher" title="rainbowatcher"><img src="https://avatars.githubusercontent.com/u/42316353?v=4" width="42;" alt="rainbowatcher"/></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/sundakai" title="永恒"><img src="https://avatars.githubusercontent.com/u/21995250?v=4" width="42;" alt="永恒"/></a>
|
||||
<a href="https://github.com/LongYinStudio" title="敬培全"><img src="https://avatars.githubusercontent.com/u/42208852?v=4" width="42;" alt="敬培全"/></a>
|
||||
<a href="https://github.com/Fengjing95" title="小枫"><img src="https://avatars.githubusercontent.com/u/51731411?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/kele527" title="吹衣轻飏"><img src="https://avatars.githubusercontent.com/u/345445?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="Xianxin Zeng"><img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="Xianxin Zeng"/></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/giteeking" title="xunjian"><img src="https://avatars.githubusercontent.com/u/166626162?v=4" width="42;" alt="xunjian"/></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-fs"><img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift-fs"/></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/shanhai1024" title="shanhai1024"><img src="https://avatars.githubusercontent.com/u/56210461?v=4" width="42;" alt="shanhai1024"/></a>
|
||||
<a href="https://github.com/ri-fumo" title="ri-fumo"><img src="https://avatars.githubusercontent.com/u/190000479?v=4" width="42;" alt="ri-fumo"/></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/openapphub" title="openapphub"><img src="https://avatars.githubusercontent.com/u/175949671?v=4" width="42;" alt="openapphub"/></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/zlfyuan" title="bgbgPang"><img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/></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/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/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/likeadmin-likeshop" title="likeadmin通过管理后台-likeshop全开源商城"><img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="likeadmin通过管理后台-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/Furry-Monster" title="Furry-Monster"><img src="https://avatars.githubusercontent.com/u/158404543?v=4" width="42;" alt="Furry-Monster"/></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/daining810" title="dain"><img src="https://avatars.githubusercontent.com/u/125986872?v=4" width="42;" alt="dain"/></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/JinchuanL" title="ANDY"><img src="https://avatars.githubusercontent.com/u/68026794?v=4" width="42;" alt="ANDY"/></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/HeZephyr" title="Zephyr He"><img src="https://avatars.githubusercontent.com/u/67893254?v=4" width="42;" alt="Zephyr He"/></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/zkassing" title="You Kuan Zhang"><img src="https://avatars.githubusercontent.com/u/13414184?v=4" width="42;" alt="You Kuan Zhang"/></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="shawing"><img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="shawing"/></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/Qliangw" title="Qliangw"><img src="https://avatars.githubusercontent.com/u/22791711?v=4" width="42;" alt="Qliangw"/></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="ZhaoChunhuan"><img src="https://avatars.githubusercontent.com/u/67987641?v=4" width="42;" alt="ZhaoChunhuan"/></a>
|
||||
<a href="https://github.com/PILIHU2022" title="Spark"><img src="https://avatars.githubusercontent.com/u/100511118?v=4" width="42;" alt="Spark"/></a>
|
||||
<a href="https://github.com/Noryu-01" 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/Mieriki" title="Mieriki"><img src="https://avatars.githubusercontent.com/u/142009318?v=4" width="42;" alt="Mieriki"/></a>
|
||||
|
||||
|
||||
<!--GAMFC-END-->
|
||||
|
||||
上图贡献者列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 自动生成贡献者图片。
|
||||
|
||||
|
BIN
appicon/audioer.png
Executable file
After Width: | Height: | Size: 50 KiB |
BIN
appicon/copybook-generator.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
appicon/create-custom-symbols.png
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
appicon/daybar.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
appicon/devhub.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
appicon/devtutor.png
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
appicon/file-sentinel.png
Executable file
After Width: | Height: | Size: 17 KiB |
BIN
appicon/focus-cursor.png
Executable file
After Width: | Height: | Size: 92 KiB |
BIN
appicon/hosts-editor.png
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
appicon/iconed.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
appicon/iconize-folder.png
Normal file
After Width: | Height: | Size: 120 KiB |
BIN
appicon/key-clicker.png
Normal file
After Width: | Height: | Size: 109 KiB |
BIN
appicon/mousio.png
Executable file
After Width: | Height: | Size: 27 KiB |
BIN
appicon/musicer.png
Executable file
After Width: | Height: | Size: 128 KiB |
BIN
appicon/npmd.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
appicon/palette-genius.png
Normal file
After Width: | Height: | Size: 249 KiB |
BIN
appicon/paste-quick.png
Normal file
After Width: | Height: | Size: 136 KiB |
BIN
appicon/quick-rss.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
appicon/regex-mate.png
Normal file
After Width: | Height: | Size: 314 KiB |
BIN
appicon/resume-revise.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
appicon/rightmenu-master.png
Normal file
After Width: | Height: | Size: 111 KiB |
BIN
appicon/symbol-scribe.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
appicon/textsound-saver.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
appicon/time-passage.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
appicon/videoer.png
Executable file
After Width: | Height: | Size: 52 KiB |
BIN
appicon/web-serve.png
Normal file
After Width: | Height: | Size: 141 KiB |
13
assets/bun.svg
Normal 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 |
2
assets/canvas.svg
Normal file
@ -0,0 +1,2 @@
|
||||
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="1em" height="1em"><path d="M861.098667 736.554667l73.472 146.261333a38.4 38.4 0 0 1-1.706667 37.546667 38.826667 38.826667 0 0 1-32.981333 18.304H512a38.741333 38.741333 0 0 1-33.066667-18.261334 38.4 38.4 0 0 1-1.664-37.589333l10.752-21.333333H221.098667a58.026667 58.026667 0 0 1-58.197334-57.941334V474.453333C116.096 439.168 85.333333 383.829333 85.333333 321.024 85.333333 214.570667 172.373333 128 279.253333 128c63.146667 0 118.698667 30.592 154.154667 77.226667h369.493333a58.026667 58.026667 0 0 1 58.197334 57.898666v473.429334zm-155.178667-136.192-131.157333 261.12h262.357333l-131.2-261.12zM240.469333 510.122667v274.133333h286.336l144.426667-287.488c13.184-26.154667 56.234667-26.154667 69.376 0l42.922667 85.333333V282.453333h-314.282667a192.64 192.64 0 0 1-52.992 174.933334 194.773333 194.773333 0 0 1-175.786667 52.778666zm38.826667-73.301334a116.053333 116.053333 0 0 0 116.352-115.797333A116.053333 116.053333 0 0 0 279.253333 205.226667a116.053333 116.053333 0 0 0-116.352 115.797333 116.053333 116.053333 0 0 0 116.352 115.797333z"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
5
assets/chatgpt.svg
Normal 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 |
1
assets/chown.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 1024 1024" version="1.1" fill="currentColor" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em"><path d="M912.9 130.6c-26.1 4.5-52.8 6.9-80.2 6.9-115.4 0-221.1-41.9-302.6-111.2-10.6-9-26.2-9-36.8 0-81.5 69.4-187.2 111.2-302.6 111.2-27 0-53.5-2.3-79.2-6.7-17.2-2.9-32.9 10.4-33 27.9-0.2 109.1-0.4 238.1-0.4 242.5 0 471 394.5 592.7 431 603 1.8 0.5 3.6 0.5 5.4 0C550.9 994 943 873 945.5 405.7l0.4-247c0-17.6-15.8-31.1-33-28.1zM546 568.9v154.5c0 18.8-15.2 34-34 34s-34-15.2-34-34V568.9c-68.2-15.5-119.1-76.4-119.1-149.3 0-84.5 68.5-153.1 153.1-153.1S665.1 335 665.1 419.6c0 72.9-50.9 133.9-119.1 149.3z"></path></svg>
|
After Width: | Height: | Size: 640 B |
3
assets/docker-compose.svg
Normal 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
@ -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
@ -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
@ -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
@ -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
@ -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 |
3
assets/github-cli.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 1984 2048" height="1em" width="1em">
|
||||
<path d="M663.6 1589.6c0 8-9.2 14.4-20.8 14.4-13.2 1.2-22.4-5.2-22.4-14.4 0-8 9.2-14.4 20.8-14.4 12-1.2 22.4 5.2 22.4 14.4zm-124.4-18c-2.8 8 5.2 17.2 17.2 19.6 10.4 4 22.4 0 24.8-8s-5.2-17.2-17.2-20.8c-10.4-2.8-22 1.2-24.8 9.2zm176.8-6.8c-11.6 2.8-19.6 10.4-18.4 19.6 1.2 8 11.6 13.2 23.6 10.4 11.6-2.8 19.6-10.4 18.4-18.4-1.2-7.6-12-12.8-23.6-11.6zM979.2 32C424.4 32 0 453.2 0 1008c0 443.6 279.2 823.2 678 956.8 51.2 9.2 69.2-22.4 69.2-48.4 0-24.8-1.2-161.6-1.2-245.6 0 0-280 60-338.8-119.2 0 0-45.6-116.4-111.2-146.4 0 0-91.6-62.8 6.4-61.6 0 0 99.6 8 154.4 103.2 87.6 154.4 234.4 110 291.6 83.6 9.2-64 35.2-108.4 64-134.8-223.6-24.8-449.2-57.2-449.2-442 0-110 30.4-165.2 94.4-235.6-10.4-26-44.4-133.2 10.4-271.6 83.6-26 276 108 276 108 80-22.4 166-34 251.2-34s171.2 11.6 251.2 34c0 0 192.4-134.4 276-108 54.8 138.8 20.8 245.6 10.4 271.6 64 70.8 103.2 126 103.2 235.6 0 386-235.6 416.8-459.2 442 36.8 31.6 68 91.6 68 185.6 0 134.8-1.2 301.6-1.2 334.4 0 26 18.4 57.6 69.2 48.4 400-132.8 671.2-512.4 671.2-956 0-554.8-450-976-1004.8-976zM388.8 1411.6c-5.2 4-4 13.2 2.8 20.8 6.4 6.4 15.6 9.2 20.8 4 5.2-4 4-13.2-2.8-20.8-6.4-6.4-15.6-9.2-20.8-4zm-43.2-32.4c-2.8 5.2 1.2 11.6 9.2 15.6 6.4 4 14.4 2.8 17.2-2.8 2.8-5.2-1.2-11.6-9.2-15.6-8-2.4-14.4-1.2-17.2 2.8zm129.6 142.4c-6.4 5.2-4 17.2 5.2 24.8 9.2 9.2 20.8 10.4 26 4 5.2-5.2 2.8-17.2-5.2-24.8-8.8-9.2-20.8-10.4-26-4zm-45.6-58.8c-6.4 4-6.4 14.4 0 23.6 6.4 9.2 17.2 13.2 22.4 9.2 6.4-5.2 6.4-15.6 0-24.8-5.6-9.2-16-13.2-22.4-8z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
4
assets/github-copilot.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="1em" height="1em" viewBox="0 0 600 528" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M300.05 526.091C129.331 526.091 5.42623 417.044 0.748474 385.796V312.898C3.92935 289.397 26.0832 249.805 60.1747 235.622C60.6612 233.002 61.0728 230.27 61.5219 227.464C62.6071 220.615 63.7672 213.094 66.237 204.561C58.7152 185.551 56.7318 163.996 56.7318 142.59C56.7318 110.033 61.5219 76.3908 82.6653 49.6341C104.333 22.2037 138.574 7.57172 184.603 2.4449C229.734 -2.56966 269.252 3.71724 294.773 31.0728C296.645 33.0561 298.366 35.1143 299.975 37.2474C301.622 35.1143 303.493 33.0561 305.326 31.0728C330.848 3.71724 370.366 -2.56966 415.497 2.4449C461.526 7.57172 495.767 22.2037 517.435 49.6341C538.615 76.3908 543.368 110.033 543.368 142.59C543.368 163.996 541.385 185.551 533.863 204.561C536.333 213.094 537.53 220.615 538.578 227.464C539.027 230.308 539.476 233.002 539.963 235.622C574.541 250.029 596.919 290.669 599.501 314.021V384.075C599.501 412.74 474.1 526.091 300.05 526.091ZM300.05 470.52C385.372 470.52 471.593 428.981 487.235 416.894V257.663L486.374 253.322C468.037 261.181 446.146 264.212 421.746 264.212C378.861 264.212 344.694 251.975 320.333 227.127C312.303 218.871 305.498 209.508 300.125 199.322C294.697 209.512 287.842 218.875 279.767 227.127C255.443 251.975 221.277 264.212 178.353 264.212C153.954 264.212 132.1 261.181 113.726 253.322L112.865 257.663V416.894C128.545 428.981 214.728 470.52 300.05 470.52ZM253.796 69.3555C246.574 61.6466 229.958 53.9002 190.852 58.2412C152.719 62.4698 135.505 73.3597 126.748 84.4366C117.505 96.1123 112.94 113.963 112.94 142.59C112.94 172.266 117.767 186.412 124.466 193.896C130.528 200.669 143.888 208.079 178.428 208.079C210.349 208.079 228.536 199.285 239.726 187.871C251.514 175.821 259.447 156.923 262.815 129.755C267.193 94.7651 261.43 77.5509 253.796 69.3555ZM409.285 58.2412C370.216 53.9002 353.601 61.6466 346.378 69.3555C338.744 77.5509 332.944 94.7651 337.322 129.755C340.728 156.923 348.661 175.821 360.449 187.871C371.638 199.285 389.788 208.079 421.746 208.079C456.25 208.079 469.647 200.669 475.709 193.896C482.408 186.412 487.235 172.266 487.235 142.59C487.235 113.963 482.632 96.1123 473.389 84.4366C464.669 73.3597 447.455 62.4698 409.285 58.2412Z"/>
|
||||
<path d="M234.636 301.634C242.08 301.634 249.219 304.591 254.482 309.855C259.746 315.118 262.703 322.257 262.703 329.701V385.871C262.703 393.315 259.746 400.454 254.482 405.717C249.219 410.981 242.08 413.938 234.636 413.938C227.193 413.938 220.054 410.981 214.79 405.717C209.527 400.454 206.57 393.315 206.57 385.871V329.701C206.57 322.257 209.527 315.118 214.79 309.855C220.054 304.591 227.193 301.634 234.636 301.634ZM393.68 329.701V385.871C393.68 393.315 390.723 400.454 385.459 405.717C380.196 410.981 373.057 413.938 365.613 413.938C358.17 413.938 351.031 410.981 345.767 405.717C340.504 400.454 337.547 393.315 337.547 385.871V329.701C337.547 322.257 340.504 315.118 345.767 309.855C351.031 304.591 358.17 301.634 365.613 301.634C373.057 301.634 380.196 304.591 385.459 309.855C390.723 315.118 393.68 322.257 393.68 329.701Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
8
assets/jupyter.svg
Normal file
@ -0,0 +1,8 @@
|
||||
<svg viewBox="0 0 256 300" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" height="1em" width="1em">
|
||||
<path d="M10.584 156.41v-32.753h7.136v35.256a21.302 21.302 0 0 1-4.686 15.976A18.213 18.213 0 0 1 .89 179.31l-.745-5.325a11.61 11.61 0 0 0 7.775-2.982c1.917-2.237 2.663-5.273 2.663-14.592Zm53.22-4.201c0 3.994 0 7.562.32 10.651h-6.338l-.426-6.337a14.752 14.752 0 0 1-12.941 7.242c-6.178 0-13.527-3.355-13.527-17.041v-22.74h7.136v21.302c0 7.402 2.29 12.355 8.734 12.355a9.958 9.958 0 0 0 10.065-10.065v-23.859h7.136v28.279l-.16.213Zm13.527-15.555c0-4.953 0-9-.32-12.675h6.39l.32 6.657a15.445 15.445 0 0 1 13.953-7.562c9.48 0 16.616 7.935 16.616 19.757 0 13.953-8.574 20.877-17.84 20.877a13.794 13.794 0 0 1-12.09-6.125v21.302h-7.03v-42.231Zm7.03 10.385c.019.966.126 1.928.319 2.875a10.97 10.97 0 0 0 10.651 8.255c7.509 0 11.93-6.124 11.93-15.018 0-7.775-4.155-14.432-11.664-14.432a12.249 12.249 0 0 0-11.237 11.663v6.657Zm42.644-23.095 8.574 22.953a132.673 132.673 0 0 1 2.503 7.935c.745-2.344 1.544-5.326 2.503-8.095l7.775-22.793h7.509l-10.651 27.692c-5.326 13.314-8.574 20.184-13.474 24.338a19.385 19.385 0 0 1-8.734 4.58l-1.757-5.965a18.906 18.906 0 0 0 6.23-3.461 21.302 21.302 0 0 0 6.019-7.882c.29-.53.488-1.107.585-1.704a6.125 6.125 0 0 0-.479-1.864l-14.485-35.84h7.775l.107.106Zm47.809-11.173v11.183h10.225v5.326h-10.225v20.983c0 4.793 1.384 7.562 5.325 7.562 1.4.023 2.796-.138 4.154-.48l.32 5.326a17.575 17.575 0 0 1-6.338.959 9.906 9.906 0 0 1-7.722-2.983 14.326 14.326 0 0 1-2.77-10.118v-21.302h-6.07V123.9h6.177v-9.48l6.924-1.65Zm23.37 31.877a12.516 12.516 0 0 0 13.474 13.473 25.988 25.988 0 0 0 10.651-2.024l1.225 5.326a31.953 31.953 0 0 1-13.048 2.396 18.106 18.106 0 0 1-19.278-19.598c0-11.716 6.976-20.982 18.373-20.982 12.781 0 15.977 11.183 15.977 18.32.068 1.1.068 2.202 0 3.302h-27.533l.16-.213Zm20.877-5.326a10.064 10.064 0 0 0-9.906-11.503 11.77 11.77 0 0 0-10.917 11.503h20.823Zm17.324-3.269c0-4.58 0-8.52-.32-12.142h6.391v7.616h.32a11.77 11.77 0 0 1 10.651-8.521 7.775 7.775 0 0 1 2.024 0v6.657a10.645 10.645 0 0 0-2.45 0 9.958 9.958 0 0 0-9.533 9.053 19.772 19.772 0 0 0-.32 3.302v20.716h-7.029v-26.627l.266-.054Z" fill="#4E4E4E"/>
|
||||
<path d="M233.258 16.962a18.053 18.053 0 1 1-18.8-16.935 17.84 17.84 0 0 1 18.8 16.935Z" fill="#767677"/>
|
||||
<path d="M127.953 225.541c-47.93 0-90.055-17.201-111.836-42.604a119.239 119.239 0 0 0 223.672 0c-21.728 25.403-63.693 42.604-111.836 42.604Zm0-165.187c47.93 0 90.055 17.202 111.836 42.604a119.243 119.243 0 0 0-111.836-77.88 119.239 119.239 0 0 0-111.836 77.88c21.781-25.455 63.694-42.604 111.836-42.604Z" fill="#F37726"/>
|
||||
<path d="M61.972 274.975a22.74 22.74 0 1 1-23.699-21.302 22.527 22.527 0 0 1 23.699 21.302Z" fill="#9E9E9E"/>
|
||||
<path d="M21.564 54.565a13.102 13.102 0 1 1 12.728-13.633 13.26 13.26 0 0 1-12.728 13.633Z" fill="#616262"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
5
assets/minio.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 162.612 24.465" xmlns:v="https://vecta.io/nano">
|
||||
<path
|
||||
d="M52.751.414h9.108v23.63h-9.108zM41.711.74l-18.488 9.92a.919.919 0 0 1-.856 0L3.879.74A2.808 2.808 0 0 0 2.558.414h-.023A2.4 2.4 0 0 0 0 2.641v21.376h9.1V13.842a.918.918 0 0 1 1.385-.682l10.361 5.568a3.634 3.634 0 0 0 3.336.028l10.933-5.634a.917.917 0 0 1 1.371.69v10.205h9.1V2.641A2.4 2.4 0 0 0 43.055.414h-.023a2.808 2.808 0 0 0-1.321.326zm65.564-.326h-9.237v10.755a.913.913 0 0 1-1.338.706L72.762.675a2.824 2.824 0 0 0-1.191-.261h-.016a2.4 2.4 0 0 0-2.535 2.227v21.377h9.163V13.275a.914.914 0 0 1 1.337-.707l24.032 11.2a2.813 2.813 0 0 0 1.188.26 2.4 2.4 0 0 0 2.535-2.227zm7.161 23.63V.414h4.191v23.63zm28.856.421c-11.274 0-19.272-4.7-19.272-12.232C124.02 4.741 132.066 0 143.292 0s19.32 4.7 19.32 12.233-7.902 12.232-19.32 12.232zm0-21.333c-8.383 0-14.84 3.217-14.84 9.1 0 5.926 6.457 9.1 14.84 9.1s14.887-3.174 14.887-9.1c0-5.883-6.504-9.1-14.887-9.1z"
|
||||
fill="#c72c48" />
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
1
assets/neo4j.svg
Normal 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
@ -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
@ -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
@ -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
@ -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 |
5
assets/powershell.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" height="1em" width="1em">
|
||||
<path d="m64 10.5-7.11 42a4.64 4.64 0 0 1-4.62 3.5H4.44C2.24 56 .72 54.43 1 52.5l7.11-42a3.93 3.93 0 0 1 1.3-2.19A5 5 0 0 1 12.73 7h47.83a3.25 3.25 0 0 1 3.35 2.32A2.73 2.73 0 0 1 64 10.5z" fill="#0078d7"/>
|
||||
<path fill="#fff" d="M17.72 49.6a2.43 2.43 0 0 1-1.45-4.38l20.54-15.11L22 16.18a2.42 2.42 0 0 1-.1-3.43 2.45 2.45 0 0 1 3.45-.1l17 15.92a2.42 2.42 0 0 1-.22 3.72L19.17 49.13a2.44 2.44 0 0 1-1.45.47zm26.87.4H33.41a2.5 2.5 0 0 1 0-5h11.18a2.5 2.5 0 0 1 0 5z"/>
|
||||
<path fill="#fff" d="m63.91 9.32-7.06 42.27a4 4 0 0 1-.95 2C44.76 42.64 21.52 19.89 9.41 8.31A5 5 0 0 1 12.73 7h47.83a3.25 3.25 0 0 1 3.35 2.32z" opacity=".25"/>
|
||||
</svg>
|
After Width: | Height: | Size: 760 B |
1
assets/r.svg
Normal 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
@ -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
@ -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 |
25
assets/sqlite.svg
Normal file
@ -0,0 +1,25 @@
|
||||
<svg viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em">
|
||||
<g clip-path="url(#a)">
|
||||
<path
|
||||
d="M60 0C26.863 0 0 26.863 0 60v136c0 33.137 26.863 60 60 60h108.46c-1.779-5.243-3.172-13.546-3.956-23.023-.675-8.152-.899-17.171-.525-25.87-.101-1.286-.162-2.122-.162-2.122s-1.874-12.61-4.571-22.969c-1.194-4.598-2.553-8.756-3.98-11.166-.735-1.243.08-6.351 2.131-13.916 1.2 2.071 6.263 10.932 7.28 13.788 1.145 3.228 1.385 4.153 1.385 4.153s-2.777-14.272-7.333-22.6a303.417 303.417 0 0 1 3.542-11.066c1.578 2.767 5.165 9.121 6.461 12.132.12.279.228.541.307.757.184.522.339.965.478 1.371.731 2.118.909 2.792.909 2.792s-.271-1.386-.775-3.524c-.213-.903-.478-1.965-.773-3.096-1.148-4.409-2.892-10.181-5.125-14.704 5.732-29.794 24.181-68.807 44.057-89.868 1.713-1.814 3.434-3.511 5.158-5.041 11.619-10.3 23.392-13.78 33.115-5.118 7.034 6.267 9.912 14.925 9.917 24.89V60c0-33.137-26.863-60-60-60H60Z"
|
||||
fill="#D9D9D9" />
|
||||
<path
|
||||
d="M60 0C26.863 0 0 26.863 0 60v136c0 33.137 26.863 60 60 60h108.46c-1.779-5.243-3.172-13.546-3.956-23.023-.675-8.152-.899-17.171-.525-25.87-.101-1.286-.162-2.122-.162-2.122s-1.874-12.61-4.571-22.969c-1.194-4.598-2.553-8.756-3.98-11.166-.735-1.243.08-6.351 2.131-13.916 1.2 2.071 6.263 10.932 7.28 13.788 1.145 3.228 1.385 4.153 1.385 4.153s-2.777-14.272-7.333-22.6a303.417 303.417 0 0 1 3.542-11.066c1.578 2.767 5.165 9.121 6.461 12.132.12.279.228.541.307.757.184.522.339.965.478 1.371.731 2.118.909 2.792.909 2.792s-.271-1.386-.775-3.524c-.213-.903-.478-1.965-.773-3.096-1.148-4.409-2.892-10.181-5.125-14.704 5.732-29.794 24.181-68.807 44.057-89.868 1.713-1.814 3.434-3.511 5.158-5.041 11.619-10.3 23.392-13.78 33.115-5.118 7.034 6.267 9.912 14.925 9.917 24.89V60c0-33.137-26.863-60-60-60H60Z"
|
||||
fill="url(#b)" />
|
||||
<path
|
||||
d="M246.083 36.91c-9.723-8.662-21.496-5.183-33.115 5.118-1.724 1.53-3.445 3.227-5.158 5.04-19.876 21.063-38.325 60.075-44.057 89.869 2.233 4.523 3.977 10.295 5.125 14.704.295 1.131.56 2.193.773 3.096.504 2.138.775 3.524.775 3.524s-.178-.674-.909-2.792c-.139-.406-.294-.849-.478-1.371a15.467 15.467 0 0 0-.307-.757c-1.296-3.011-4.883-9.365-6.461-12.132a303.417 303.417 0 0 0-3.542 11.066c4.556 8.328 7.333 22.6 7.333 22.6s-.24-.925-1.385-4.153c-1.017-2.856-6.08-11.717-7.28-13.788-2.051 7.565-2.866 12.673-2.131 13.916 1.427 2.41 2.786 6.568 3.98 11.166 2.697 10.359 4.571 22.969 4.571 22.969s.061.836.162 2.122c-.374 8.699-.15 17.718.525 25.87.893 10.791 2.575 20.062 4.719 25.023l1.455-.793c-3.148-9.774-4.427-22.584-3.867-37.358.847-22.581 6.05-49.813 15.662-78.196 16.24-42.847 38.772-77.224 59.394-93.642-18.796 16.956-44.235 71.839-51.85 92.163-8.526 22.759-14.569 44.117-18.21 64.579 6.283-19.183 26.598-27.429 26.598-27.429s9.964-12.274 21.608-29.81c-6.975 1.589-18.428 4.309-22.265 5.919-5.658 2.371-7.183 3.18-7.183 3.18s18.33-11.15 34.056-16.198c21.628-34.025 45.19-82.362 21.462-103.505M28.52 49c-3.063 0-5.554.895-7.463 2.683-1.91 1.79-2.878 4.137-2.878 7.012 0 1.49.24 2.848.714 4.093.474 1.247 1.212 2.403 2.203 3.447.992 1.045 2.977 2.465 5.936 4.27 3.63 2.186 6.005 3.96 7.145 5.346 1.141 1.385 1.707 2.836 1.707 4.348 0 2.026-.675 3.642-2.064 4.858-1.391 1.215-3.251 1.82-5.558 1.82-2.433 0-4.552-.845-6.372-2.526-1.82-1.682-2.738-3.908-2.759-6.698H18V87.78h1.131c.346-.959.824-1.45 1.45-1.45.3 0 1.005.205 2.104.588 2.671.938 4.865 1.39 6.59 1.39 2.971 0 5.508-1.026 7.622-3.114 2.11-2.086 3.176-4.602 3.176-7.54 0-2.278-.704-4.305-2.084-6.071-1.381-1.769-4.066-3.826-8.08-6.19-3.452-2.046-5.694-3.713-6.728-5.013-1.036-1.298-1.568-2.733-1.568-4.309 0-1.704.634-3.072 1.885-4.093 1.252-1.022 2.891-1.528 4.943-1.528 2.309 0 4.233.676 5.756 2.037 1.521 1.363 2.401 3.252 2.66 5.68h1.132v-8.774h-1.053c-.128.447-.247.733-.357.861-.106.128-.311.196-.615.196-.366 0-1.019-.152-1.945-.45-1.985-.66-3.816-.999-5.499-.999Zm36.98 0c-3.733 0-7.121.868-10.183 2.605-3.066 1.734-5.493 4.14-7.285 7.207-1.79 3.066-2.68 6.323-2.68 9.793 0 4.662 1.547 8.816 4.665 12.456 3.12 3.638 6.858 5.905 11.195 6.777.992.51 2.41 1.826 4.268 3.956 2.093 2.404 3.864 4.138 5.32 5.17a16.074 16.074 0 0 0 4.684 2.292c1.661.499 3.457.744 5.4.744 2.351 0 4.457-.403 6.311-1.234l-.416-1.018a10.184 10.184 0 0 1-3.434.568c-1.642 0-3.3-.534-4.963-1.606-1.66-1.075-3.736-3.125-6.213-6.15-1.164-1.45-1.967-2.364-2.421-2.722 4.745-.915 8.648-3.184 11.691-6.816 3.043-3.63 4.565-7.774 4.565-12.417 0-5.514-1.988-10.147-5.935-13.925C76.12 50.9 71.262 49 65.5 49Zm23.085 0 .06 1.195c2.484 0 3.876.722 4.188 2.174.115.52.169 1.478.178 2.86l-.02 26.42c-.02 1.973-.305 3.233-.853 3.78-.549.543-1.476.882-2.819 1.018l-.06 1.195h24.773l.635-5.993h-1.131c-.323 1.632-1.064 2.802-2.243 3.466-1.183.67-3.273 1-6.293 1h-2.342c-2.717 0-4.289-.97-4.704-2.92a6.011 6.011 0 0 1-.12-1.253l.1-26.714c0-1.97.252-3.29.774-3.937.528-.643 1.48-1.004 2.858-1.096L101.507 49H88.585Zm-22.688 1.45c4.21 0 7.647 1.635 10.302 4.935 2.654 3.3 3.97 7.824 3.97 13.553 0 5.428-1.335 9.774-4.01 13.044-2.675 3.268-6.235 4.896-10.66 4.896-4.25 0-7.696-1.679-10.34-5.053-2.643-3.374-3.95-7.755-3.95-13.142 0-5.535 1.323-9.967 3.989-13.279 2.665-3.308 6.233-4.955 10.699-4.955Zm56.968 5.679c-.604 0-1.065.201-1.409.607-.353.404-.461.894-.338 1.489.119.576.449 1.082.973 1.508.521.425 1.083.646 1.687.646.584 0 1.03-.221 1.35-.646.32-.426.417-.931.298-1.508-.124-.595-.442-1.085-.933-1.489-.497-.406-1.044-.607-1.628-.607Zm16.336 4.054c-1.027 3.897-3.252 6.006-6.669 6.346l.039 1.116h3.99l-.079 13.2c.006 2.258.076 3.76.238 4.525.393 1.83 1.605 2.761 3.632 2.761 2.934 0 6.012-1.763 9.23-5.288l-.972-.822c-2.324 2.32-4.379 3.486-6.173 3.486-1.103 0-1.787-.626-2.045-1.86a4.658 4.658 0 0 1-.099-1.058l.04-14.944h6.093l-.059-1.782h-6.015v-5.68h-1.151Zm23.561 4.975c-3.408 0-6.181 1.632-8.336 4.877-2.145 3.25-2.809 6.85-1.965 10.81.496 2.32 1.484 4.12 2.997 5.387 1.51 1.267 3.426 1.9 5.716 1.9 2.133 0 5.103-.534 6.352-1.607 1.253-1.072 2.408-2.81 3.474-5.19l-.854-.881c-1.7 3.087-5.133 4.642-7.721 4.642-3.559 0-5.738-1.927-6.55-5.758a13.745 13.745 0 0 1-.239-1.567c4.234-.662 7.442-1.833 9.608-3.526 2.163-1.693 4.336-3.489 3.93-5.386-.242-1.127-.835-2.013-1.747-2.683-.924-.67-3.324-1.018-4.665-1.018Zm-37.257.137-7.344 1.665v1.292l2.54-.313c1.231 0 1.955.55 2.184 1.645.077.367.125.881.139 1.528l-.08 11.849c-.02 1.64-.205 2.593-.575 2.879-.374.287-1.36.43-2.958.43l-.04 1.117h11.652l-.02-1.116c-1.619 0-2.668-.126-3.136-.372-.46-.245-.776-.69-.913-1.371-.106-.492-.152-1.338-.159-2.507l.04-16.726h-1.33Zm35.392 2.194c.709 0 1.394.27 2.084.802.68.531 1.095 1.122 1.23 1.763.665 3.15-2.166 5.328-8.535 6.542-.182-2.297.222-4.383 1.251-6.268 1.021-1.883 2.351-2.84 3.97-2.84Z"
|
||||
fill="#003B57" />
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="b" x1="147.614" y1="5.239" x2="147.614" y2="241.763"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#97D9F6" />
|
||||
<stop offset=".92" stop-color="#0F80CC" />
|
||||
<stop offset="1" stop-color="#0F80CC" />
|
||||
</linearGradient>
|
||||
<clipPath id="a">
|
||||
<rect width="256" height="256" rx="60" fill="#fff" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.9 KiB |
1
assets/stylex.svg
Normal 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
@ -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 |
4
assets/time-zones.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg viewBox="0 0 1024 1024" fill="currentColor" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em">
|
||||
<path d="M945 412H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h256c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM811 548H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h122c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM477.3 322.5H434c-6.2 0-11.2 5-11.2 11.2v248c0 3.6 1.7 6.9 4.6 9l148.9 108.6c5 3.6 12 2.6 15.6-2.4l25.7-35.1v-.1c3.6-5 2.5-12-2.5-15.6l-126.7-91.6V333.7c.1-6.2-5-11.2-11.1-11.2z"/>
|
||||
<path d="M804.8 673.9H747c-5.6 0-10.9 2.9-13.9 7.7-12.7 20.1-27.5 38.7-44.5 55.7-29.3 29.3-63.4 52.3-101.3 68.3-39.3 16.6-81 25-124 25-43.1 0-84.8-8.4-124-25-37.9-16-72-39-101.3-68.3s-52.3-63.4-68.3-101.3c-16.6-39.2-25-80.9-25-124 0-43.1 8.4-84.7 25-124 16-37.9 39-72 68.3-101.3 29.3-29.3 63.4-52.3 101.3-68.3 39.2-16.6 81-25 124-25 43.1 0 84.8 8.4 124 25 37.9 16 72 39 101.3 68.3 17 17 31.8 35.6 44.5 55.7 3 4.8 8.3 7.7 13.9 7.7h57.8c6.9 0 11.3-7.2 8.2-13.3-65.2-129.7-197.4-214-345-215.7-216.1-2.7-395.6 174.2-396 390.1C71.6 727.5 246.9 903 463.2 903c149.5 0 283.9-84.6 349.8-215.8 3.1-6.1-1.4-13.3-8.2-13.3z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
3
assets/twitter.svg
Normal 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 |
1
assets/zed.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em"><path d="M141.744 113.262C126.017 113.262 113.262 126.008 113.262 141.744L113.262 768.331 56.3 768.331 56.3 141.744C56.3 94.554 94.554 56.3 141.744 56.3L904.837 56.3C942.903 56.3 961.959 102.315 935.044 129.23L465.054 599.228 597.444 599.228 597.444 540.481 654.406 540.481 654.406 613.469C654.406 637.061 635.279 656.191 611.684 656.191L408.088 656.191 310.184 754.091 754.091 754.091 754.091 398.075 811.053 398.075 811.053 754.091C811.053 785.553 785.55 811.053 754.091 811.053L253.221 811.053 153.537 910.737 882.256 910.737C897.983 910.737 910.737 897.992 910.737 882.256L910.737 255.669 967.7 255.669 967.7 882.256C967.7 929.446 929.446 967.7 882.256 967.7L119.163 967.7C81.096 967.7 62.041 921.685 88.956 894.769L557.166 426.556 426.556 426.556 426.556 483.519 369.594 483.519 369.594 412.316C369.594 388.723 388.721 369.594 412.316 369.594L614.128 369.594 713.813 269.909 269.909 269.909 269.909 625.925 212.947 625.925 212.947 269.909C212.947 238.446 238.446 212.947 269.909 212.947L770.775 212.947 870.46 113.262 141.744 113.262Z"></path></svg>
|
After Width: | Height: | Size: 1.1 KiB |
41
docs/adb.md
@ -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 到您的计算机
|
||||
|
@ -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-->
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
|
164
docs/bash.md
@ -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
@ -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)
|
253
docs/canvas.md
Normal file
@ -0,0 +1,253 @@
|
||||
HTML Canvas 备忘清单
|
||||
===
|
||||
|
||||
这份 HTML Canvas 快速参考备忘单列出了常见的 HTML5 Canvas 设计标签,以易读的格式呈现。
|
||||
|
||||
入门
|
||||
---
|
||||
<!--rehype:body-class=cols-4-->
|
||||
|
||||
### 基本设置
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Canvas 示例</title>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="myCanvas" width="500" height="400"
|
||||
style="border:1px solid #000000;">
|
||||
</canvas>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
### 获取上下文
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```js
|
||||
const canvas = document.getElementById("myCanvas");
|
||||
|
||||
const ctx = canvas.getContext("2d");
|
||||
```
|
||||
|
||||
绘制形状
|
||||
---
|
||||
|
||||
### 矩形
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```js
|
||||
ctx.fillStyle = "red";
|
||||
ctx.fillRect(10, 10, 150, 100); // x, y, 宽度, 高度
|
||||
|
||||
ctx.strokeStyle = "blue";
|
||||
ctx.lineWidth = 5;
|
||||
ctx.strokeRect(200, 10, 150, 100); // x, y, 宽度, 高度
|
||||
|
||||
ctx.clearRect(15, 15, 30, 30); // x, y, 宽度, 高度
|
||||
```
|
||||
|
||||
路径
|
||||
---
|
||||
|
||||
### 线条
|
||||
|
||||
```js
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 50); // 起始点
|
||||
ctx.lineTo(200, 50); // 结束点
|
||||
ctx.lineTo(200, 200); // 下一个线条结束点
|
||||
ctx.closePath(); // 将结束点连接到起始点
|
||||
ctx.stroke();
|
||||
```
|
||||
|
||||
### 圆形
|
||||
|
||||
```js
|
||||
ctx.beginPath();
|
||||
// x, y, 半径, 起始角度, 结束角度
|
||||
ctx.arc(150, 150, 75, 0, 2 * Math.PI);
|
||||
ctx.fillStyle = "green";
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
```
|
||||
|
||||
### 弧
|
||||
|
||||
```js
|
||||
ctx.beginPath();
|
||||
// x, y, 半径, 起始角度, 结束角度
|
||||
ctx.arc(150, 150, 75, 0, Math.PI);
|
||||
ctx.stroke();
|
||||
```
|
||||
|
||||
贝塞尔曲线和二次曲线
|
||||
---
|
||||
|
||||
### 二次曲线
|
||||
|
||||
```js
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 250);
|
||||
// cpX, cpY, 终点X, 终点Y
|
||||
ctx.quadraticCurveTo(200, 100, 400, 250);
|
||||
ctx.stroke();
|
||||
```
|
||||
|
||||
### 贝塞尔曲线
|
||||
|
||||
```js
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 300);
|
||||
// cp1X, cp1Y, cp2X, cp2Y, 终点X, 终点Y
|
||||
ctx.bezierCurveTo(150, 100, 350, 500, 450, 300);
|
||||
ctx.stroke();
|
||||
```
|
||||
|
||||
### 文本
|
||||
|
||||
```js
|
||||
ctx.font = "30px Arial";
|
||||
ctx.fillStyle = "black";
|
||||
// 文本, x, y
|
||||
ctx.fillText("Hello Canvas", 10, 50);
|
||||
// 文本, x, y
|
||||
ctx.strokeText("Hello Canvas", 10, 100);
|
||||
```
|
||||
|
||||
### 图像
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
```js
|
||||
const img = new Image();
|
||||
img.src = "path/to/image.jpg";
|
||||
img.onload = () => {
|
||||
ctx.drawImage(img, 10, 10); // img, x, y
|
||||
ctx.drawImage(img, 50, 50, 100, 100); // img, x, y, 宽度, 高度
|
||||
ctx.drawImage(img, 100, 100, 100, 100, 150, 150, 200, 200); // img, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight
|
||||
};
|
||||
```
|
||||
|
||||
变换
|
||||
---
|
||||
|
||||
### 平移
|
||||
|
||||
```js
|
||||
ctx.translate(100, 100); // x, y
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
```
|
||||
|
||||
### 旋转
|
||||
|
||||
```js
|
||||
// 角度(以弧度为单位)
|
||||
ctx.rotate((Math.PI / 180) * 45);
|
||||
ctx.fillRect(100, 100, 50, 50);
|
||||
```
|
||||
|
||||
### 缩放
|
||||
|
||||
```js
|
||||
ctx.scale(2, 2); // x, y
|
||||
ctx.fillRect(50, 50, 50, 50);
|
||||
```
|
||||
|
||||
渐变
|
||||
---
|
||||
|
||||
### 线性渐变
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```js
|
||||
const linearGradient = ctx.createLinearGradient(0, 0, 200, 0); // x0, y0, x1, y1
|
||||
linearGradient.addColorStop(0, "red");
|
||||
linearGradient.addColorStop(1, "blue");
|
||||
ctx.fillStyle = linearGradient;
|
||||
ctx.fillRect(10, 10, 200, 100);
|
||||
```
|
||||
|
||||
### 径向渐变
|
||||
|
||||
```js
|
||||
const radialGradient = ctx.createRadialGradient(75, 50, 5, 90, 60, 100); // x0, y0, r0, x1, y1, r1
|
||||
radialGradient.addColorStop(0, "red");
|
||||
radialGradient.addColorStop(1, "blue");
|
||||
ctx.fillStyle = radialGradient;
|
||||
ctx.fillRect(10, 10, 200, 100);
|
||||
```
|
||||
|
||||
### 图案
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```js
|
||||
const img = new Image();
|
||||
img.src = "path/to/image.jpg";
|
||||
img.onload = () => {
|
||||
// 'repeat', 'repeat-x', 'repeat-y', 'no-repeat'
|
||||
const pattern = ctx.createPattern(img, "repeat");
|
||||
ctx.fillStyle = pattern;
|
||||
ctx.fillRect(0, 0, 300, 300);
|
||||
};
|
||||
```
|
||||
|
||||
### 阴影
|
||||
|
||||
```js
|
||||
ctx.shadowColor = "rgba(0, 0, 0, 0.5)";
|
||||
ctx.shadowBlur = 10;
|
||||
ctx.shadowOffsetX = 5;
|
||||
ctx.shadowOffsetY = 5;
|
||||
|
||||
ctx.fillStyle = "red";
|
||||
ctx.fillRect(100, 100, 100, 100);
|
||||
```
|
||||
|
||||
合成
|
||||
---
|
||||
|
||||
### 全局透明度
|
||||
|
||||
```js
|
||||
ctx.globalAlpha = 0.5;
|
||||
ctx.fillStyle = "red";
|
||||
ctx.fillRect(100, 100, 100, 100);
|
||||
|
||||
ctx.fillStyle = "blue";
|
||||
ctx.fillRect(150, 150, 100, 100);
|
||||
```
|
||||
|
||||
### 全局合成操作
|
||||
|
||||
```js
|
||||
ctx.globalCompositeOperation = "source-over"; // 默认
|
||||
ctx.fillStyle = "red";
|
||||
ctx.fillRect(100, 100, 100, 100);
|
||||
|
||||
ctx.globalCompositeOperation = "destination-over";
|
||||
ctx.fillStyle = "blue";
|
||||
ctx.fillRect(150, 150, 100, 100);
|
||||
```
|
||||
|
||||
### 动画
|
||||
|
||||
```js
|
||||
let x = 0;
|
||||
function draw() {
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.fillStyle = "blue";
|
||||
ctx.fillRect(x, 100, 50, 50);
|
||||
x += 2;
|
||||
requestAnimationFrame(draw);
|
||||
}
|
||||
draw();
|
||||
```
|
||||
|
||||
参考阅读
|
||||
---
|
||||
|
||||
- [MDN 文档](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API)
|
619
docs/chatgpt.md
Normal file
@ -0,0 +1,619 @@
|
||||
ChatGPT
|
||||
===
|
||||
|
||||
此备忘单列出了来自世界各地的提示和提示,说明如何有效使用 ChatGPT。
|
||||
|
||||
入门指南
|
||||
---
|
||||
|
||||
### ChatGPT 介绍
|
||||
|
||||
ChatGPT 是 OpenAI 于 2022 年发布的 AI 聊天机器人,基于 GPT-3.5、GPT-4 等模型,支持自动生成文本、问答、总结和编程等多种语言处理任务。
|
||||
|
||||
- 网址: <https://chatgpt.com/>
|
||||
|
||||
### 国内类似的平台
|
||||
|
||||
- [文心一言(百度)](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-->
|
||||
|
||||
为你的企业或创意命名
|
||||
|
||||
```bash
|
||||
你能帮我为我的科技创业公司起个有创意的名字吗?
|
||||
|
||||
帮我想个朗朗上口的名字给我的面包店。
|
||||
```
|
||||
|
||||
为课程或培训项目创建大纲
|
||||
|
||||
```sh
|
||||
请帮我创建一个面向初学者的网页开发课程大纲。
|
||||
|
||||
能否为客户服务工作坊设计一个培训项目的大纲?
|
||||
```
|
||||
|
||||
提供特定职位的面试问题
|
||||
|
||||
```sh
|
||||
我在面试软件工程师职位,你能给我一些面试问题吗?
|
||||
|
||||
请给我一些常见的市场经理面试问题。
|
||||
```
|
||||
|
||||
为商业伙伴、客户或客户提供礼物创意
|
||||
|
||||
```sh
|
||||
我需要一些送给客户的礼物创意,你能帮忙吗?
|
||||
|
||||
有什么独特的礼物可以送给我的商业伙伴?
|
||||
```
|
||||
|
||||
从一长串名字或邮箱中随机挑选比赛获奖者
|
||||
|
||||
```sh
|
||||
我想从100个名字中挑选一位获奖者,你能帮忙吗?
|
||||
|
||||
能帮我从1000个邮箱中随机挑选5个用于赠品抽奖吗?
|
||||
```
|
||||
|
||||
### 编程
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
解释代码为什么无法正常工作
|
||||
|
||||
```js
|
||||
为什么这段代码不能运行?
|
||||
var x = 5;
|
||||
var y = 0;
|
||||
console.log(x/y);
|
||||
```
|
||||
|
||||
解释代码的含义
|
||||
|
||||
```js
|
||||
这段代码的作用是什么?
|
||||
function addNumbers(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
```
|
||||
|
||||
将代码转换为指定的语言
|
||||
|
||||
```js
|
||||
把这段代码翻译成 Python:
|
||||
function addNumbers(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
```
|
||||
|
||||
编写完整的软件程序
|
||||
|
||||
```js
|
||||
写一个计算给定数的阶乘的 Python 程序。
|
||||
|
||||
如何用 JavaScript 发起一个 HTTP 请求?
|
||||
```
|
||||
|
||||
生成正则表达式 (regex)
|
||||
|
||||
```js
|
||||
创建一个匹配所有电子邮件地址的正则表达式?
|
||||
|
||||
生成一个8位密码的正则表达式。
|
||||
```
|
||||
|
||||
为代码库添加注释
|
||||
|
||||
```js
|
||||
为这段代码添加注释:
|
||||
function addNumbers(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
```
|
||||
|
||||
修改代码行的 CSS
|
||||
|
||||
```html
|
||||
更新这行的 CSS 将字体颜色更改为蓝色?
|
||||
<p class="example">Hello, World!</p>
|
||||
```
|
||||
|
||||
修改代码行的 HTML
|
||||
|
||||
```html
|
||||
给这个标题标签添加一个 "header" 类?
|
||||
<h1>Hello, World!</h1>
|
||||
```
|
||||
|
||||
### 电子表格
|
||||
|
||||
帮助创建一个电子表格公式
|
||||
|
||||
```
|
||||
你能帮我创建一个公式来计算单元格 A1 到 A10 的总和吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
解释一个公式
|
||||
|
||||
```
|
||||
你能用简单的语言解释一下公式 =SUM(A1:A10) 的含义吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
创建占位符的虚拟数据
|
||||
|
||||
```
|
||||
你能帮我生成一些虚拟数据,作为我的电子表格的占位符吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
帮助创建复杂的宏
|
||||
|
||||
```
|
||||
我需要创建一个宏,计算单元格 B1 到 B10 的平均值并将结果插入到单元格 C1。你能帮我吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
提供提高电子表格效率的建议
|
||||
|
||||
```
|
||||
你能给我一些提高电子表格效率的建议吗?
|
||||
```
|
||||
|
||||
### 电子邮件
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
创建电子邮件活动
|
||||
|
||||
```
|
||||
邀请 Jack 周末晚餐的邮件
|
||||
|
||||
创建一个针对新客户的引导流程邮件序列
|
||||
```
|
||||
|
||||
格式化和校对邮件
|
||||
|
||||
```
|
||||
帮我校对并格式化我刚写的这封邮件:
|
||||
Hello, do you have any actual tips or tricks for ChatGPT please?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
提供有效电子邮件营销的建议
|
||||
|
||||
```
|
||||
给我一些提高邮件打开率和点击率的建议
|
||||
|
||||
建议一些方法,让我的邮件内容对订阅者更具吸引力和相关性。
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
自动回复邮件
|
||||
|
||||
```
|
||||
给他发送邮件,内容为 "That's a good suggestion, it's coming soon":
|
||||
Hello, do you have any actual tips or tricks for ChatGPT please?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
从文本中提取电子邮件地址
|
||||
|
||||
```sh
|
||||
帮我提取所有的电子邮件地址:
|
||||
Sed sit amet sodales tom@gmail.com, at jack@gmail.com enim. 18261@outlook.com ut eros
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 社交媒体
|
||||
|
||||
提供任何主题的表情包创意
|
||||
|
||||
```
|
||||
你能给我一些关于【狗狗】的表情包创意吗?
|
||||
```
|
||||
|
||||
提供能提升互动的帖子创意
|
||||
|
||||
```
|
||||
我想发一个关于气候变化的帖子,能与我的粉丝产生互动。你能给我一些创意吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
生成标签和配文
|
||||
|
||||
```
|
||||
我需要一些适合风景日落照片的标签和配文。你能帮我生成一些吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
提供回复建议
|
||||
|
||||
```
|
||||
我刚收到一条关于项目状态的消息。你能给我一个回复建议吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 阅读
|
||||
|
||||
总结长文本
|
||||
|
||||
```
|
||||
你能帮我总结一下这篇文章吗?[你的文本]
|
||||
```
|
||||
|
||||
翻译外语
|
||||
|
||||
```
|
||||
你能把这句话翻译成西班牙语吗?[你的文本]
|
||||
```
|
||||
|
||||
推荐类似的书籍
|
||||
|
||||
```
|
||||
你能推荐一些和《饥饿游戏》类似的书吗?
|
||||
```
|
||||
|
||||
### 设计
|
||||
|
||||
创建 AI 设计提示词
|
||||
|
||||
```
|
||||
你能帮我生成一个为新运动品牌设计标志的提示词吗?
|
||||
```
|
||||
|
||||
博客或视频的缩略图建议
|
||||
|
||||
```
|
||||
你能推荐一些引人注目的缩略图设计,适合我最新关于健康饮食的 YouTube 视频吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
字体搭配
|
||||
|
||||
```
|
||||
你能为旅行博客的标题设计推荐一组字体搭配吗?
|
||||
```
|
||||
|
||||
颜色搭配
|
||||
|
||||
```
|
||||
你能推荐一个适合婚礼摄影网站的配色方案吗?
|
||||
```
|
||||
|
||||
### 数据分析
|
||||
|
||||
从大量文本中提取数字
|
||||
|
||||
```
|
||||
请从这段文本中提取所有数字:[你的文本]
|
||||
```
|
||||
|
||||
根据你提供的文本或数据创建表格
|
||||
|
||||
```
|
||||
你能根据这些数据创建一个表格吗?:[你的数据]
|
||||
```
|
||||
|
||||
从大列表中筛选数据
|
||||
|
||||
```
|
||||
请根据特定条件筛选此列表:[你的列表]
|
||||
```
|
||||
|
||||
### 付费广告
|
||||
|
||||
提供广告创意
|
||||
|
||||
```
|
||||
给我一些新产品发布的广告创意。
|
||||
```
|
||||
|
||||
检查跟踪代码错误(标签管理器等)
|
||||
|
||||
```
|
||||
检查我的标签管理器代码是否有错误。
|
||||
```
|
||||
|
||||
提供广告文案创意
|
||||
|
||||
```
|
||||
为一家【旅游】公司建议广告文案。
|
||||
```
|
||||
|
||||
Facebook 受众建议
|
||||
|
||||
```
|
||||
推荐适合服装系列广告活动的 Facebook 受众。
|
||||
```
|
||||
|
||||
为广告创建正文、标题和/或号召性用语
|
||||
|
||||
```
|
||||
为一个新的健身计划广告创建标题、正文和号召性用语。
|
||||
```
|
||||
|
||||
### 亚马逊 FBA
|
||||
|
||||
编写或重写产品描述
|
||||
|
||||
```
|
||||
请帮我为最新商品写一个新颖且吸引人的产品描述。
|
||||
```
|
||||
|
||||
编写或重写申诉信
|
||||
|
||||
```
|
||||
我需要帮助重写我的申诉信,使其更具说服力。
|
||||
```
|
||||
|
||||
编写或重写供应商联系邮件
|
||||
|
||||
```
|
||||
你能帮我写一封有效的邮件,以联系潜在供应商吗?
|
||||
```
|
||||
|
||||
帮助寻找适合打包销售的商品
|
||||
|
||||
```
|
||||
请推荐一些适合为客户打包销售的商品。
|
||||
```
|
||||
|
||||
整理产品和定价数据
|
||||
|
||||
```
|
||||
你能帮我把产品和定价信息整理成一个整洁易管理的表格吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### SEO
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
生成或查找关键词
|
||||
|
||||
- 为[主题]生成一系列相关关键词。
|
||||
- 识别[主题]内容优化的长尾关键词。
|
||||
- 查找[主题]的最佳表现关键词。
|
||||
- 为[主题]生成一系列 LSI 关键词。
|
||||
- 查找[主题]的低竞争关键词。
|
||||
- 为[主题]关键词创建同义词列表。
|
||||
- 查找[主题] PPC 广告活动的最佳关键词。
|
||||
- 查找[主题]语音搜索优化的最佳关键词。
|
||||
- 列出[主题]的最佳关键词用于特色摘要。
|
||||
- 查找[主题]视频优化的最佳关键词。
|
||||
- 查找[主题]的最佳关键词。
|
||||
- 查找[主题] AMP 优化的最佳关键词。
|
||||
- 查找[主题]社交媒体优化的最佳关键词。
|
||||
<!--rehype:className=style-round-->
|
||||
|
||||
更多关于 SEO 的 ChatGPT 提示
|
||||
|
||||
- 为[主题]创建元描述和标题标签。
|
||||
- 查找与[主题]相关的内部链接机会。
|
||||
- 为[主题]生成博客文章和主题创意。
|
||||
- 研究[主题]内容中使用的行业术语。
|
||||
- 查找权威网站以获取与[主题]内容相关的反向链接。
|
||||
- 创建与[主题]相关的 XML 网站地图示例。
|
||||
- 研究[主题]的最佳元标签。
|
||||
- 研究[主题]内容的最佳内部链接结构。
|
||||
- 生成与[主题]相关的常见问题列表。
|
||||
- 为与[主题]相关的图片创建最佳替代文本标签列表。
|
||||
- 为[主题]创建相关子主题列表。
|
||||
- 查找与[主题]相关的内容发布时间的最佳时机。
|
||||
- 研究与[主题]相关的最佳外部链接策略。
|
||||
- 查找与[主题] SEO 使用的最流行工具。
|
||||
- 为[主题]创建潜在影响者列表。
|
||||
- 研究[主题]的最佳模式标记。
|
||||
- 查找[主题]内容的最佳标题标签。
|
||||
- 为[主题]创建潜在的链接建设机会列表。
|
||||
- 研究[主题]反向链接的最佳锚文本。
|
||||
- 创建[主题]的潜在客座博客机会列表。
|
||||
- 研究[主题]的最佳本地 SEO 策略。
|
||||
- 研究[主题]网站性能的最佳分析工具。
|
||||
- 为[主题]创建潜在合作伙伴关系列表。
|
||||
- 研究[主题]的最佳移动优化策略。
|
||||
- 研究[主题]的最佳电子商务优化策略,并提供关键词聚类。
|
||||
- 创建[主题]的潜在联盟营销机会列表。
|
||||
- [主题]的最佳联盟营销网站有哪些?
|
||||
- [主题]的最佳国际 SEO 策略是什么?
|
||||
- 创建与[主题]相关的潜在播客或播客嘉宾机会列表。
|
||||
- 研究[主题]的最佳 Google 我的商家优化策略。
|
||||
- 查找与[主题]相关的热门内容主题。
|
||||
- 研究[主题]的最佳 SEO 策略并提供可操作步骤。
|
||||
- 创建与[主题]相关的潜在视频系列或网络研讨会创意列表。
|
||||
- 研究与[主题]相关的竞争对手策略。
|
||||
- 查找与[主题]相关的规范标签示例。
|
||||
- 为[主题]创建一个面向多个地理位置的示例关键词列表。
|
||||
- 生成针对不同客户购买漏斗阶段的[主题]关键词创意。
|
||||
- 识别与[主题]相关的行业标签。
|
||||
<!--rehype:className=style-round-->
|
||||
|
||||
### 写作/博客
|
||||
|
||||
为你的创意写作项目创建标题
|
||||
|
||||
```
|
||||
我短篇小说集的标题:[你的文章]
|
||||
```
|
||||
|
||||
创建大纲
|
||||
|
||||
```
|
||||
关于锻炼的论文大纲。
|
||||
```
|
||||
|
||||
生成内容创意
|
||||
|
||||
```
|
||||
可持续时尚博客的创意?
|
||||
```
|
||||
|
||||
总结你提供的任何文本
|
||||
|
||||
```
|
||||
总结一下这篇关于可再生能源的文章?[你的文章]
|
||||
```
|
||||
|
||||
创建完整的博客文章
|
||||
|
||||
```
|
||||
关于[财务规划]的博客文章?
|
||||
```
|
||||
|
||||
扩展句子、段落或长文本
|
||||
|
||||
```
|
||||
扩展关于爵士音乐的这句话?[你的句子]
|
||||
```
|
||||
|
||||
改变你的写作语气
|
||||
|
||||
```
|
||||
将这份报告的语气改为对话式?[你的报告]
|
||||
```
|
||||
|
||||
校对或编辑你的写作
|
||||
|
||||
```
|
||||
校对这篇文章?[你的文章]
|
||||
```
|
||||
|
||||
用标题格式化文本(适合博客文章)
|
||||
|
||||
```
|
||||
为我的博客文章格式化标题?[你的帖子]
|
||||
```
|
||||
|
||||
检查任何文本的偏见
|
||||
|
||||
```
|
||||
检查这篇文章是否存在偏见?[你的文章]
|
||||
```
|
||||
|
||||
检测任何文本的抄袭
|
||||
|
||||
```
|
||||
检测这篇论文的抄袭情况?[你的论文]
|
||||
```
|
||||
|
||||
提供域名创意
|
||||
|
||||
```
|
||||
我[园艺博客]的域名?
|
||||
```
|
||||
|
||||
### 教师/课程创建者
|
||||
|
||||
将事实或统计数据转换为多项选择题
|
||||
|
||||
```sh
|
||||
你能把这份关于世界历史的事实列表转成多项选择题吗?[你的列表]
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
特定主题的作业创意
|
||||
|
||||
```
|
||||
我需要一些关于美国独立战争的历史作业创意。你能建议一些吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
从学生列表中创建分组
|
||||
|
||||
```
|
||||
我有一份30名学生的名单。你能把他们分成6人一组进行小组项目吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
根据考试成绩创建曲线
|
||||
|
||||
```
|
||||
我需要根据学生的考试成绩创建一个评分曲线。你能帮忙吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
评分作业
|
||||
|
||||
```
|
||||
你能给这篇历史论文评分并提供改进建议吗?
|
||||
```
|
||||
|
||||
### YouTube
|
||||
|
||||
从文字稿中创建时间戳
|
||||
|
||||
```
|
||||
你能为这段播客节目的文字稿创建时间戳吗?[你的文字稿]
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
将 YouTube 视频转换为带格式的博客文章
|
||||
|
||||
```
|
||||
你能把这段关于烹饪的 YouTube 视频转成带有标题和项目符号的博客文章吗?[视频链接]
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
想出视频大纲或脚本
|
||||
|
||||
```
|
||||
我需要一个关于冥想好处的视频大纲。你能帮忙吗?
|
||||
```
|
||||
|
||||
创建对评论的回复
|
||||
|
||||
```
|
||||
你能写一个周到且礼貌的回复,回应我 YouTube 视频上的这条负面评论吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
给你缩略图创意
|
||||
|
||||
```
|
||||
我需要一些关于“DIY 家居装饰”视频的缩略图创意。你能建议一些吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
分析你的脚本或文字稿并告诉你语气
|
||||
|
||||
```
|
||||
你能分析这段关于环境问题的视频脚本,并告诉我语气是什么吗?[你的脚本]
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
任何主题的视频创意
|
||||
|
||||
```
|
||||
我想制作一系列关于时尚的视频。你能给我建议一些单集的创意吗?
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 研究
|
||||
|
||||
帮助研究2021年前发生的任何事情
|
||||
|
||||
- 用简单的术语解释量子计算。
|
||||
- 有什么创意适合10岁生日派对的吗?
|
||||
- 我如何在 JavaScript 中发出 HTTP 请求?
|
||||
- 你能告诉我美国内战前的事件吗?
|
||||
- 你能告诉我印刷机的发明吗?
|
||||
- 你能研究一下奥林匹克运动会的历史吗?
|
||||
- 你能给我关于法国大革命的信息吗?
|
||||
- 我对拜占庭帝国的历史感兴趣。你能帮我了解更多吗?
|
||||
- 等等...
|
||||
<!--rehype:className=style-round-->
|
||||
|
||||
## 参考资料
|
||||
|
||||
- [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/)
|
||||
- [Comprehensive Cheatsheet](https://github.com/bg-write/chatGPT-cheatsheet)
|
149
docs/chown.md
Normal file
@ -0,0 +1,149 @@
|
||||
Chown 备忘清单
|
||||
===
|
||||
|
||||
这份快速参考备忘单提供了改变文件或目录的所有者的简要概述,以及 chown 命令的操作
|
||||
|
||||
入门
|
||||
--------
|
||||
|
||||
### 介绍
|
||||
|
||||
Linux/Unix 系统中的一个命令,全称为 `change owner`,用于改变文件或目录的所有者
|
||||
|
||||
```shell
|
||||
chown [选项] [所有者][:[组]] 文件或目录名
|
||||
```
|
||||
|
||||
命令可以更改某个文件或目录的属主(owner),也可以同时更改其属组(group)
|
||||
|
||||
#### 示例
|
||||
|
||||
```shell
|
||||
$ chown :groupname file1.txt
|
||||
$ chown -R username:groupname *
|
||||
$ chown $USER file.txt
|
||||
```
|
||||
|
||||
`注意` 只有超级用户(root)才有权限改变文件或目录的所有者
|
||||
|
||||
### 选项
|
||||
|
||||
- `-c` : 显示更改的部分的信息
|
||||
- `-f` : 忽略错误信息
|
||||
- `-h` :修复符号链接
|
||||
- `-v` : 显示详细的处理信息
|
||||
- `-R` : 处理指定目录以及其子目录下的所有文件
|
||||
- `--help` : 显示辅助说明
|
||||
- `--version` : 显示版本
|
||||
|
||||
示例
|
||||
--------
|
||||
|
||||
### 更改文件所有者
|
||||
|
||||
```shell
|
||||
$ chown root /var/run/httpd.pid
|
||||
```
|
||||
|
||||
把 `/var/run/httpd.pid` 的所有者设为 `root`
|
||||
|
||||
#### 仅更改所有者
|
||||
|
||||
```bash
|
||||
$ chown new_owner file.txt
|
||||
```
|
||||
|
||||
### 递归更改目录及其内容的所有者
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```shell
|
||||
chown -R new_owner:new_group directory/
|
||||
```
|
||||
|
||||
将文件夹 `directory` 的拥有者设为 `new_owner` ,群体的使用者设为 `new_group`
|
||||
|
||||
```shell
|
||||
$ chown username:groupname file1.txt
|
||||
```
|
||||
|
||||
将文件 file1.txt 的拥有者设为 `username` ,群体的使用者设为 `groupname`
|
||||
|
||||
```shell
|
||||
$ chown -R username:groupname *
|
||||
```
|
||||
|
||||
将当前目录以及子目录的所有文件的拥有者设为 `username` ,群体的使用者设为 `groupname`
|
||||
|
||||
### 更改所有者为当前用户
|
||||
|
||||
```bash
|
||||
$ chown $USER file.txt
|
||||
```
|
||||
|
||||
递归更改目录及其内容的所有者为当前用户
|
||||
|
||||
```bash
|
||||
sudo chown -R $USER directory/
|
||||
```
|
||||
|
||||
### 递归并且不显示错误信息
|
||||
|
||||
```bash
|
||||
chown -R -f new_owner:new_group directory/
|
||||
```
|
||||
|
||||
更改目录及其内容的所有者和组为 `alice`
|
||||
|
||||
```bash
|
||||
chown -R alice: directory/
|
||||
```
|
||||
|
||||
### 仅更改组
|
||||
|
||||
```shell
|
||||
$ chown :groupname file1.txt
|
||||
```
|
||||
|
||||
不修改文件 `file1.txt` 的拥有者,将文件使用群体改为 `groupname`
|
||||
|
||||
### 变更符号链接的所有者
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```bash
|
||||
$ chown -h new_owner:new_group symlink
|
||||
```
|
||||
|
||||
变更符号链接的所有者而不是链接指向的文件
|
||||
|
||||
```bash
|
||||
$ chown -h manager symlink
|
||||
```
|
||||
|
||||
更改符号链接的所有者为"manager"
|
||||
|
||||
### 更改所有者为根用户
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```bash
|
||||
sudo chown root:root file.txt
|
||||
```
|
||||
|
||||
#### 递归更改所有者为当前用户
|
||||
|
||||
```bash
|
||||
sudo chown -R $USER directory/
|
||||
# 更改目录及其内容的所有者和组为"alice":
|
||||
chown -R alice: directory/
|
||||
```
|
||||
|
||||
### 将文件所有者更改为其他用户,但保留组
|
||||
|
||||
```bash
|
||||
chown new_owner file.txt
|
||||
```
|
||||
|
||||
### 将文件所有者更改为其他用户,同时更改组
|
||||
|
||||
```bash
|
||||
chown new_owner:new_group file.txt
|
||||
```
|
329
docs/cpp.md
@ -30,7 +30,7 @@ Hello Quick Reference
|
||||
int number = 5; // 整数
|
||||
float f = 0.95; // 浮点数
|
||||
double PI = 3.14159; // 浮点数
|
||||
char yes = 'Y'; // 特点
|
||||
char yes = 'Y'; // 字符
|
||||
std::string s = "ME"; // 字符串(文本)
|
||||
bool isRight = true; // 布尔值
|
||||
// 常量
|
||||
@ -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;
|
||||
```
|
||||
|
||||
### 注释
|
||||
@ -108,13 +113,13 @@ for (int i = 0; i < 10; i++) {
|
||||
|
||||
```cpp
|
||||
#include <iostream>
|
||||
|
||||
|
||||
void hello(); // 声明
|
||||
|
||||
|
||||
int main() { // 主函数
|
||||
hello(); // 执行函数
|
||||
}
|
||||
|
||||
|
||||
void hello() { // 定义
|
||||
std::cout << "Hello Quick Reference!\n";
|
||||
}
|
||||
@ -155,7 +160,7 @@ using namespace ns1;
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
cout << val();
|
||||
cout << val();
|
||||
}
|
||||
```
|
||||
|
||||
@ -172,7 +177,7 @@ marks[0] = 92;
|
||||
marks[1] = 97;
|
||||
marks[2] = 98;
|
||||
// 定义和初始化
|
||||
std::array<int, 3> = {92, 97, 98};
|
||||
std::array<int, 3> marks = {92, 97, 98};
|
||||
// 有空成员
|
||||
std::array<int, 3> marks = {92, 97};
|
||||
std::cout << marks[2]; // 输出: 0
|
||||
@ -237,7 +242,7 @@ for (int i = 0; i < 2; ++i) {
|
||||
std::cout << x[i][j] << " ";
|
||||
}
|
||||
}
|
||||
// 输出: 1 2 3 4 5 6 6 5 4 3 2 1
|
||||
// 输出: 1 2 3 4 5 6 6 5 4 3 2 1
|
||||
```
|
||||
|
||||
C++ 条件
|
||||
@ -317,19 +322,19 @@ else
|
||||
| Example | Meaning |
|
||||
|----------------|------------------------|
|
||||
| `exp1 && exp2` | Both are true _(AND)_ |
|
||||
| `exp1 || exp2` | Either is true _(OR)_ |
|
||||
| <code>exp1 || exp2</code> | Either is true _(OR)_ |
|
||||
| `!exp` | `exp` is false _(NOT)_ |
|
||||
|
||||
#### 位运算符
|
||||
|
||||
| Operator | Description |
|
||||
|----------|-------------------------|
|
||||
| `a & b` | Binary AND |
|
||||
| `a | b` | Binary OR |
|
||||
| `a ^ b` | Binary XOR |
|
||||
| `a ~ b` | Binary One's Complement |
|
||||
| `a << b` | Binary Shift Left |
|
||||
| `a >> b` | Binary Shift Right |
|
||||
| 运算符 | 描述 |
|
||||
|--------|------|
|
||||
| `a & b` | 按位与 |
|
||||
| <code>a | b</code> | 按位或 |
|
||||
| `a ^ b` | 按位异或 |
|
||||
| `~a` | 按位取反 |
|
||||
| `a << b` | 左移 |
|
||||
| `a >> b` | 右移 |
|
||||
|
||||
### 三元运算符
|
||||
|
||||
@ -475,7 +480,7 @@ for (char c: hello)
|
||||
{
|
||||
std::cout << c << " ";
|
||||
}
|
||||
// 输出: Q u i c k R e f . M E
|
||||
// 输出: Q u i c k R e f . M E
|
||||
```
|
||||
|
||||
### 中断语句
|
||||
@ -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++ 函数
|
||||
------------
|
||||
|
||||
@ -510,10 +525,10 @@ C++ 函数
|
||||
```cpp
|
||||
#include <iostream>
|
||||
int add(int a, int b) {
|
||||
return a + b;
|
||||
return a + b;
|
||||
}
|
||||
int main() {
|
||||
std::cout << add(10, 20);
|
||||
std::cout << add(10, 20);
|
||||
}
|
||||
```
|
||||
|
||||
@ -538,7 +553,7 @@ void fun(int a) {
|
||||
```cpp
|
||||
#include <iostream>
|
||||
#include <cmath> // 导入库
|
||||
|
||||
|
||||
int main() {
|
||||
// sqrt() 来自 cmath
|
||||
std::cout << sqrt(9);
|
||||
@ -599,16 +614,16 @@ auto func = []() -> return_type { };
|
||||
```cpp
|
||||
int val1 = 123, val2 = 456;
|
||||
string str1("123"), str2(456);
|
||||
|
||||
|
||||
auto func1 = [=, &str1]() -> int
|
||||
{
|
||||
return val1 == std::stoi(str1)
|
||||
return val1 == std::stoi(str1)
|
||||
? val1 : val2;
|
||||
};
|
||||
|
||||
auto func2 = [&, val1]() -> int
|
||||
|
||||
auto func2 = [&, val1]() -> string
|
||||
{
|
||||
return str1 == std::to_string(val1)
|
||||
return str1 == std::to_string(val1)
|
||||
? str1 : str2;
|
||||
};
|
||||
```
|
||||
@ -622,15 +637,137 @@ auto func = []() -> return_type { };
|
||||
|
||||
```cpp
|
||||
// vec中包含1, 2, 3, 4, 5
|
||||
std::vector<int> vec({1, 2, 3, 4, 5});
|
||||
std::for_each(vec.begin(), vec.end(),
|
||||
std::vector<int> vec({1, 2, 3, 4, 5});
|
||||
std::for_each(vec.begin(), vec.end(),
|
||||
[](int& ele) -> void
|
||||
{
|
||||
std::cout << ele
|
||||
std::cout << ele
|
||||
<< " ";
|
||||
});
|
||||
```
|
||||
|
||||
## C++智能指针
|
||||
|
||||
### 智能指针基础
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```cpp
|
||||
#include <memory>
|
||||
|
||||
// 创建独占所有权的指针
|
||||
std::unique_ptr<int> p1 = std::make_unique<int>(42);
|
||||
// 不能复制,只能移动
|
||||
std::unique_ptr<int> p2 = std::move(p1);
|
||||
// p1 现在为 nullptr
|
||||
|
||||
// 创建共享所有权的指针
|
||||
std::shared_ptr<int> sp1 = std::make_shared<int>(42);
|
||||
// 可以复制,引用计数增加
|
||||
std::shared_ptr<int> sp2 = sp1;
|
||||
// 获取引用计数
|
||||
std::cout << sp1.use_count(); // 输出: 2
|
||||
|
||||
// 创建弱引用,不增加引用计数
|
||||
std::weak_ptr<int> wp = sp1;
|
||||
```
|
||||
|
||||
### unique_ptr
|
||||
|
||||
```cpp
|
||||
// 创建方式1:使用 make_unique (C++14)
|
||||
auto p1 = std::make_unique<int>(42);
|
||||
|
||||
// 创建方式2:直接构造
|
||||
std::unique_ptr<int> p2(new int(42));
|
||||
|
||||
// 访问资源
|
||||
std::cout << *p1 << std::endl;
|
||||
*p1 = 100;
|
||||
|
||||
// 获取原始指针(不转移所有权)
|
||||
int* raw = p1.get();
|
||||
|
||||
// 释放所有权并返回原始指针
|
||||
int* released = p1.release();
|
||||
// p1 现在为 nullptr
|
||||
|
||||
// 替换管理的对象
|
||||
p1.reset(new int(50));
|
||||
```
|
||||
|
||||
### shared_ptr
|
||||
|
||||
```cpp
|
||||
// 创建方式1:使用 make_shared
|
||||
auto sp1 = std::make_shared<int>(42);
|
||||
|
||||
// 创建方式2:直接构造
|
||||
std::shared_ptr<int> sp2(new int(42));
|
||||
|
||||
// 复制和共享所有权
|
||||
std::shared_ptr<int> sp3 = sp1;
|
||||
std::cout << sp1.use_count(); // 输出: 2
|
||||
|
||||
// 访问资源
|
||||
std::cout << *sp1 << std::endl;
|
||||
*sp1 = 100; // 所有指向该资源的shared_ptr都会看到这个修改
|
||||
|
||||
// 重置指针
|
||||
sp1.reset(); // sp1变为nullptr,引用计数减1
|
||||
```
|
||||
|
||||
### weak_ptr
|
||||
|
||||
```cpp
|
||||
std::shared_ptr<int> sp = std::make_shared<int>(42);
|
||||
std::weak_ptr<int> wp = sp;
|
||||
|
||||
// 检查引用对象是否存在
|
||||
if (auto locked = wp.lock()) {
|
||||
std::cout << *locked << std::endl; // 输出: 42
|
||||
} else {
|
||||
std::cout << "对象已被销毁" << std::endl;
|
||||
}
|
||||
|
||||
// 检查是否过期
|
||||
bool is_expired = wp.expired(); // false
|
||||
|
||||
// 获取引用计数
|
||||
std::cout << wp.use_count(); // 输出: 1
|
||||
|
||||
// 当所有shared_ptr都被销毁时
|
||||
sp.reset();
|
||||
if (wp.expired()) {
|
||||
std::cout << "对象已被销毁" << std::endl;
|
||||
}
|
||||
```
|
||||
|
||||
### 循环引用问题
|
||||
|
||||
```cpp
|
||||
struct Node {
|
||||
std::string name;
|
||||
std::shared_ptr<Node> next;
|
||||
// 使用weak_ptr避免循环引用
|
||||
std::weak_ptr<Node> parent;
|
||||
|
||||
Node(const std::string& n) : name(n) {}
|
||||
~Node() { std::cout << "销毁: " << name << std::endl; }
|
||||
};
|
||||
|
||||
// 创建循环引用
|
||||
void createCycle() {
|
||||
auto node1 = std::make_shared<Node>("Node1");
|
||||
auto node2 = std::make_shared<Node>("Node2");
|
||||
|
||||
node1->next = node2;
|
||||
node2->parent = node1; // 使用weak_ptr避免循环引用
|
||||
|
||||
// 函数结束时,node1和node2会被正确销毁
|
||||
// 如果parent也是shared_ptr,则会造成内存泄漏
|
||||
}
|
||||
```
|
||||
|
||||
## C++多线程
|
||||
|
||||
### 多线程介绍
|
||||
@ -665,17 +802,17 @@ class Entry
|
||||
|
||||
Entry entry;
|
||||
// 调用operator()()
|
||||
std::thread my_thread_1(entry);
|
||||
std::thread my_thread_1(entry);
|
||||
// 调用Entry::entry_function
|
||||
std::thread my_thread_2(&Entry::entry_function, &entry);
|
||||
std::thread my_thread_2(&Entry::entry_function, &entry);
|
||||
```
|
||||
|
||||
以lambda表达式作为线程入口函数:
|
||||
|
||||
```cpp
|
||||
std::thread my_thread([]() -> void
|
||||
std::thread my_thread([]() -> void
|
||||
{
|
||||
// ...
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
@ -693,17 +830,17 @@ my_thread.detach();
|
||||
|
||||
```cpp
|
||||
// 获取当前线程ID
|
||||
std::this_thread::get_id();
|
||||
std::this_thread::get_id();
|
||||
// 使当前线程休眠一段指定时间
|
||||
std::this_thread::sleep_for();
|
||||
std::this_thread::sleep_for();
|
||||
// 使当前线程休眠到指定时间
|
||||
std::this_thread::sleep_until();
|
||||
// 暂停当前线程的执行,让别的线程执行
|
||||
std::this_thread::yield();
|
||||
std::this_thread::yield();
|
||||
```
|
||||
|
||||
### 锁
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
> `#include <mutex>`
|
||||
|
||||
@ -753,7 +890,7 @@ std::lock_guard<std::mutex> lock(m);
|
||||
```cpp
|
||||
// 手动上锁
|
||||
m.lock();
|
||||
std::lock_guard<mutex> lock(m,
|
||||
std::lock_guard<mutex> lock(m,
|
||||
std::adopt_lock);
|
||||
```
|
||||
|
||||
@ -773,7 +910,7 @@ std::unique_lock<mutex> lock(m);
|
||||
```cpp
|
||||
// 手动上锁
|
||||
m.lock();
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::adopt_lock);
|
||||
```
|
||||
|
||||
@ -782,7 +919,7 @@ std::unique_lock<mutex> lock(m,
|
||||
尝试上锁,可以通过`std::unique_lock<Mutex>::owns_lock()`查看状态
|
||||
|
||||
```cpp
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::try_to_lock);
|
||||
if (lock.owns_lock())
|
||||
{
|
||||
@ -860,19 +997,19 @@ cond.wait(lock, predicate);
|
||||
唤醒所有调用 `wait` 的线程。
|
||||
|
||||
### 获取线程的运行结果
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
> `#include <future>`
|
||||
|
||||
#### 创建异步任务
|
||||
|
||||
```cpp
|
||||
double func(int val);
|
||||
double func(int val);
|
||||
|
||||
// 使用std::async创建异步任务
|
||||
// 使用std::future获取结果
|
||||
// future模板中存放返回值类型
|
||||
std::future<double> result =
|
||||
std::future<double> result =
|
||||
std::async(func, 5);
|
||||
```
|
||||
|
||||
@ -910,8 +1047,8 @@ int val = result.get();
|
||||
```cpp
|
||||
extern double foo(int val) {}
|
||||
|
||||
std::future<double> result =
|
||||
async(foo, 5);
|
||||
std::future<double> result =
|
||||
std::async(foo, 5);
|
||||
|
||||
//返回值类型
|
||||
std::future_status status;
|
||||
@ -920,7 +1057,7 @@ status = result.wait_for(
|
||||
std::chrono::seconds(1)
|
||||
);
|
||||
// 等待到某一时间点
|
||||
status = result.wait_for(
|
||||
status = result.wait_until(
|
||||
std::chrono::now() +
|
||||
std::chrono::seconds(1)
|
||||
);
|
||||
@ -930,10 +1067,10 @@ status = result.wait_for(
|
||||
|
||||
```cpp
|
||||
// 返回值已经准备好
|
||||
if (status ==
|
||||
if (status ==
|
||||
std::future_status::ready)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
// 超时:尚未准备好
|
||||
else if (status ==
|
||||
@ -947,14 +1084,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++ 预处理器
|
||||
------------
|
||||
|
||||
@ -1001,7 +1230,7 @@ C++ 预处理器
|
||||
|
||||
```cpp
|
||||
#ifdef DEBUG
|
||||
console.log('hi');
|
||||
std::cout << "hi" << std::endl;
|
||||
#elif defined VERBOSE
|
||||
...
|
||||
#else
|
||||
|
1467
docs/cs.md
12
docs/css.md
@ -156,7 +156,7 @@ div {
|
||||
```css
|
||||
#container {
|
||||
display: grid;
|
||||
s grid: repeat(2, 60px) / auto-flow 80px;
|
||||
grid: repeat(2, 60px) / auto-flow 80px;
|
||||
}
|
||||
#container > div {
|
||||
background-color: #8ca0ff;
|
||||
@ -1977,6 +1977,16 @@ ul > li:not(:last-child)::after {
|
||||
|
||||
使列表项看起来像一个真实的逗号分隔列表,使用 `:not()` 伪类,最后一项不会添加逗号
|
||||
|
||||
### 表格中数字使用制表数字
|
||||
|
||||
```css
|
||||
.revenue {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
```
|
||||
|
||||
表格中一列数字列对其
|
||||
|
||||
另见
|
||||
---------
|
||||
|
||||
|
238
docs/dart.md
@ -9,6 +9,8 @@ Dart 备忘清单
|
||||
### 安装 Dart
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
> 完整教程请参阅 Dart 中文社区 [https://dart.cn/get-dart/](https://dart.cn/get-dart/)
|
||||
|
||||
#### Windows
|
||||
|
||||
```bash
|
||||
@ -88,8 +90,8 @@ double height = 1.85;
|
||||
// 您还可以将变量声明为 num
|
||||
// x 可以同时具有 int 和 double 值
|
||||
num x = 1;
|
||||
num += 2.5;
|
||||
print(num); // 打印: 3.5
|
||||
x += 2.5;
|
||||
print(x); // 打印: 3.5
|
||||
|
||||
String name = "Nicola";
|
||||
bool isFavourite = true;
|
||||
@ -130,6 +132,15 @@ import 'dart:math';
|
||||
import 'package:test/test.dart';
|
||||
// 导入文件
|
||||
import 'path/to/my_other_file.dart';
|
||||
// 指定前缀
|
||||
import 'package:lib/lib.dart' as lib;
|
||||
lib.Element element = lib.Element();
|
||||
// 仅导入 foo
|
||||
import 'package:lib1/lib1.dart' show foo;
|
||||
// 不导入 foo
|
||||
import 'package:lib2/lib2.dart' hide foo;
|
||||
// 延迟导入,仅在需要时导入
|
||||
import 'package:greetings/hello.dart' deferred as hello;
|
||||
```
|
||||
|
||||
操作符
|
||||
@ -184,10 +195,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 变为 1;1 变为 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 +285,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 +303,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
|
||||
```
|
||||
|
||||
控制流:循环
|
||||
-----
|
||||
|
||||
@ -276,7 +381,7 @@ const constantCities = const ["New York", "Mumbai", "Tokyo"];
|
||||
```dart
|
||||
// 映射是关联键和值的对象
|
||||
var person = Map<String, String>();
|
||||
// 要初始化地图,请执行以下操作:
|
||||
// 要初始化映射,请执行以下操作:
|
||||
person['firstName'] = 'Nicola';
|
||||
person['lastName'] = 'Tesla';
|
||||
print(person);
|
||||
@ -301,7 +406,7 @@ var halogens = {'fluorine', 'chlorine', 'bromine', 'iodine', 'astatine'};
|
||||
// 创建一个空集
|
||||
var names = <String>{};
|
||||
Set<String> names = {}; // 这也有效
|
||||
//var names = {}; // 创建地图,而不是集合
|
||||
//var names = {}; // 创建映射,而不是集合
|
||||
```
|
||||
|
||||
函数
|
||||
@ -320,7 +425,7 @@ int sum = add(2,3); // 回报:5
|
||||
int totalSum = add(2, add(2,3)); // 返回:7
|
||||
```
|
||||
|
||||
### 箭头语法 (=>)
|
||||
### 箭头函数 (=>)
|
||||
|
||||
```dart
|
||||
// 只包含一个表达式的函数,您可以使用简写语法
|
||||
@ -346,6 +451,63 @@ list.forEach(
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 扩展函数 (Extension)
|
||||
|
||||
```dart
|
||||
//extension 定义扩展名称 on 扩展类
|
||||
extension StringExtension on String {
|
||||
//扩展方法
|
||||
String capitalize() {
|
||||
if (isEmpty) {
|
||||
return this;
|
||||
}
|
||||
// 将字符串的首字母大写
|
||||
String topStr = this[0].toUpperCase();
|
||||
|
||||
return '${topStr}${substring(1)}';
|
||||
}
|
||||
}
|
||||
|
||||
void main(List<String> args) {
|
||||
print("apple".capitalize());
|
||||
// Print: Apple
|
||||
print("苹果apple".capitalize());
|
||||
// Print: 苹果apple
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
在不修改 String 类的前提下为其新增了 capitalize 方法
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 运算符重载 (Extension)
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
```dart
|
||||
class Money {
|
||||
final num amount;
|
||||
Money({required this.amount});
|
||||
}
|
||||
|
||||
// 利用扩展函数特性
|
||||
extension MoneyOperatorExtension<T> on Money {
|
||||
// operator 重载运算符
|
||||
Money operator +(Money elements) {
|
||||
Money newMoney = Money(amount: this.amount + elements.amount);
|
||||
return newMoney;
|
||||
}
|
||||
}
|
||||
|
||||
void main(List<String> args) {
|
||||
// 怎么样?两个类加起来了
|
||||
Money appleMoney = Money(amount: 10.0);
|
||||
Money cardMoney = Money(amount: 6.0);
|
||||
Money allMoney = cardMoney + appleMoney;
|
||||
print(allMoney.amount);
|
||||
//Print: 16.0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
类和对象
|
||||
----------
|
||||
|
||||
@ -680,7 +842,8 @@ Future<String> login() {
|
||||
// 异步
|
||||
main() async {
|
||||
print('Authenticating please wait...');
|
||||
print(await userName());
|
||||
String result = await login();
|
||||
print(result);
|
||||
}
|
||||
```
|
||||
|
||||
@ -721,8 +884,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
|
||||
// 允许您对同一对象进行一系列操作
|
||||
@ -738,16 +943,23 @@ var user = User()
|
||||
..age = 24;
|
||||
```
|
||||
|
||||
### 扩展运算符 (...)
|
||||
### 延迟初始化
|
||||
|
||||
```dart
|
||||
// 将多个值插入到集合中
|
||||
var list = [1, 2, 3];
|
||||
var list2 = [0, ...list];
|
||||
print(list2.length); // 打印: 4
|
||||
// token 类型非空,但是不用立即赋值
|
||||
late String token;
|
||||
|
||||
void main(List<String> args) {
|
||||
/// print(token);
|
||||
/// 字段 "token "尚未初始化
|
||||
/// 在初始化前调用就会报错
|
||||
token = "tokenContent";
|
||||
print(token);
|
||||
}
|
||||
```
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
- [Dart 官方文档](https://dart.dev/) _(dart.dev)_
|
||||
- [Dart 中文社区官方文档](https://dart.cn/) _(dart.cn)_
|
||||
|
660
docs/docker-compose.md
Normal 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"
|
||||
# 将容器的端口 22(SSH端口)映射到主机的端口 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 搜索域。它可以是单个值或列表。
|
795
docs/docker.md
@ -9,6 +9,13 @@ Docker 备忘清单
|
||||
|
||||
### 入门
|
||||
|
||||
#### 安装
|
||||
|
||||
```shell
|
||||
curl -sSL https://get.docker.com/ | sh
|
||||
sudo chmod 777 /var/run/docker.sock
|
||||
```
|
||||
|
||||
在后台创建和运行容器
|
||||
|
||||
```shell
|
||||
@ -156,7 +163,10 @@ $ docker build - < Dockerfile
|
||||
$ docker build - < context.tar.gz
|
||||
$ docker build -t eon/nginx-server .
|
||||
$ docker build -f myOtherDockerfile .
|
||||
$ docker build --build-arg https_proxy=127.0.0.1:8088 # 使用http代理构建
|
||||
$ curl example.com/remote/Dockerfile | docker build -f - .
|
||||
$ docker save -o <保存路径>/myimage.tar myimage:latest # 导出
|
||||
$ docker load -i <路径>/myimage.tar # 导入
|
||||
```
|
||||
|
||||
### 删除 \<none> 镜像
|
||||
@ -169,49 +179,16 @@ Docker 网络
|
||||
----
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 操作
|
||||
|
||||
删除网络
|
||||
|
||||
```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 \
|
||||
@ -225,19 +202,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-->
|
||||
|
||||
将容器分离,保留容器,但是不退出
|
||||
|
||||
各种各样的
|
||||
----
|
||||
@ -245,15 +285,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-->
|
||||
|
||||
登录到镜像仓库
|
||||
|
||||
@ -297,23 +337,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-->
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
@ -328,6 +367,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
|
||||
|
||||
@ -339,8 +379,10 @@ $ docker volume prune
|
||||
`docker service ps` | 列出服务的任务
|
||||
`docker service scale <service_name>=<replica>` | 规模特殊服务
|
||||
`docker service update <options> <service_name>` | 更新服务选项
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### Docker Stack
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
@ -349,6 +391,7 @@ $ docker volume prune
|
||||
`docker stack services <appname>` | 列出与应用关联的服务
|
||||
`docker stack ps <appname>` | 列出与应用关联的正在运行的容器
|
||||
`docker stack rm <appname>` | 拆掉一个应用程序
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### Docker Machine
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
@ -369,8 +412,10 @@ $ docker volume prune
|
||||
`docker-machine rm $(docker-machine ls -q)` | 删除所有虚拟机及其磁盘映像
|
||||
`docker-machine scp docker-compose.yml myvm1:~` | 将文件复制到节点的主目录
|
||||
`docker-machine ssh myvm1 "docker stack deploy -c <file> <app>"` | 部署应用
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### docker 主要命令
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
@ -414,9 +459,68 @@ $ docker volume prune
|
||||
`update` | 更新一个或多个容器的配置
|
||||
`version` | 显示 Docker 版本信息
|
||||
`wait` | 阻塞直到一个或多个容器停止,然后打印它们的退出代码
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### docker 管理命令
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
`docker builder` | 管理构建
|
||||
`docker buildx*` | Docker Buildx(Docker Inc.,v0.7.1)
|
||||
`docker compose*` | Docker Compose(Docker 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)
|
||||
@ -426,11 +530,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(完全公平调度器)配额
|
||||
@ -520,60 +624,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 Buildx(Docker Inc.,v0.7.1)
|
||||
`docker compose*` | Docker Compose(Docker 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-->
|
||||
|
||||
@ -589,6 +695,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 54321: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 54321:54321` | 将主机的 54321 端口映射到容器的 54321 端口,访问数据库
|
||||
`--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
|
||||
@ -602,47 +1135,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
|
||||
@ -676,3 +1168,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/)
|
||||
|
@ -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
|
||||
```
|
||||
|
||||
|
125
docs/dotnet-cli.md
Normal file
@ -0,0 +1,125 @@
|
||||
.NET CLI 备忘清单
|
||||
===
|
||||
|
||||
本备忘单总结了 [.NET](https://learn.microsoft.com/zh-cn/dotnet/core/tools/) 命令行接口 (CLI) 工具,以供快速参考
|
||||
|
||||
.NET CLI 备忘清单
|
||||
---
|
||||
<!--rehype:style=display: none;-->
|
||||
|
||||
### 介绍
|
||||
|
||||
`.NET CLI` 命令由 **驱动程序(`dotnet`)**、**命令**、**参数** 和 **选项** 组成。典型流程如下:
|
||||
|
||||
```bash
|
||||
# 创建控制台应用
|
||||
dotnet new console
|
||||
# 构建并指定输出目录
|
||||
dotnet build --output ./build_output
|
||||
# 运行构建结果
|
||||
dotnet ./build_output/my_app.dll
|
||||
```
|
||||
|
||||
### 基本命令
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
| 命令 | 说明 | 示例 |
|
||||
|--------------|--------------|--------------|
|
||||
| `new` | 创建新项目或文件模板 | `dotnet new console` |
|
||||
| `restore` | 还原项目依赖项 | `dotnet restore` |
|
||||
| `build` | 构建项目 | `dotnet build` |
|
||||
| `publish` | 发布应用以部署 | `dotnet publish -c Release -o ./publish`|
|
||||
| `run` | 运行项目 | `dotnet run` |
|
||||
| `test` | 运行测试(使用 xUnit/NUnit 等) | `dotnet test` |
|
||||
| `vstest` | 运行已编译的测试程序集 | `dotnet vstest ./bin/Debug/test.dll` |
|
||||
| `pack` | 打包为 NuGet 包 | `dotnet pack` |
|
||||
| `migrate` | 迁移旧版项目(已弃用) | `dotnet migrate` |
|
||||
| `clean` | 清理构建输出 | `dotnet clean` |
|
||||
| `sln` | 管理 `.sln` 解决方案文件 | `dotnet sln add ./MyApp/MyApp.csproj` |
|
||||
| `help` | 显示帮助信息 | `dotnet help build` |
|
||||
| `store` | 预编译和缓存程序集(高级用法) | `dotnet store` |
|
||||
| `watch` | 监视文件更改并自动运行命令 | `dotnet watch run` |
|
||||
| `format` | 格式化代码(自 .NET 6 起支持) | `dotnet format` |
|
||||
<!--rehype:className=left-align -->
|
||||
|
||||
### 项目修改命令
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
| 命令 | 说明 | 示例 |
|
||||
|--------------|--------------|--------------|
|
||||
| `package add` | 添加 NuGet 包依赖 | `dotnet add package Newtonsoft.Json` |
|
||||
| `package list` | 列出项目中的所有包依赖 | `dotnet list package` |
|
||||
| `package remove` | 移除 NuGet 包依赖 | `dotnet remove package Newtonsoft.Json` |
|
||||
| `package search` | 搜索 NuGet 包 | `dotnet search package Newtonsoft.Json` |
|
||||
| `reference add` | 添加项目引用(*.csproj) | `dotnet add reference ../CommonLib/CommonLib.csproj` |
|
||||
| `reference list` | 列出当前项目引用的其他项目 | `dotnet list reference` |
|
||||
| `reference remove` | 移除项目引用 | `dotnet remove reference ../CommonLib/CommonLib.csproj` |
|
||||
<!--rehype:className=left-align style-list-arrow-->
|
||||
|
||||
### 工作负荷管理命令
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
| 命令 | 说明 | 示例 |
|
||||
|--------------|--------------|--------------|
|
||||
| `workload` | 顶级命令,显示所有 workload 子命令 | `dotnet workload --help` |
|
||||
| `workload install` | 安装指定的工作负荷(如 MAUI、Web 等) | `dotnet workload install maui` |
|
||||
| `workload uninstall` | 卸载指定的工作负荷 | `dotnet workload uninstall maui` |
|
||||
| `workload update` | 更新所有已安装的工作负荷 | `dotnet workload update` |
|
||||
| `workload list` | 显示当前已安装的工作负荷 | `dotnet workload list` |
|
||||
| `workload restore` | 还原项目所需的工作负荷 | `dotnet workload restore` |
|
||||
| `workload search` | 搜索可用的工作负荷 | `dotnet workload search` |
|
||||
| `workload repair` | 修复已安装的工作负荷 | `dotnet workload repair` |
|
||||
| `workload config` | 配置自定义源、缓存路径等(.NET 8.0.400+) | `dotnet workload config list` |
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### NuGet 命令
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
| 命令 | 说明 | 示例 |
|
||||
|--------------|--------------|--------------|
|
||||
| `nuget delete` | 从源中删除一个 NuGet 包 | `dotnet nuget delete MyLib 1.0.0 -s https://api.nuget.org/v3/index.json`|
|
||||
| `nuget locals` | 清理 NuGet 缓存 | `dotnet nuget locals all --clear` |
|
||||
| `nuget push` | 将 NuGet 包推送到服务器(如 nuget.org) | `dotnet nuget push MyLib.1.0.0.nupkg -k API_KEY -s https://api.nuget.org/v3/index.json` |
|
||||
| `nuget add source` | 添加一个新的 NuGet 源 | `dotnet nuget add source https://myserver/index.json -n MySource` |
|
||||
| `nuget disable source` | 禁用一个现有的 NuGet 源 | `dotnet nuget disable source MySource` |
|
||||
| `nuget enable source` | 启用已禁用的 NuGet 源 | `dotnet nuget enable source MySource` |
|
||||
| `nuget list source` | 列出所有已配置的 NuGet 源 | `dotnet nuget list source` |
|
||||
| `nuget remove source` | 移除已配置的 NuGet 源 | `dotnet nuget remove source MySource` |
|
||||
| `nuget update source` | 更新现有 NuGet 源信息 | `dotnet nuget update source MySource -s https://new-url` |
|
||||
| `nuget verify` | 验证 NuGet 包签名(.NET 5+) | `dotnet nuget verify MyLib.1.0.0.nupkg` |
|
||||
| `nuget trust` | 管理受信任的签名证书(.NET 5+) | `dotnet nuget trust list` |
|
||||
| `nuget sign` | 对 NuGet 包进行签名(.NET 6+) | `dotnet nuget sign MyLib.1.0.0.nupkg --certificate-path cert.pfx` |
|
||||
| `package search` | 搜索 NuGet 包(.NET 8.0.2xx+) | `dotnet package search Newtonsoft.Json` |
|
||||
| `nuget why` | 显示为什么某个包被安装(.NET 8.0.4xx+)| `dotnet nuget why Newtonsoft.Json` |
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### 高级命令
|
||||
|
||||
| 命令 | 说明 | 示例 |
|
||||
|--------------|--------------|--------------|
|
||||
| `sdk check` | 显示可用的 SDK/运行时版本,并检测更新 | `dotnet sdk check` |
|
||||
| `msbuild` | 使用 MSBuild 构建项目(提供更多构建自定义性) | `dotnet msbuild /t:Clean;Build /p:Configuration=Release` |
|
||||
| `build-server` | 管理后端构建服务器(如清理缓存、关闭等) | `dotnet build-server shutdown` |
|
||||
| `dev-certs` | 管理开发 HTTPS 证书 | `dotnet dev-certs https --trust` |
|
||||
| `dotnet install script` | 获取可安装指定版本 .NET 的脚本(Linux/macOS) | `curl -sSL https://dot.net/v1/dotnet-install.sh \| bash` |
|
||||
<!--rehype:className=left-align style-list-arrow-->
|
||||
|
||||
### 工具管理命令
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
| 命令 | 说明 | 示例 |
|
||||
|--------------|--------------|--------------|
|
||||
| `tool install` | 安装 .NET 工具(本地或全局) | `dotnet tool install -g dotnet-ef` |
|
||||
| `tool list` | 列出已安装的工具 | `dotnet tool list -g` |
|
||||
| `tool update` | 更新指定工具 | `dotnet tool update -g dotnet-ef` |
|
||||
| `tool restore` | 恢复项目中定义的工具(基于 manifest) | `dotnet tool restore` |
|
||||
| `tool run` | 运行本地安装的工具 | `dotnet tool run my-tool` |
|
||||
| `tool uninstall` | 卸载已安装的工具 | `dotnet tool uninstall -g dotnet-ef` |
|
||||
| `tool search` | 搜索 NuGet 上可用的工具 | `dotnet tool search dotnet-ef` |
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
另请参阅
|
||||
---
|
||||
|
||||
- [dotnet/sdk GitHub 存储库](https://github.com/dotnet/sdk/) _(github.com/dotnet)_
|
||||
- [.NET 安装指南](https://learn.microsoft.com/zh-cn/dotnet/core/install/windows) _(learn.microsoft.com)_
|
606
docs/elasticsearch.md
Normal 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
@ -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 等于 1,b 等于 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)_
|
@ -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-->
|
||||
|
||||
### 编写命令
|
||||
|
@ -985,6 +985,7 @@ Github emoji 图标标记
|
||||
--------
|
||||
|
||||
- [Emoji searcher](https://emoji.muan.co/) _(muan.co)_
|
||||
- [Share Emojis-With Your 🥺Fiends With An Great Way And Unique✅ |copy & download|](https://emoji-share.com/) _(emoji-share.com)_
|
||||
- [Get Emoji — All Emojis to ✂️ Copy and 📋 Paste](https://getemoji.com/) _(getemoji.com)_
|
||||
- [Emoji Guide – 🔥 The Ultimate Emoji Guide: 🌈 Meanings, 🍎 Platforms, 🆘 Codes and 😍 More](https://emojiguide.com/) _(emojiguide.com)_
|
||||
- [Full Emoji List, v15.0](https://unicode.org/emoji/charts/full-emoji-list.html) _(unicode.org)_
|
||||
|
450
docs/erlang.md
Normal 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)
|
352
docs/fastapi.md
@ -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_length、min_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具有read,write方法 |
|
||||
| `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_items和read_users方法依赖common_parameters
|
||||
# 白话就是read_items和read_users都需要q,skip,limit查询参数
|
||||
`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,你只需要提供证书和私钥即可。
|
||||
|
||||
待更新
|
||||
|
||||
参考
|
||||
|
120
docs/feds.md
@ -9,14 +9,14 @@ FED 前端导航
|
||||
[CSDN](https://www.csdn.net/)<!--rehype:target=_blank&style=background: rgb(252 85 49/var(\-\-bg\-opacity));-->
|
||||
[GitHub](https://github.com/)<!--rehype:target=_blank&style=background: rgb(0 0 0/var(\-\-bg\-opacity));-->
|
||||
[InfoQ](http://www.infoq.com/cn)<!--rehype:target=_blank&style=background: rgb(66 133 244/var(\-\-bg\-opacity));-->
|
||||
[Medium](https://medium.com/topic/technology)<!--rehype:target=_blank-->
|
||||
[Medium](https://medium.com/topic/technology)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[SegmentFault](https://segmentfault.com/)<!--rehype:target=_blank&style=background: rgb(0 150 94/var(\-\-bg\-opacity));-->
|
||||
[Stack Overflow](https://stackoverflow.com/)<!--rehype:target=_blank&style=background: rgb(244 130 37/var(\-\-bg\-opacity));-->
|
||||
[V2EX](https://www.v2ex.com/?tab=tech)<!--rehype:target=_blank&style=background: rgb(0 0 0/var(\-\-bg\-opacity));-->
|
||||
[博客园](https://www.cnblogs.com/)<!--rehype:target=_blank&style=background: rgb(46 122 203/var(\-\-bg\-opacity));-->
|
||||
[开源中国](https://www.oschina.net/)<!--rehype:target=_blank&style=background: rgb(43 179 81/var(\-\-bg\-opacity));-->
|
||||
[稀土掘金](https://juejin.im/)<!--rehype:target=_blank&style=background: rgb(30 128 255/var(\-\-bg\-opacity));-->
|
||||
[W3cplus](https://www.w3cplus.com/)<!--rehype:target=_blank-->
|
||||
[W3cplus](https://www.w3cplus.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
构建工具
|
||||
@ -34,31 +34,32 @@ FED 前端导航
|
||||
[Turbopack](https://turbo.build/)<!--rehype:target=_blank&style=background: rgb(248 30 87/var(\-\-bg\-opacity));-->
|
||||
[Create React App](https://create-react-app.dev/)<!--rehype:target=_blank&style=background: rgb(60 106 146/var(\-\-bg\-opacity));-->
|
||||
[Browserify](http://browserify.org/)<!--rehype:target=_blank&style=background: rgb(60 106 146/var(\-\-bg\-opacity));-->
|
||||
[Yeoman](http://yeoman.io/)<!--rehype:target=_blank-->
|
||||
[Grunt](https://gruntjs.com/)<!--rehype:target=_blank-->
|
||||
[Yeoman](http://yeoman.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Grunt](https://gruntjs.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Babel](https://babeljs.io/)<!--rehype:target=_blank&style=background: rgb(245 218 85/var(\-\-bg\-opacity));-->
|
||||
[FIS3](https://fex-team.github.io/fis3/)<!--rehype:target=_blank-->
|
||||
[FIS3](https://fex-team.github.io/fis3/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
教程文档
|
||||
---
|
||||
|
||||
[MDN Web Docs](https://developer.mozilla.org/zh-CN/)<!--rehype:target=_blank&style=background: rgb(140 181 255/var(\-\-bg\-opacity));-->
|
||||
[ECMAScript 6 入门](https://es6.ruanyifeng.com/)<!--rehype:target=_blank-->
|
||||
[ECMAScript 6 入门](https://es6.ruanyifeng.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
JavaScript 工具
|
||||
---
|
||||
|
||||
[Chrome Dev Tools](https://www.google.cn/chrome/)<!--rehype:target=_blank-->
|
||||
[CoffeeScript](https://coffeescript.org/)<!--rehype:target=_blank-->
|
||||
[Firefox Developer Tools](https://www.mozilla.org/zh-CN/firefox/new/)<!--rehype:target=_blank-->
|
||||
[Chrome Dev Tools](https://www.google.cn/chrome/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CoffeeScript](https://coffeescript.org/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Firefox Developer Tools](https://www.mozilla.org/zh-CN/firefox/new/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[flow](https://flow.org/)<!--rehype:target=_blank&style=background: rgb(232 189 54/var(\-\-bg\-opacity));-->
|
||||
[TypeScript](https://www.typescriptlang.org/)<!--rehype:target=_blank&style=background: rgb(49 120 197/var(\-\-bg\-opacity));-->
|
||||
[JS 压缩,格式化](https://www.css-js.com/)<!--rehype:target=_blank-->
|
||||
[JS 压缩,格式化](https://www.css-js.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[JSDoc](https://jsdoc.app/)<!--rehype:target=_blank&style=background: rgb(197 149 199/var(\-\-bg\-opacity));-->
|
||||
[UglifyJS](http://lisperator.net/uglifyjs/transform)<!--rehype:target=_blank-->
|
||||
[UglifyJS](http://lisperator.net/uglifyjs/transform)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Prettier](https://prettier.io/)<!--rehype:target=_blank&style=background: rgb(197 149 199/var(\-\-bg\-opacity));-->
|
||||
[Biome - JS 语言格式化](https://prettier.io/)<!--rehype:target=_blank&style=background: rgb(96 165 250/var(\-\-bg\-opacity));&class=contributing tag&data-lang=格式化-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
JavaScript 测试工具
|
||||
@ -66,38 +67,39 @@ JavaScript 测试工具
|
||||
|
||||
[Chai](http://chaijs.com/)<!--rehype:target=_blank&style=background: rgb(164 8 1/var(\-\-bg\-opacity));-->
|
||||
[ESLint](https://eslint.org/)<!--rehype:target=_blank&style=background: rgb(76 50 195/var(\-\-bg\-opacity));-->
|
||||
[JSHint](http://jshint.com/)<!--rehype:target=_blank-->
|
||||
[JSHint](http://jshint.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Jasmine](https://jasmine.github.io/)<!--rehype:target=_blank&style=background: rgb(138 65 130/var(\-\-bg\-opacity));-->
|
||||
[Jest](https://jestjs.io/)<!--rehype:target=_blank&style=background: rgb(158 79 101/var(\-\-bg\-opacity));-->
|
||||
[Mochajs](https://mochajs.org/)<!--rehype:target=_blank&style=background: rgb(141 103 72/var(\-\-bg\-opacity));-->
|
||||
[Oxc - 比 ESLint 快 100 倍](https://oxc-project.github.io)<!--rehype:target=_blank&style=background: rgb(57 172 167/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
CSS 工具
|
||||
---
|
||||
|
||||
[30秒CSS](https://www.30secondsofcode.org/css/)<!--rehype:target=_blank-->
|
||||
[Autoprefixer](https://github.com/postcss/autoprefixer)<!--rehype:target=_blank-->
|
||||
[ColorZilla](http://www.colorzilla.com/gradient-editor/)<!--rehype:target=_blank-->
|
||||
[CSS Protips](https://github.com/AllThingsSmitty/css-protips)<!--rehype:target=_blank-->
|
||||
[CSS3 Maker](http://www.css3maker.com/)<!--rehype:target=_blank-->
|
||||
[cssnano](http://cssnano.co/)<!--rehype:target=_blank-->
|
||||
[CSSPIN](https://webkul.github.io/csspin/)<!--rehype:target=_blank-->
|
||||
[CSSreference](https://cssreference.io/)<!--rehype:target=_blank-->
|
||||
[CSSTree](https://github.com/csstree/csstree)<!--rehype:target=_blank-->
|
||||
[CSS美化压缩](http://tool.css-js.com/)<!--rehype:target=_blank-->
|
||||
[Easing Functions Cheat Sheet](http://easings.net/zh-cn)<!--rehype:target=_blank-->
|
||||
[Emmet](https://www.emmet.io/)<!--rehype:target=_blank-->
|
||||
[est](http://ecomfe.github.io/est/)<!--rehype:target=_blank-->
|
||||
[Flex Layout Attribute](https://github.com/StefanKovac/flex-layout-attribute)<!--rehype:target=_blank-->
|
||||
[minireset.css](http://lesscss.org/)<!--rehype:target=_blank-->
|
||||
[Normalize.css](http://necolas.github.io/normalize.css/)<!--rehype:target=_blank-->
|
||||
[PostCSS](http://postcss.org/)<!--rehype:target=_blank-->
|
||||
[purifycss](https://github.com/purifycss/purifycss)<!--rehype:target=_blank-->
|
||||
[30秒CSS](https://www.30secondsofcode.org/css/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Autoprefixer](https://github.com/postcss/autoprefixer)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[ColorZilla](http://www.colorzilla.com/gradient-editor/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSS Protips](https://github.com/AllThingsSmitty/css-protips)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSS3 Maker](http://www.css3maker.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[cssnano](http://cssnano.co/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSSPIN](https://webkul.github.io/csspin/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSSreference](https://cssreference.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSSTree](https://github.com/csstree/csstree)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSS美化压缩](http://tool.css-js.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Easing Functions Cheat Sheet](http://easings.net/zh-cn)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Emmet](https://www.emmet.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[est](http://ecomfe.github.io/est/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Flex Layout Attribute](https://github.com/StefanKovac/flex-layout-attribute)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[minireset.css](http://lesscss.org/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Normalize.css](http://necolas.github.io/normalize.css/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[PostCSS](http://postcss.org/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[purifycss](https://github.com/purifycss/purifycss)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Less](https://lesscss.org/)<!--rehype:target=_blank&style=background: rgb(36 74 121/var(\-\-bg\-opacity));-->
|
||||
[SASS](http://sass-lang.com/)<!--rehype:target=_blank&style=background: rgb(191 64 128/var(\-\-bg\-opacity));-->
|
||||
[Sprite Cow](http://www.spritecow.com/)<!--rehype:target=_blank-->
|
||||
[Sprite Cow](http://www.spritecow.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Stylus](http://stylus-lang.com/)<!--rehype:target=_blank&style=background: rgb(126 194 66/var(\-\-bg\-opacity));-->
|
||||
[Stylelint](https://stylelint.io/)<!--rehype:target=_blank-->
|
||||
[Stylelint](https://stylelint.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
框架类库
|
||||
@ -106,49 +108,49 @@ CSS 工具
|
||||
[React](https://zh-hans.react.dev)<!--rehype:target=_blank&style=background: rgb(97 218 251/var(\-\-bg\-opacity));-->
|
||||
[Vue 中文](https://cn.vuejs.org/)<!--rehype:target=_blank&style=background: rgb(66 184 131/var(\-\-bg\-opacity));-->
|
||||
[Angular](https://angular.io/)<!--rehype:target=_blank&style=background: rgb(195 8 47/var(\-\-bg\-opacity));-->
|
||||
[jQuery](http://www.jquery123.com/)<!--rehype:target=_blank-->
|
||||
[jQuery](http://www.jquery123.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Bootstrap](https://getbootstrap.com/)<!--rehype:target=_blank&style=background: rgb(113 44 249/var(\-\-bg\-opacity));-->
|
||||
[React Native 中文](https://reactnative.cn/)<!--rehype:target=_blank&style=background: rgb(36 120 194/var(\-\-bg\-opacity));-->
|
||||
[Flutter](https://flutter.dev/)<!--rehype:target=_blank&style=background: rgb(35 104 215/var(\-\-bg\-opacity));-->
|
||||
[RxJs](http://reactivex.io/rxjs/)<!--rehype:target=_blank-->
|
||||
[RxJs](http://reactivex.io/rxjs/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[htmx](https://htmx.org/)<!--rehype:target=_blank&style=background: rgb(61 114 215/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
在线代码编辑器工具
|
||||
---
|
||||
|
||||
[CodePen](https://codepen.io/)<!--rehype:target=_blank-->
|
||||
[CodeSandbox](https://codesandbox.io/)<!--rehype:target=_blank-->
|
||||
[StackBlitz](https://stackblitz.com/)<!--rehype:target=_blank-->
|
||||
[esbuild](https://esbuild.github.io/)<!--rehype:target=_blank-->
|
||||
[JSFiddle](https://jsfiddle.net/)<!--rehype:target=_blank-->
|
||||
[Replit](https://replit.com/)<!--rehype:target=_blank-->
|
||||
[JSRUN.NET](https://jsrun.net/)<!--rehype:target=_blank-->
|
||||
[WebComponents.dev](https://webcomponents.dev/)<!--rehype:target=_blank-->
|
||||
[JS Bin](https://jsbin.com/)<!--rehype:target=_blank-->
|
||||
[RunKit](https://runkit.com/)<!--rehype:target=_blank-->
|
||||
[CodePen](https://codepen.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CodeSandbox](https://codesandbox.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[StackBlitz](https://stackblitz.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[esbuild](https://esbuild.github.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[JSFiddle](https://jsfiddle.net/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Replit](https://replit.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[JSRUN.NET](https://jsrun.net/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[WebComponents.dev](https://webcomponents.dev/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[JS Bin](https://jsbin.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[RunKit](https://runkit.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
兼容、性能测试
|
||||
---
|
||||
|
||||
[Browser Sandbox](https://turbo.net/browsers)<!--rehype:target=_blank-->
|
||||
[Browserdiet](https://browserdiet.com/zh/)<!--rehype:target=_blank-->
|
||||
[browsershots](http://browsershots.org/)<!--rehype:target=_blank-->
|
||||
[BrowserStack](https://www.browserstack.com/)<!--rehype:target=_blank-->
|
||||
[Can I use](http://caniuse.com/)<!--rehype:target=_blank-->
|
||||
[httpstatus](https://httpstatus.io/)<!--rehype:target=_blank-->
|
||||
[Observatory](https://observatory.mozilla.org/)<!--rehype:target=_blank-->
|
||||
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/?hl=zh-CN)<!--rehype:target=_blank-->
|
||||
[Security Headers](https://securityheaders.com/)<!--rehype:target=_blank-->
|
||||
[Browser Sandbox](https://turbo.net/browsers)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Browserdiet](https://browserdiet.com/zh/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[browsershots](http://browsershots.org/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[BrowserStack](https://www.browserstack.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Can I use](http://caniuse.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[httpstatus](https://httpstatus.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Observatory](https://observatory.mozilla.org/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/?hl=zh-CN)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Security Headers](https://securityheaders.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
CDN
|
||||
---
|
||||
|
||||
[cdnjs](https://cdnjs.com/)<!--rehype:target=_blank-->
|
||||
[jsDelivr](https://www.jsdelivr.com/)<!--rehype:target=_blank-->
|
||||
[前端静态资源库](https://cdn.baomitu.com/)<!--rehype:target=_blank-->
|
||||
[UNPKG](https://unpkg.com/)<!--rehype:target=_blank-->
|
||||
[Statically](https://statically.io/)<!--rehype:target=_blank-->
|
||||
[raw.githack.com](http://raw.githack.com/)<!--rehype:target=_blank-->
|
||||
[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));-->
|
||||
[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));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
@ -117,6 +117,7 @@ $ ffmpeg -i movie.webm movie.mp4
|
||||
`-vol` | 以 256 的倍数更改音频音量,其中 256 = 100%(正常)音量。例如 512 = 200%
|
||||
`-newaudio` | 将新的音频流添加到当前输出流
|
||||
`-alang code` | 设置当前音频流的 ISO 639 语言代码(3 个字母)
|
||||
`-ac nTract` | 指定立体声通道数(n个声道)。例如 nTract = 2 即2个声道
|
||||
|
||||
视频编辑
|
||||
---
|
||||
|
203
docs/figma.md
Normal 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
@ -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)_
|
388
docs/flutter.md
@ -8,6 +8,8 @@ Flutter 备忘清单
|
||||
|
||||
### macOS 操作系统上安装和配置
|
||||
|
||||
> 完整教程请参阅 Flutter 中文社区的 [安装和环境配置](https://docs.flutter.cn/get-started/install)
|
||||
|
||||
```bash
|
||||
$ sudo softwareupdate --install-rosetta --agree-to-license
|
||||
```
|
||||
@ -18,15 +20,15 @@ $ sudo softwareupdate --install-rosetta --agree-to-license
|
||||
#### 获取 Flutter SDK
|
||||
|
||||
- 安装包来获取最新的 stable Flutter SDK:
|
||||
- Intel [`flutter_macos_3.3.8-stable.zip`](https://storage.flutter-io.cn/flutter_infra_release/releases/stable/macos/flutter_macos_3.3.8-stable.zip)
|
||||
- Apple 芯片 [`flutter_macos_arm64_3.3.8-stable.zip`](https://storage.flutter-io.cn/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_3.3.8-stable.zip)
|
||||
- Intel [`flutter_macos_3.22.2-stable.zip`](https://storage.flutter-io.cn/flutter_infra_release/releases/stable/macos/flutter_macos_3.22.2-stable.zip)
|
||||
- Apple 芯片 [`flutter_macos_arm64_3.22.2-stable.zip`](https://storage.flutter-io.cn/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_3.22.2-stable.zip)
|
||||
|
||||
想要获取到其他版本的安装包,请参阅 [SDK 版本列表](https://flutter.cn/docs/development/tools/sdk/releases) 页面
|
||||
想要获取到其他版本的安装包,请参阅 [SDK 版本列表](https://docs.flutter.cn/release/archive) 页面
|
||||
- 将文件解压到目标路径, 比如:
|
||||
|
||||
```bash
|
||||
$ cd ~/development
|
||||
$ unzip ~/Downloads/flutter_macos_3.3.8-stable.zip
|
||||
$ unzip ~/Downloads/flutter_macos_3.22.2-stable.zip
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
- 配置 `flutter` 的 PATH 环境变量:
|
||||
@ -39,10 +41,13 @@ $ sudo softwareupdate --install-rosetta --agree-to-license
|
||||
<!--rehype:className=style-timeline-->
|
||||
|
||||
### Windows 操作系统上安装和配置
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
> 完整教程请参阅 Flutter 中文社区的 [安装和环境配置](https://docs.flutter.cn/get-started/install)
|
||||
|
||||
- 点击下方的安装包,获取 stable 发行通道的 Flutter SDK 最新版本:
|
||||
- [flutter_windows_3.3.8-stable.zip](https://storage.flutter-io.cn/flutter_infra_release/releases/stable/windows/flutter_windows_3.3.8-stable.zip)
|
||||
- 要查看其他发行通道和以往的版本,请参阅 [SDK 版本列表](https://flutter.cn/docs/development/tools/sdk/releases) 页面
|
||||
- [flutter_windows_3.22.2-stable.zip](https://storage.flutter-io.cn/flutter_infra_release/releases/stable/windows/flutter_windows_3.22.2-stable.zip)
|
||||
- 要查看其他发行通道和以往的版本,请参阅 [SDK 版本列表](https://docs.flutter.cn/release/archive) 页面
|
||||
- 将压缩包解压,然后把其中的 `flutter` 目录整个放在你想放置 `Flutter SDK` 的路径中(例如 `C:\src\flutter`)
|
||||
- 更新 `path` 环境变量,在开始菜单的搜索功能键入`「env」`,然后选择 `编辑系统环境变量`。在 **`用户变量`** 一栏中,检查是否有 **`Path`** 这个条目:
|
||||
- 如果存在这个条目,以 `;` 分隔已有的内容,加入 `flutter\bin` 目录的完整路径。
|
||||
@ -779,7 +784,8 @@ ListView.separated(
|
||||
```
|
||||
|
||||
### GridView
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
`GridView`可将元素显示为二维网格状的列表组件,并支持主轴方向滚动。
|
||||
使用GridView() 构造函数,需要传入gridDelegate和children。Flutter中已经提供了两种实现方式,分别是:
|
||||
|
||||
@ -889,9 +895,377 @@ PageView.builder(
|
||||
),
|
||||
```
|
||||
|
||||
Flutter 动画组件
|
||||
---
|
||||
|
||||
### 1.隐式动画
|
||||
|
||||
在动画组件内,直接配置curve和duration属性
|
||||
|
||||
#### AnimatedContainer
|
||||
|
||||
使用AnimatedContainer组件,配置curve曲线过渡和duration过渡时间
|
||||
|
||||
```dart
|
||||
class HomeState extends StatefulWidget{
|
||||
const HomeState({Key? key}) : super(key:key);
|
||||
|
||||
@override
|
||||
State<HomeState> createState()=>_HomeState();
|
||||
}
|
||||
|
||||
class _HomeState extends State<HomeState>{
|
||||
bool press = false; //设置动画触发的条件
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
floatingActionButton:FloatingActionButton(onPressed: (){
|
||||
setState(() {
|
||||
press = true; //点击FloatingActionButton进行动画效果
|
||||
});
|
||||
}
|
||||
,child: const Icon(Icons.add),) ,
|
||||
appBar: AppBar(
|
||||
title: const Text("测试"),
|
||||
),
|
||||
body: Center(
|
||||
child: AnimatedContainer(
|
||||
curve: Curves.ease, //曲线
|
||||
duration: const Duration(seconds: 1), //延时
|
||||
width: press ? 200 : 300,
|
||||
height: 200,
|
||||
color:Colors.yellow,
|
||||
transform: press ? Matrix4.translationValues(0, 0, 0) :
|
||||
Matrix4.translationValues(100, 100, 0)
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### AnimatedPadding
|
||||
|
||||
通过配置padding值的改变,引起组件的移动动画效果,同样支持curve和duration的配置
|
||||
|
||||
```dart
|
||||
class _HomeState extends State<HomeState>{
|
||||
bool press = false;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
floatingActionButton:FloatingActionButton(onPressed: (){
|
||||
setState(() {
|
||||
press = true;
|
||||
});
|
||||
}
|
||||
,child: const Icon(Icons.add),) ,
|
||||
appBar: AppBar(
|
||||
title: const Text("测试"),
|
||||
),
|
||||
body: Center(
|
||||
child: AnimatedPadding(
|
||||
padding: EdgeInsets.fromLTRB(10, press ? 10 : 400, 0, 0), //配置边距值
|
||||
curve: Curves.ease, //曲线
|
||||
duration: const Duration(seconds: 1), //延时
|
||||
child: Container(
|
||||
width: 200,
|
||||
height: 200,
|
||||
color:Colors.yellow,
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### AnimatedAlign
|
||||
|
||||
通过配置alignment值的改变,引起组件的对齐动画效果,同样支持curve和duration的配置
|
||||
|
||||
```dart
|
||||
class _HomeState extends State<HomeState>{
|
||||
bool press = false;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
floatingActionButton:FloatingActionButton(onPressed: (){
|
||||
setState(() {
|
||||
press = true;
|
||||
});
|
||||
}
|
||||
,child: const Icon(Icons.add),) ,
|
||||
appBar: AppBar(
|
||||
title: const Text("测试"),
|
||||
),
|
||||
body: Center(
|
||||
child: AnimatedAlign(
|
||||
alignment: press ? Alignment.center : Alignment.topCenter,
|
||||
curve: Curves.ease, //曲线
|
||||
duration: const Duration(seconds: 1), //延时
|
||||
child: Container(
|
||||
width: 200,
|
||||
height: 200,
|
||||
color:Colors.yellow,
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### AnimatedOpacity
|
||||
|
||||
通过配置opacity值的改变,引起组件的透明度变化动画效果,同样支持curve和duration的配置
|
||||
|
||||
```dart
|
||||
class _HomeState extends State<HomeState>{
|
||||
bool press = false;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
floatingActionButton:FloatingActionButton(onPressed: (){
|
||||
setState(() {
|
||||
press = true;
|
||||
});
|
||||
}
|
||||
,child: const Icon(Icons.add),) ,
|
||||
appBar: AppBar(
|
||||
title: const Text("测试"),
|
||||
),
|
||||
body: Center(
|
||||
child: AnimatedOpacity(
|
||||
opacity: press ? 1 : 0.1,
|
||||
curve: Curves.ease, //曲线
|
||||
duration: const Duration(seconds: 1), //延时
|
||||
child: Container(
|
||||
width: 200,
|
||||
height: 200,
|
||||
color:Colors.yellow,
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### AnimatedPositioned
|
||||
|
||||
通过配置top,left,right,bottom值的改变,引起组件的距离变化动画效果,同样支持curve和duration的配置
|
||||
|
||||
```dart
|
||||
class _HomeState extends State<HomeState>{
|
||||
bool press = false;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
floatingActionButton:FloatingActionButton(onPressed: (){
|
||||
setState(() {
|
||||
press = true;
|
||||
});
|
||||
}
|
||||
,child: const Icon(Icons.add),) ,
|
||||
appBar: AppBar(
|
||||
title: const Text("测试"),
|
||||
),
|
||||
body:Stack(
|
||||
children: [
|
||||
AnimatedPositioned(
|
||||
top: press ? 0 : 100,
|
||||
left:press ? 0 : 100,
|
||||
curve: Curves.ease, //曲线
|
||||
duration: const Duration(seconds: 1), //延时
|
||||
child: Container(
|
||||
width: 200,
|
||||
height: 200,
|
||||
color:Colors.yellow,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2.显示动画
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
使用显示动画时,定义 `AnimationController`,并在组件中使用 `SingleTickerProviderStateMixin`。
|
||||
|
||||
#### RotationTransition
|
||||
|
||||
`RotationTransition` 实现旋转动画,`turns` 为 `AnimationController`。在 `initState` 中设置 `vsync` 和 `duration`,使用 `..repeat()` 实现动画循环。
|
||||
|
||||
```dart
|
||||
class _Boxed extends State<Boxed> with SingleTickerProviderStateMixin{
|
||||
late AnimationController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(seconds: 1)
|
||||
)..repeat(); // 让程序和手机的刷新频率统一
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: RotationTransition(turns: _controller,
|
||||
child: const FlutterLogo(size: 60),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### AnimationController
|
||||
|
||||
```dart
|
||||
class _HomeState extends State<HomeState> with SingleTickerProviderStateMixin {
|
||||
|
||||
late AnimationController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// 让程序和手机的刷新频率统一
|
||||
_controller = AnimationController(vsync: this, duration: const Duration(seconds: 1));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
floatingActionButton:FloatingActionButton(onPressed: () {
|
||||
_controller.repeat(); //重复播放
|
||||
},child:const Icon(Icons.add),) ,
|
||||
appBar: AppBar(
|
||||
title: const Text("测试"),
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
RotationTransition(
|
||||
turns: _controller,
|
||||
child: const FlutterLogo(size: 60),
|
||||
),
|
||||
ElevatedButton(onPressed: (){
|
||||
_controller.forward(); // 👈 播放一次
|
||||
}, child:const Icon(Icons.refresh)),
|
||||
ElevatedButton(onPressed: (){
|
||||
_controller.reverse(); // 👈 倒序播放
|
||||
}, child:const Icon(Icons.refresh)),
|
||||
ElevatedButton(onPressed: (){
|
||||
_controller.stop(); // 👈 停止
|
||||
}, child:const Icon(Icons.refresh)),
|
||||
ElevatedButton(onPressed: (){
|
||||
_controller.reset(); // 👈 重置
|
||||
}, child:const Icon(Icons.refresh)),
|
||||
]
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### FadeTransition
|
||||
|
||||
`FadeTransition` 实现透明度变化,`opacity` 为 `AnimationController`。可以通过 `reverse()` 实现从实体逐渐变透明。
|
||||
|
||||
```dart
|
||||
class _HomeState extends State<HomeState> with SingleTickerProviderStateMixin {
|
||||
|
||||
late AnimationController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
//让程序和手机的刷新频率统一
|
||||
_controller = AnimationController(vsync: this, duration: const Duration(seconds: 1));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
floatingActionButton:FloatingActionButton(onPressed: (){
|
||||
_controller.repeat(); //重复播放
|
||||
},child:const Icon(Icons.add),) ,
|
||||
appBar: AppBar(
|
||||
title: const Text("测试"),
|
||||
),
|
||||
body: Center(
|
||||
child: FadeTransition(opacity: _controller,
|
||||
child: const FlutterLogo(size: 60,),
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
也可以通过 lowerBound 和 upperBound 来配置 controller 的最低和最高值
|
||||
|
||||
#### ScaleTransition
|
||||
|
||||
`ScaleTransition` 实现缩放动画,`scale` 为 `AnimationController`,可以通过 `reverse()` 实现从大到小的动画效果。
|
||||
|
||||
```dart
|
||||
class _HomeState extends State<HomeState> with SingleTickerProviderStateMixin {
|
||||
late AnimationController _controller;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// 让程序和手机的刷新频率统一
|
||||
_controller = AnimationController(vsync: this, duration: const Duration(seconds: 1));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
floatingActionButton:FloatingActionButton(onPressed: (){
|
||||
_controller.repeat(); //重复播放
|
||||
},child:const Icon(Icons.add),) ,
|
||||
appBar: AppBar(
|
||||
title: const Text("测试"),
|
||||
),
|
||||
body: Center(
|
||||
child: ScaleTransition(scale: _controller,
|
||||
child: const FlutterLogo(size: 60,),
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
- [Dart 备忘清单](./dart.md) _(jaywcjlove.github.io)_
|
||||
- [flutter 官网](https://flutter.dev) _(flutter.dev)_
|
||||
- [flutter 中文社区官网](https://flutter.cn) _(flutter.cn)_
|
||||
- [flutter 中文开发者社区](https://flutterchina.club/) _(flutterchina.club)_
|
||||
|
134
docs/ftp.md
Normal file
@ -0,0 +1,134 @@
|
||||
ftp 备忘清单
|
||||
===
|
||||
|
||||
此 ftp 备忘清单包含命令和使用 ftp 脚本实现自动化的技巧示例。
|
||||
|
||||
入门
|
||||
----
|
||||
|
||||
### 介绍
|
||||
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
- FTP 命令允许用户通过FTP(File 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 指令,而不是启动交互式命令行。
|
||||
```
|
84
docs/git.md
@ -167,6 +167,12 @@ $ git checkout -b new_branch
|
||||
$ git branch -d my_branch
|
||||
```
|
||||
|
||||
删除本地存在远程不存在的分支
|
||||
|
||||
```shell
|
||||
$ git remote prune origin
|
||||
```
|
||||
|
||||
将分支 `A` 合并到分支 `B`
|
||||
|
||||
```shell
|
||||
@ -563,6 +569,35 @@ $ git fetch --all && git reset --hard origin/master
|
||||
$ git log Branch1 ^Branch2
|
||||
```
|
||||
|
||||
### git 迁移
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
- 从原地址克隆一份裸版本库
|
||||
|
||||
```bash
|
||||
$ git clone --bare https://github.com/username/project.git
|
||||
```
|
||||
|
||||
- 然后新建一个地址,比如一下
|
||||
|
||||
```bash
|
||||
$ https://gitee.com/username/newproject.git
|
||||
```
|
||||
|
||||
- 进入project.git这个全裸版本库,以镜像推送的方式上传代码到newproject上。
|
||||
|
||||
```
|
||||
$ cd project.git
|
||||
|
||||
$ git push --mirror https://gitee.com/username/newproject.git
|
||||
```
|
||||
|
||||
- 使用新地址,直接 Clone 到本地就可以了。
|
||||
|
||||
```
|
||||
$ git clone https://gitee.com/username/newproject.git
|
||||
```
|
||||
|
||||
Git Submodule 子模块
|
||||
------
|
||||
|
||||
@ -1101,6 +1136,7 @@ Host github.com
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### Fork仓库同步上游仓库
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
- 设置上游仓库
|
||||
|
||||
@ -1251,6 +1287,54 @@ Conventional Commmits
|
||||
| `test:` | 添加测试代码或修正已有的测试 |
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
patch 补丁的使用
|
||||
----
|
||||
|
||||
### 简单创建
|
||||
|
||||
```bash
|
||||
$ git diff commit_id > my.patch
|
||||
```
|
||||
|
||||
### 简单应用
|
||||
|
||||
- **检查**补丁
|
||||
|
||||
```bash
|
||||
# 检查下这个补丁能否被正常应用
|
||||
$ git apply --check path/to/my.patch
|
||||
```
|
||||
|
||||
- **使用**补丁
|
||||
|
||||
```
|
||||
# 检查通过使用该补丁
|
||||
$ git apply < path/to/my.patch
|
||||
```
|
||||
|
||||
- 若有冲突则**解决**
|
||||
|
||||
```
|
||||
# 检查不通过可以自动合入patch不冲突的代码,同时保留冲突部分
|
||||
$ git apply --reject path/to/my.patch
|
||||
```
|
||||
|
||||
<!--rehype:className=style-timeline-->
|
||||
|
||||
### Email patch 方式
|
||||
|
||||
```bash
|
||||
# 创建指定 commit sha1 id 之前的 n 次提交补丁
|
||||
$ git format-patch commit_id -n
|
||||
# 创建 300f59991f22826c8478f0c019387c4ca815b085 这个提交的patch
|
||||
$ git format-patch commit_id -1
|
||||
# 提取当前分支最上面的3次提交,生成补丁
|
||||
$ git format-patch -3
|
||||
# 发送者可使用 git-send-email 发送 git format-patch 的结果给接收者
|
||||
# 接收者保存邮件到文件 email.txt,然后应用补丁创建一个提交,会自动包含作者的信息
|
||||
$ git am < email.txt
|
||||
```
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
|
@ -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'.
|
||||
```
|
||||
|
||||
@ -554,6 +574,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- run: npm publish --access public
|
||||
continue-on-error: true
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
```
|
||||
@ -583,14 +604,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 +858,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 +888,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 +938,68 @@ 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
|
||||
```
|
||||
|
||||
### 传递环境变量
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
在 `ci.yml` 上保存环境变量
|
||||
|
||||
```yml
|
||||
- name: Save commit message to environment variable
|
||||
run: echo "COMMIT_MESSAGE=${{ github.event.head_commit.message }}" >> $GITHUB_ENV
|
||||
```
|
||||
|
||||
在 `tag.yml` 上获取环境变量
|
||||
|
||||
```yml
|
||||
- name: Read commit message
|
||||
run: |
|
||||
echo "Commit: ${{ github.event.workflow_run.head_commit.message }}"
|
||||
```
|
||||
|
||||
### 触发下一个工作流
|
||||
|
||||
在 `tag.yml` 上添加判断 `tag` 创建成功触发 `tag-creation-success` 的工作流
|
||||
|
||||
```yml
|
||||
- name: Trigger next workflow if successful
|
||||
if: steps.check_success.outputs.success == 'true'
|
||||
run: |
|
||||
curl -X POST \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-d '{"event_type": "tag-creation-success"}' \
|
||||
https://api.github.com/repos/${{ github.repository }}/dispatches
|
||||
```
|
||||
|
||||
在 `success.yml` 上监听
|
||||
|
||||
```yml
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [tag-creation-success]
|
||||
```
|
||||
|
||||
GitLab CI/CD 迁移到 GitHub Actions
|
||||
---
|
||||
|
||||
|
255
docs/github-cli.md
Normal file
@ -0,0 +1,255 @@
|
||||
Github CLI
|
||||
===
|
||||
|
||||
GitHub CLI 的快速参考,这是一个开源命令行工具,可在终端上启用 GitHub 功能。
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### 安装
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
#### Windows
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 工具 | 安装 | 升级 |
|
||||
| :----- | :--------------------------- | :--------------------------- |
|
||||
| WinGet | `winget install --id Github.cli` | `winget upgrade --id GitHub.cli` |
|
||||
| Scoop | `scoop install gh` | `scoop update gh` |
|
||||
| Choco | `choco install gh` | `choco upgrade gh` |
|
||||
<!--rehype:className=show-header left-align-->
|
||||
|
||||
#### Mac OS
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 工具 | 安装 | 升级 |
|
||||
| :------- | :-------------------- | :------------------------------------------ |
|
||||
| Brew | `brew install gh` | `brew upgrade gh` |
|
||||
| MacPorts | `sudo port install gh`| `sudo port selfupdate && sudo port upgrade gh` |
|
||||
<!--rehype:className=show-header left-align-->
|
||||
|
||||
#### Linux
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
请参见 [安装说明](https://github.com/cli/cli/blob/trunk/docs/install_linux.md) 以获取其他 Linux 发行版的信息。安装脚本:
|
||||
|
||||
```bash
|
||||
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
|
||||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
|
||||
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
|
||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
||||
&& sudo apt update \
|
||||
&& sudo apt install gh -y
|
||||
```
|
||||
|
||||
### 基本用法
|
||||
|
||||
#### 帮助和文档
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
显示命令选项:
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :-------------------- | :------------------------------------------------------------------------------------------------------------- |
|
||||
| `gh help [command]` | 帮助提供应用程序中任何命令的帮助。只需键入 `gh help [命令路径]` 以获取完整详细信息。 |
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 认证
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :-------------------- | :-------------------------------------------------------- |
|
||||
| `gh auth login` | 默认通过基于网页的浏览器进行身份验证 |
|
||||
| `gh auth logout` | 移除主机的身份验证配置 |
|
||||
| `gh auth refresh` | 扩展或修复存储凭据的权限范围 |
|
||||
| `gh auth setup-git` | 配置 Git 使用 GitHub CLI 作为凭据助手 |
|
||||
| `gh auth status` | 验证并显示有关您身份验证状态的信息 |
|
||||
| `gh auth token` | 打印 `gh` 配置使用的身份验证令牌 |
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
使用 GitHub 令牌:
|
||||
|
||||
```shell
|
||||
$ gh auth --with-token < token.txt
|
||||
```
|
||||
|
||||
### 仓库管理
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
#### 常规
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :------------------------ | :------------------------------------------ |
|
||||
| `gh repo create` | 创建一个新的 GitHub 仓库 |
|
||||
| `gh repo list [target]` | 列出某个用户或组织拥有的仓库 |
|
||||
<!--rehype:className=code-nowrap left-align-->
|
||||
|
||||
#### 目标
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :--------------------------- | :-------------------------------------------------------- |
|
||||
| `gh repo archive [repo]` | 存档一个 GitHub 仓库 |
|
||||
| `gh repo clone [dir]` | 在本地克隆一个 GitHub 仓库 |
|
||||
| `gh repo delete [repo]` | 删除一个 GitHub 仓库 |
|
||||
| `gh repo deploy-key` | 管理仓库中的部署密钥 |
|
||||
| `gh repo edit [repo]` | 编辑仓库设置 |
|
||||
| `gh repo fork [repo]` | 创建一个仓库的分叉 |
|
||||
| `gh repo rename [name]` | 重命名一个 GitHub 仓库 |
|
||||
| `gh repo set-default [repo]` | 设置默认的远程仓库 |
|
||||
| `gh repo sync [dest-repo]` | 从源仓库同步到目标仓库 |
|
||||
| `gh repo view [repo]` | 显示一个 GitHub 仓库的描述和 README |
|
||||
<!--rehype:className=code-nowrap left-align-->
|
||||
|
||||
### 问题
|
||||
|
||||
#### 搜索问题
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :------------------------- | :------------------------------- |
|
||||
| `gh search issues [query]` | 在 GitHub 上搜索问题 |
|
||||
|
||||
#### 示例
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
搜索匹配关键词 "readme" 和 "typo" 的问题
|
||||
|
||||
```shell
|
||||
$ gh search issues readme typo
|
||||
```
|
||||
|
||||
搜索匹配短语 "broken feature" 的问题
|
||||
|
||||
```shell
|
||||
$ gh search issues "broken feature"
|
||||
```
|
||||
|
||||
搜索 cli 组织中的问题和拉取请求
|
||||
|
||||
```shell
|
||||
$ gh search issues --include-prs --owner=cli
|
||||
```
|
||||
|
||||
搜索分配给自己的开放问题
|
||||
|
||||
```shell
|
||||
$ gh search issues --assignee=@me --state=open
|
||||
```
|
||||
|
||||
搜索评论数超过 100 的问题
|
||||
|
||||
```shell
|
||||
$ gh search issues --comments=">100"
|
||||
```
|
||||
|
||||
搜索没有标签 "bug" 的问题
|
||||
|
||||
```shell
|
||||
$ gh search issues -- -label:bug
|
||||
```
|
||||
|
||||
### 拉取请求
|
||||
|
||||
**拉取请求操作**
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :---------------- | :----------------------------------------- |
|
||||
| `gh pr create` | 在 GitHub 上创建拉取请求 |
|
||||
| `gh pr list` | 列出 GitHub 仓库中的拉取请求 |
|
||||
| `gh pr status` | 显示相关拉取请求的状态 |
|
||||
|
||||
**示例**
|
||||
|
||||
```shell
|
||||
$ gh pr status
|
||||
```
|
||||
|
||||
示例输出:
|
||||
|
||||
```
|
||||
Current branch
|
||||
#12 Remove the test feature [user:patch-2]
|
||||
- All checks failing - Review required
|
||||
|
||||
Created by you
|
||||
You have no open pull requests
|
||||
|
||||
Requesting a code review from you
|
||||
#13 Fix tests [branch]
|
||||
- 3/4 checks failing - Review required
|
||||
#15 New feature [branch]
|
||||
- Checks passing - Approved
|
||||
```
|
||||
|
||||
### GitHub Actions
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
**常规操作**
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :----------------------- | :--------------------------------------------------------------------------- |
|
||||
| `gh workflow disable` | 禁用工作流,防止其运行或在列出工作流时显示 |
|
||||
| `gh workflow enable` | 启用工作流,允许其运行并在列出工作流时显示 |
|
||||
| `gh workflow list` | 列出工作流文件,默认隐藏禁用的工作流 |
|
||||
| `gh workflow run` | 为给定的工作流创建一个 `workflow_dispatch` 事件 |
|
||||
| `gh workflow view` | 查看工作流的摘要 |
|
||||
|
||||
**运行操作**
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :----------------------- | :----------------------------------------------------------- |
|
||||
| `gh run cancel` | 取消一个工作流运行 |
|
||||
| `gh run delete` | 删除一个工作流运行 |
|
||||
| `gh run download` | 下载由 GitHub Actions 工作流运行生成的工件 |
|
||||
| `gh run list` | 列出最近的工作流运行 |
|
||||
| `gh run rerun` | 重新运行整个运行、仅失败的作业或运行中的特定作业 |
|
||||
| `gh run view` | 查看工作流运行的摘要 |
|
||||
| `gh run watch` | 观看一个运行直到其完成,显示其进度 |
|
||||
|
||||
### 别名
|
||||
|
||||
**常规别名设置**
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :----------------------- | :--------------------------------------------------------- |
|
||||
| `gh alias delete` | 删除设置的别名 |
|
||||
| `gh alias import` | 从 YAML 文件的内容中导入别名 |
|
||||
| `gh alias list` | 打印出所有已配置的别名 |
|
||||
| `gh alias set` | 定义一个单词,当调用时会展开为完整的 `gh` 命令 |
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 发布
|
||||
|
||||
**常规操作**
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :----------------------- | :----------------------------------------- |
|
||||
| `gh release create` | 为一个仓库创建新的 GitHub 发布 |
|
||||
| `gh release list` | 列出一个仓库中的发布 |
|
||||
<!--rehype:className=code-nowrap-->
|
||||
|
||||
**目标命令**
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :------------------------ | :-------------------------------------- |
|
||||
| `gh release delete` | 删除一个发布 |
|
||||
| `gh release delete-asset` | 从一个发布中删除一个资产 |
|
||||
| `gh release download` | 从 GitHub 发布中下载资产 |
|
||||
| `gh release edit` | 编辑一个发布 |
|
||||
| `gh release upload` | 上传资产文件到一个 GitHub 发布 |
|
||||
| `gh release view` | 查看有关一个 GitHub 发布的信息 |
|
||||
<!--rehype:className=code-nowrap-->
|
||||
|
||||
### 配置
|
||||
|
||||
**目标设置**
|
||||
|
||||
| 命令 | 描述 |
|
||||
| :------------------------ | :--------------------------------------------- |
|
||||
| `gh config clear-cache` | 清除 CLI 缓存 |
|
||||
| `gh config get` | 打印给定配置键的值 |
|
||||
| `gh config list` | 打印配置键及其值的列表 |
|
||||
| `gh config set` | 用给定键的值更新配置 |
|
||||
<!--rehype:className=style-list-->
|
614
docs/github-copilot.md
Normal file
@ -0,0 +1,614 @@
|
||||
Github Copilot 备忘清单
|
||||
===
|
||||
|
||||
这是开始使用 [Github Copilot](https://code.visualstudio.com/docs/editor/github-copilot) 的快速参考指南
|
||||
|
||||
入门
|
||||
----
|
||||
|
||||
### 1、账号注册
|
||||
|
||||
需要先拥有一个Github账号,并订阅Copilot。
|
||||
|
||||
事项 | 说明
|
||||
:-|-
|
||||
Github 账号 | [注册地址](https://github.com/signup)
|
||||
订阅 Github Copilot | [订阅地址](https://github.com/features/copilot)
|
||||
|
||||
### 2、安装Vscode插件
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
在扩展商店中搜索安装下面插件
|
||||
|
||||
插件名称 | 功能
|
||||
:-|-
|
||||
`GitHub Copilot`|编辑器中进行代码补全提示
|
||||
`GitHub Copilot Chat`|插件栏可以与copilot对话
|
||||
|
||||
### 3、Vscode 中登陆 Github 账号
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
- 安装后,点击右下角的 `GitHub Copilot` 插件图标,然后点击 `Sign in to GitHub` 登陆。
|
||||
- 或者,点击工具栏中的 `Accounts` 图标,然后点击 `使用 Github 登陆以使用Github Copilot` 进行登陆。
|
||||
|
||||
### 4、Copilot 订阅方案
|
||||
<!--rehype:wrap-class=col-span-2 row-span-1-->
|
||||
方案 | 价格 | 特性
|
||||
:-|-|-
|
||||
Copilot Individual | 10美元/人/月 <br> (学生, 教师, 开源项目贡献者 免费) | 代码补全, 聊天机器人
|
||||
Copilot Business| 19美元/人/月 |代码补全, 聊天机器人, 命令行工具, 安全漏洞筛查, 代码参考, 公共代码筛查, 知识产权, 企业安全与隐私保障
|
||||
Copilot Enterprise| 39美元/人/月 | Business 特性 + 私有代码库的个性化聊天 + 文档搜索总结 + Git Pull Request 摘要 + 代码审查 + 模型微调
|
||||
<!--rehype:className=show-header left-align-->
|
||||
|
||||
### 5、Copilot 使用入口
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|名称 | 描述 |
|
||||
|-|-|
|
||||
`Inline Suggestions` | 在编辑器中紧邻光标所在位置显示建议
|
||||
`Completions Panel` | 在编辑器中展示完整的建议列表
|
||||
`Inline Chat` | 在编辑器中紧邻光标所在位置发起对话
|
||||
`Editor Chat` | 在编辑器中打开完整的对话界面
|
||||
`Silde Chat` | 在编辑器的侧边栏打开对话界面
|
||||
`Quick Chat` | 在顶部唤起对话界面
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
提示技巧
|
||||
----
|
||||
|
||||
### 提示之禅
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
- 你的关系与 `copilot` 的关系,就像作家与插画师的关系。
|
||||
- 为了让 `copilot` 能够绘制出精美的插画(即代码),你需要尽可能全面、干练、清晰地描述你的故事(即上下文)。
|
||||
<!--rehype:className=style-round-->
|
||||
|
||||
### 提示技巧
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
- 1⃣️ 提供上下文信息
|
||||
- 2⃣️ 上下文可被预测
|
||||
|
||||
### 实战教程
|
||||
|
||||
- [Youtube GitHub Copilot 系列](https://www.youtube.com/playlist?list=PLj6YeMhvp2S5_hvBl2SE-7YCHYlLQ0bPt)
|
||||
- [实用技巧:充分利用 GitHub Copilot](https://www.youtube.com/watch?v=CwAzIpc4AnA)
|
||||
- [我如何使用 GitHub Copilot 构建浏览器扩展](https://github.blog/2023-05-12-how-i-used-github-copilot-to-build-a-browser-extension/)
|
||||
|
||||
### 上下文信息的种类
|
||||
<!--rehype:wrap-class=col-span-2 row-span-1-->
|
||||
|
||||
类型|说明
|
||||
-|-
|
||||
文件|Copilot会查看编辑器中当前和紧邻打开的文件。
|
||||
注释|Copilot会根据紧邻的注释,为你的代码提供帮助和建议。如 docstring, 块注释, 行注释之类。
|
||||
命名|良好的命名能帮助Copilot更好地理解你的代码,如函数名, 变量名, 文件名等
|
||||
代码|Copilot会查看你的代码和它附近的代码,以生成帮助你的建议。
|
||||
<!--rehype:className=show-header left-align-->
|
||||
|
||||
### 上下文:文件
|
||||
|
||||
Copilot会查看编辑器中当前和紧邻打开的文件,以分析上下文并提供适当的建议。
|
||||
|
||||
---
|
||||
|
||||
- 1、避免打开过多的文件,以便Copilot能够更好地理解你的代码。
|
||||
- 2、打开的文件尽量相关且有共性。
|
||||
- 3、如果是新项目,可以打开一些模版代码、数据文件以及参考文档等相关示例文件。以便Copilot能够更好地理解你的期望。等已经开发了一些代码后,这些示例文件就可以删除了。
|
||||
|
||||
### 上下文: 注释: 顶部注释
|
||||
|
||||
创建一个新文件时,在文件顶部添加注释,描述你的需求。这对 Copilot 很有帮助。
|
||||
|
||||
\* 下面说明将使用`...`表示copilot开始生成的位置
|
||||
|
||||
```python
|
||||
# Download file from an URL and analyze its content
|
||||
# Details:
|
||||
# * Download the file from an URL
|
||||
# * Save the downloaded files into `./download` folder
|
||||
# * Use `filetype` of the file to specify how to parse
|
||||
# * Filetype can be `.pdf`, `.html`, `.epub`, `.md` and `.txt`
|
||||
# * Use NLP or OCR to get the file content
|
||||
# * Tokenize the file content and get the statistics result
|
||||
|
||||
import ...
|
||||
```
|
||||
|
||||
### 上下文: 注释: 行内注释
|
||||
|
||||
在每个函数上面或重要代码块的上面添加注释,以帮助 Copilot 了解你代码中的一些意图或问题。
|
||||
|
||||
\* 下面说明将使用`...`表示copilot开始生成的位置
|
||||
|
||||
函数上方添加注释说明
|
||||
|
||||
```python
|
||||
# parse the JSON string into User object
|
||||
def ...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
代码添加注释说明
|
||||
|
||||
```python
|
||||
# ...
|
||||
api_sever = FastApi(...)
|
||||
|
||||
# starting the API Sever, enable ssl, bind to 8443 port
|
||||
...
|
||||
```
|
||||
|
||||
### 上下文: 注释: Docstring
|
||||
<!--rehype:wrap-class=col-span-1 row-span-2-->
|
||||
有时候当你已经拥有详细设计文档,但未编写功能代码时,可以直接使用 docstring 中的描述来让 copilot 生成代码。
|
||||
|
||||
```python
|
||||
def send_email(to_address: Email, subject: str, content: HTML): -> StatusCode:
|
||||
"""
|
||||
Send email to specified address
|
||||
|
||||
Parameters
|
||||
----------
|
||||
to_address : Email
|
||||
The email address to send to
|
||||
subject : str
|
||||
The email subject
|
||||
content : HTML
|
||||
The email content
|
||||
|
||||
Returns
|
||||
-------
|
||||
StatusCode
|
||||
The sending result
|
||||
"""
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
### 上下文: 注释: 提问
|
||||
|
||||
> 如果你不想切换到 copilot chat 时,注释也可以用于提问。
|
||||
|
||||
```python
|
||||
# Q: What is the difference between `os.path.join` and `pathlib.PurePath`?
|
||||
# A: ...
|
||||
```
|
||||
|
||||
### 上下文: 注释: Todo
|
||||
|
||||
> 你也可以让 copilot 为你生成 `todo` 列表来评估工作量。
|
||||
|
||||
```python
|
||||
# Parse the json file into a Talks object
|
||||
# TODO:
|
||||
# -[ ] 1. ...
|
||||
```
|
||||
|
||||
### 上下文: 命名
|
||||
|
||||
> 你的命名应该足够明确以便于 Copilot 理解你的意图
|
||||
|
||||
#### bad case
|
||||
|
||||
```python
|
||||
a = 60
|
||||
|
||||
def send(dict):
|
||||
...
|
||||
|
||||
class data:
|
||||
...
|
||||
```
|
||||
|
||||
#### good case
|
||||
|
||||
```python
|
||||
timeout = 60
|
||||
|
||||
def send_email(to_address: Email, subject: str, content: HTML): -> StatusCode:
|
||||
...
|
||||
|
||||
class Email:
|
||||
...
|
||||
```
|
||||
|
||||
### 上下文: 代码: 代码示例
|
||||
|
||||
> 提供片段代码示例,以帮助 Copilot 更好地开始新的开发任务。
|
||||
>
|
||||
> - 使用的框架与库
|
||||
> - 代码风格
|
||||
> - 算法逻辑
|
||||
|
||||
```python
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
from sqlalchemy import ForeignKey
|
||||
from sqlalchemy import String
|
||||
from sqlalchemy.orm import DeclarativeBase
|
||||
from sqlalchemy.orm import Mapped
|
||||
from sqlalchemy.orm import mapped_column
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
class Base(DeclarativeBase):
|
||||
pass
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "user_account"
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
name: Mapped[str] = mapped_column(String(30))
|
||||
fullname: Mapped[Optional[str]]
|
||||
addresses: Mapped[List["Address"]] = relationship(
|
||||
back_populates="user", cascade="all, delete-orphan"
|
||||
)
|
||||
def __repr__(self) -> str:
|
||||
return f"User(id={self.id!r}, name={self.name!r}, fullname={self.fullname!r})"
|
||||
|
||||
# Email Address
|
||||
...
|
||||
```
|
||||
|
||||
### 上下文: 代码: 数据示例
|
||||
|
||||
> 提供片段数据示例,以帮助 Copilot 更好地开始新的开发任务。
|
||||
>
|
||||
> - 数据结构与类型
|
||||
> - 命名
|
||||
> - 值处理逻辑
|
||||
|
||||
```python
|
||||
|
||||
dailogs = [
|
||||
{
|
||||
"timestamp": "May 1, 2023 11:00:00",
|
||||
"text": "Hello, World!",
|
||||
"speaker": "Jack",
|
||||
},
|
||||
{
|
||||
"timestamp": "May 1, 2023 11:01:00",
|
||||
"text": "Hello, Copilot!",
|
||||
"speaker": "Copilot",
|
||||
},
|
||||
]
|
||||
|
||||
# Parse the json object into `Dialog` object
|
||||
...
|
||||
```
|
||||
|
||||
快捷键
|
||||
----
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
对于mac用户建议修改alt相关的快捷键,因为mac上的alt+字母键有可能被输入法使用了。若有自定义过输入法`keylayout`,则忽略这句话。
|
||||
|
||||
另外没有快捷键的命令,可以唤起`命令面板`后输入查询关键字筛选后执行。
|
||||
|
||||
### Github Copilot
|
||||
<!--rehype:wrap-class=col-span-2 row-span-1-->
|
||||
|
||||
#### Copilot 中 Inline Suggestions 相关命令
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`editor.action.inlineSuggest.trigger`| 触发内联建议 | `alt+\` | `alt+\`
|
||||
`editor.action.inlineSuggest.showPrevious`| 显示上一个内联建议 | `alt+[`| `alt+[`
|
||||
`editor.action.inlineSuggest.showNext`| 显示下一个内联建议 | `alt+]`| `alt+]`
|
||||
`editor.action.inlineSuggest.acceptNextWord`| 接受内联建议的下一个字 | `ctl+right`| `cmd+right`
|
||||
`editor.action.inlineSuggest.commit`| 接受内联建议 | `Tab`| `Tab`
|
||||
`editor.action.inlineSuggest.hide`| 隐藏内联建议 | `Esc`| `Esc`
|
||||
`editor.action.inlineSuggest.acceptNextLine`| 接受内联建议的下一行 | - | -
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot 中 Completions Panel 相关命令
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`github.copilot.generate`| 打开 `Completions Panel` | `ctrl+enter`| `ctrl+enter`
|
||||
`github.copilot.acceptCursorPanelSolution`| 接受`Completions Panel`光标所在的建议 | `ctrl+/` | `ctrl+/`
|
||||
`github.copilot.previousPanelSolution`| 查看上一个建议 | `alt+[`| `alt+[`
|
||||
`github.copilot.nextPanelSolution`| 查看下一个建议 | `alt+]`| `alt+]`
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot 中 其他命令
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`github.copilot.toggleCopilot`| 启用/禁用 Copilot 补全提示 | -| -
|
||||
`github.copilot.collectDiagnostics`| 收集诊断信息 | -| -
|
||||
`github.copilot.openLogs`| 打开日志窗口 | -| -
|
||||
`github.copilot.sendFeedback`| 打开社区网站 | -| -
|
||||
`github.copilot.signIn`| 登陆 | -| -
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
### Github Copilot Chat
|
||||
<!--rehype:wrap-class=col-span-2 row-span-1-->
|
||||
|
||||
#### Copilot Chat 中 Chat 相关命令
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`github.copilot.interactiveEditor.explain`|进行解释(选中内容或光标所在的文件)|-|-
|
||||
`github.copilot.terminal.explainTerminalSelection`|对此进行解释(需要在终端中使用)|-|-
|
||||
`github.copilot.terminal.explainTerminalSelectionContextMenu`|Copilot: 对此进行解释(需要在终端中使用)|鼠标右键菜单|鼠标右键菜单
|
||||
`github.copilot.terminal.explainTerminalLastCommand`|对终端中最后一个命令进行解释(需要在终端中使用)|-|-
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot Chat 中 Inline Chat 相关命令
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`inlineChat.start`|代码内聊天| - | -
|
||||
`github.copilot.interactiveEditor.generate`|在此生成(在光标所在位置唤起inline chat的`/generate`功能)| - | -
|
||||
`github.copilot.interactiveEditor.generateDocs`|生成文档| - | -
|
||||
`github.copilot.interactiveEditor.generateTests`|生成测试| - | -
|
||||
`github.copilot.interactiveEditor.fix`|修复此| - | -
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot Chat 中 Quick Chat 相关命令
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`workbench.action.quickchat.toggle`|开启/关闭 Quick Chat|`shift+cmd+i`|`shift+cmd+i`
|
||||
`github.copilot.terminal.suggestCommand`|建议终端命令|`ctrl+i`(仅在终端起作用)|`cmd+i`
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot Chat 中 Editor Chat 相关命令
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`workbench.action.openChat.copilot`|打开编辑器聊天|-|-
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot Chat 其他命令
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`github.copilot.interactiveSession.feedback`|打开github Issues|-|-
|
||||
`github.copilot.debug.workbenchState`|日志工作台状态|-|-
|
||||
`github.copilot.ghpr.applySuggestion`|为Github Pull Request提供代码建议|-|-
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
Copilot Chat 的 Slash Commands 使用技巧
|
||||
----
|
||||
|
||||
在聊天对话框中可以通过`/`开头的命令来与Copilot Chat进行交互。
|
||||
|
||||
### Slash Commands 示例
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
#### Slash Commands 由四部分构成
|
||||
|
||||
|元素|说明|
|
||||
|-|-|
|
||||
|- Agent | 指定Agent, 符号为 `@`, 可选
|
||||
|- Commands | 指定命令, 符号为 `/`, 可选
|
||||
|- 变量 | 引用内容, 符号为 `#`, 可选
|
||||
|- 用户输入的指令 | 可选
|
||||
|
||||
#### 例子
|
||||
|
||||
```
|
||||
/explain def helloworld():...
|
||||
|
||||
@vscode /api 请解释 inlineChat.start 的作用
|
||||
|
||||
@workspace /explain def helloworld():...
|
||||
```
|
||||
|
||||
在每一行代码末尾添加注释进行解释
|
||||
|
||||
#### Agent
|
||||
|
||||
| Agent |说明 |
|
||||
|- |:-|
|
||||
@vscode |vscode命令与插件的问题
|
||||
@workspace|项目workspace相关的问题
|
||||
|
||||
### Inline Chat 的 Slash Commands
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
---
|
||||
|
||||
> 通过命令 `inlineChat.start` 触发 `inline chat` 后使用
|
||||
|
||||
|命令 |说明 |
|
||||
|- |:-|
|
||||
/doc |在此添加文档注释
|
||||
/explain |对选中的代码进行解释
|
||||
/fix |修复此选中的代码
|
||||
/tests |为选中的代码生成单元测试
|
||||
|
||||
---
|
||||
|
||||
通过命令 "github.copilot.interactiveEditor.generate" 触发
|
||||
|
||||
|命令 |说明 |
|
||||
|- |:-|
|
||||
/generate |在此生成, 该命令无法由用户输入
|
||||
|
||||
---
|
||||
|
||||
> 当然也可以直接选中区域,然后在inline chat中输入指令执行 copilot会对选中区域进行指令操作
|
||||
|
||||
#### 常用指令
|
||||
|
||||
- 在每一行代码末尾添加注释进行解释
|
||||
- 使代码满足PEP484要求
|
||||
<!--rehype:className=style-round-->
|
||||
|
||||
### Silde Chat 的 Slash Commands
|
||||
<!--rehype:wrap-class=col-span-1 row-span-2-->
|
||||
|
||||
- 通过命令 `workbench.action.chat.openInSidebar` 触发 `chat` 后使用
|
||||
- 或点击侧边栏上的Copilot聊天按钮
|
||||
- 在Chat输入框中还允许指定Agent(即环境)
|
||||
<!--rehype:className=style-round-->
|
||||
|
||||
#### Slash Commands
|
||||
|
||||
|命令 |说明 |
|
||||
|- |:-|
|
||||
`/api` |回答vscode扩展插件开发的问题
|
||||
`/explain` |对选中的代码进行解释
|
||||
`/fix` |修复此选中的代码
|
||||
`/new` |创建新项目workspace
|
||||
`/newNotebook` |创建新的Jupyter Notebook
|
||||
`/terminal` |解释命令行里的命令
|
||||
`/tests` |为选中的代码生成单元测试
|
||||
`/help` |帮助说明
|
||||
`/clear` |清除会话
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### `/terminal`特有的变量, 以`#`号开头
|
||||
|
||||
> 仅在`/terminal`命令中可用
|
||||
|
||||
| 变量 |说明 |
|
||||
|-|:-|
|
||||
`#terminalLastCommand`|最后一次执行的终端命令
|
||||
`#terminalSelection`|选中的终端命令
|
||||
|
||||
### 的 Slash Commands
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
- Quick Chat 与 Chat 的 Slash Commands相同
|
||||
- Editor Chat 与 Chat 的 Slash Commands相同
|
||||
<!--rehype:className=style-round-->
|
||||
|
||||
参数设置
|
||||
----
|
||||
|
||||
打开 VSCode 命令面板,输入 `Preferences: Open Settings` 来打开配置文件。在文件模式下,您可以配置相关参数。要获取完整的参数说明,请查看 `copilot` 和 `copilot chat` 两个插件目录下的 `package.json` 文件,具体位置可以参考 [VSCode 扩展市场](https://code.visualstudio.com/docs/editor/extension-marketplace#_where-are-extensions-installed)。
|
||||
|
||||
### 完整配置参考
|
||||
|
||||
```json
|
||||
// settings.json
|
||||
{
|
||||
// ...
|
||||
"github.copilot.chat.welcomeMessage": "always",
|
||||
"github.copilot.chat.localeOverride": "zh-CN",
|
||||
"github.copilot.editor.enableCodeActions": true,
|
||||
"github.copilot.editor.iterativeFixing": true,
|
||||
"github.copilot.editor.enableAutoCompletions": true,
|
||||
"github.copilot.enable": {
|
||||
"plaintext": false,
|
||||
"ini": false,
|
||||
"markdown": true,
|
||||
"*": true
|
||||
},
|
||||
"github.copilot.advanced": {
|
||||
"length": 4000,
|
||||
"inlineSuggestCount": 5,
|
||||
"top_p": 1,
|
||||
"temperature": "0.8",
|
||||
"listCount": 10,
|
||||
"stops": {
|
||||
"*": [
|
||||
"\n\n\n"
|
||||
],
|
||||
"python": [
|
||||
"\ndef ",
|
||||
"\nclass ",
|
||||
"\nif ",
|
||||
"\n\n#"
|
||||
]
|
||||
},
|
||||
"debug.showScores": true,
|
||||
"indentationMode": {
|
||||
"python": false,
|
||||
"javascript": false,
|
||||
"javascriptreact": false,
|
||||
"jsx": false,
|
||||
"typescript": false,
|
||||
"typescriptreact": false,
|
||||
"go": false,
|
||||
"ruby": false,
|
||||
"*": true
|
||||
}
|
||||
}
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### 参数说明
|
||||
<!--rehype:wrap-class=col-span-2 row-span-1-->
|
||||
|
||||
#### 代理参数
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
|设置参数 |值类型|说明 |
|
||||
|:--|:--|:--|
|
||||
`"http.proxy"`| string |配置网络代理地址
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
#### Copilot Chat 参数
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
|设置参数 |值类型|说明 |
|
||||
|:--|:--|:--|
|
||||
`"github.copilot.chat.localeOverride"`| string | 设置Copilot本地语言
|
||||
`"github.copilot.chat.welcomeMessage"`| string |Copilot Chat 是否显示欢迎语<br>`first`: 仅第一次启动时, `always`: 总是, `never`: 从不
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
#### Copilot 基本参数
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
|设置参数 |值类型|说明 |
|
||||
|:--|:--|:--|
|
||||
| `"editor.inlineSuggest.enabled"` | boolean | 启用内联建议 |
|
||||
| `"github.copilot.editor.iterativeFixing"` | boolean | 允许 Copilot 提供迭代修复建议 |
|
||||
| `"github.copilot.editor.enableAutoCompletions"` | boolean | 允许 Copilot 提供自动补全 |
|
||||
| `"github.copilot.editor.enableCodeActions"` | boolean | 允许 Copilot 提供代码操作建议,包括重构和优化代码结构、修复错误等 |
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
#### 设置 Copilot 生效的文件类型
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
|设置参数 |值类型|说明 |
|
||||
|:--|:--|:--|
|
||||
`"github.copilot.enable"`| json |请将 `"*": true` 放到末尾 <br>[语言](https://code.visualstudio.com/docs/languages/identifiers)后设置 `false` 表示禁用copilot, 设置 `true` 表示启用
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
#### Copilot 高级参数
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
`github.copilot.advanced` 可以控制模型参数,最终影响到代码生成。其值为json
|
||||
|
||||
| 设置参数 | 值类型 | 说明 |
|
||||
|----------|----------|----------|
|
||||
| `"length"` | 整数 integer | 生成代码的字数,默认为 `500` |
|
||||
| `"top_p"` | 数字 number | 控制模型候选范围,默认值为 `1`,范围为 `0.0~1.0` |
|
||||
| `"temperature"` | 字符串 string | 控制模型创造性,默认值为空,值越大越不可预测,范围为 `0.0~1.0` |
|
||||
| `"inlineSuggestCount"` | 整数 integer | 内联提示的个数,默认为 `3` |
|
||||
| `"listCount"` | 整数 integer | `Completions Panel` 中建议的个数,默认为 `10` |
|
||||
| `"stops"` | JSON | 控制模型代码生成时的停止标志,可按[语言](https://code.visualstudio.com/docs/languages/identifiers)控制 |
|
||||
| `"indentationMode"` | JSON | 指定[语言](https://code.visualstudio.com/docs/languages/identifiers)是否使用该语言的缩进模式,可能与 stops 冲突 |
|
||||
| `"debug.showScores"` | 布尔值 boolean | 在代码建议列表中显示每个建议的分数 |
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
END... ENJOY YOURSELF
|
||||
----
|
||||
|
||||
> 欢迎大家添加新内容,校对、错误请指正。📮邮箱: <a href="mailto:jussker@outlook.com">jussker@outlook.com</a>
|
||||
|
||||
参考来源
|
||||
----
|
||||
|
||||
\[1\]: [GitHub Copilot in VS Code](https://code.visualstudio.com/docs/editor/github-copilot)
|
||||
\[2\]: [How to use GitHub Copilot: Prompts, tips, and use cases](https://github.blog/2023-06-20-how-to-write-better-prompts-for-github-copilot/)
|
||||
\[3\]: [GitHub Copilot Official Website](https://github.com/features/copilot)
|
||||
\[4\]: [GitHub Copilot Series (Youtube)](https://www.youtube.com/playlist?list=PLj6YeMhvp2S5_hvBl2SE-7YCHYlLQ0bPt)
|
||||
\[5\]: [Pragmatic techniques to get the most out of GitHub Copilot (Youtube)](https://www.youtube.com/watch?v=CwAzIpc4AnA)
|
||||
\[6\]: [How I used GitHub Copilot to build a browser extension](https://github.blog/2023-05-12-how-i-used-github-copilot-to-build-a-browser-extension)
|
||||
\[7\]: [Visual Studio Code, Where are extensions installed?](https://code.visualstudio.com/docs/editor/extension-marketplace#_where-are-extensions-installed)
|
||||
\[8\]: [Visual Studio Code, Language Identifiers](https://code.visualstudio.com/docs/languages/identifiers)
|
153
docs/github.md
@ -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
@ -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
|
||||
# 历史大小(最大值数)
|
||||
# 默认值为28800:1天,每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_
|
@ -279,13 +279,26 @@ u := uint(i)
|
||||
s := string(i)
|
||||
```
|
||||
|
||||
#### 如何获取int字符串?
|
||||
#### 字符串与其他类型的相互转换
|
||||
|
||||
```go
|
||||
i := 90
|
||||
// 需要导入“strconv”
|
||||
s := strconv.Itoa(i)
|
||||
fmt.Println(s) // Outputs: 90
|
||||
// 字符串转其他类型
|
||||
str := "90"
|
||||
// 整数类型
|
||||
i, err := strconv.Atoi(str)
|
||||
if err != nil {
|
||||
fmt.Println("转换错误:", err)
|
||||
} else {
|
||||
fmt.Println(i)
|
||||
}
|
||||
// 浮点类型
|
||||
f, err := strconv.ParseFloat(str, 64)
|
||||
// []byte 类型
|
||||
bytes := []byte(str)
|
||||
// 其他类型转字符串
|
||||
str = strconv.Itoa(i)
|
||||
str = strconv.FormatFloat(f, 'f', 2, 64)
|
||||
str = string(bytes[:])
|
||||
```
|
||||
|
||||
Golang 字符串
|
||||
@ -838,6 +851,54 @@ ch <- 3
|
||||
|
||||
参见:[缓冲通道](https://tour.golang.org/concurrency/3)
|
||||
|
||||
### Context
|
||||
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// 创建根 context
|
||||
ctx := context.Background() // 空 context,通常作为根 context
|
||||
todo := context.TODO() // 当不确定使用哪个 context 时使用
|
||||
|
||||
// 创建带取消功能的 context
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel() // 确保所有路径都调用取消函数
|
||||
|
||||
// 创建带超时的 context
|
||||
ctx, cancel = context.WithTimeout(context.Background(), 100*time.Millisecond)
|
||||
defer cancel()
|
||||
|
||||
// 创建带截止时间的 context
|
||||
deadline := time.Now().Add(200 * time.Millisecond)
|
||||
ctx, cancel = context.WithDeadline(context.Background(), deadline)
|
||||
defer cancel()
|
||||
|
||||
// 创建带值的 context
|
||||
ctx = context.WithValue(context.Background(), "key", "value")
|
||||
|
||||
// 从 context 获取值
|
||||
value := ctx.Value("key")
|
||||
fmt.Println(value)
|
||||
|
||||
// 检查 context 是否已取消
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
fmt.Println("Context canceled:", ctx.Err())
|
||||
default:
|
||||
fmt.Println("Context still valid")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Golang 错误控制
|
||||
--------
|
||||
|
||||
|
@ -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` | 从页面上的任何位置搜索
|
||||
|