chore: format markdown code. (#42)

* format: fix markdown

* update: fix markdown

* update: fix cron problems

* update: delete .markdownlintignore

* update

* chore: add tab -> 4 space

* chore: fix tab -> 2 in the .editorconfig
This commit is contained in:
fw_qaq 2022-11-11 01:51:54 +08:00 committed by GitHub
parent ea80136db3
commit 5701da6e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
88 changed files with 1075 additions and 1126 deletions

7
.editorconfig Normal file
View File

@ -0,0 +1,7 @@
root = true
[./docs/*.md]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true

View File

@ -1,4 +1,4 @@
{ {
"**/*.{mjs,css,json,prettierrc,lintstagedrc}": ["prettier --write"], "**/*.{mjs,css,json,prettierrc,lintstagedrc}": ["prettier --write"],
"./docs/*.md": ["markdownlint --fix ./docs"] "./docs/*.md": ["npx markdownlint-cli --fix ./docs"]
} }

View File

@ -4,5 +4,9 @@
"MD014": false, "MD014": false,
"MD024": false, "MD024": false,
"MD033": false, "MD033": false,
"MD040": false "MD040": false,
"MD010": {
"code_blocks": true,
"spaces_per_tab": 4
}
} }

View File

@ -18,7 +18,6 @@ Ansible 备忘清单
- [Ansible 官方文档](https://docs.ansible.com) - [Ansible 官方文档](https://docs.ansible.com)
### 配置位置 ### 配置位置
文件路径 | 说明 文件路径 | 说明
@ -27,7 +26,6 @@ Ansible 备忘清单
`~/ansible.cfg` | 用户特定的配置 `~/ansible.cfg` | 用户特定的配置
`$pwd/ansible.cfg` | 当前目录下的配置 `$pwd/ansible.cfg` | 当前目录下的配置
### Inventory文件(hosts列表) ### Inventory文件(hosts列表)
#### 静态Inventory #### 静态Inventory
@ -86,6 +84,7 @@ proxy=proxy.atlanta.example.com
```shell ```shell
$ ansible all --list-hosts $ ansible all --list-hosts
``` ```
ping所有目标 ping所有目标
```shell ```shell
@ -131,7 +130,7 @@ $ ansible
$ ansible <host-pattern> [options] $ ansible <host-pattern> [options]
``` ```
---- ---
:- | - :- | -
:- | - :- | -
@ -219,7 +218,6 @@ $ ansible-galaxy init --offline <ROLE>
``` ```
<!--rehype:className=wrap-text--> <!--rehype:className=wrap-text-->
### ansible-doc ### ansible-doc
在本地访问文档 在本地访问文档
@ -241,13 +239,13 @@ $ ansible-doc [options] [module...]
`--version` | 显示程序的版本号并退出 `--version` | 显示程序的版本号并退出
<!--rehype:className=style-list--> <!--rehype:className=style-list-->
### ansible-vault ### ansible-vault
```bash ```bash
$ ansible-vault $ ansible-vault
$ ansible-vault [create|decrypt|edit|encrypt|rekey|view] [--help] [options] vaultfile.yml $ ansible-vault [create|decrypt|edit|encrypt|rekey|view] [--help] [options] vaultfile.yml
``` ```
--- ---
:- | - :- | -
@ -268,6 +266,7 @@ $ ansible-vault [create|decrypt|edit|encrypt|rekey|view] [--help] [options] vaul
$ ansible-playbook $ ansible-playbook
$ ansible-playbook playbook.yml $ ansible-playbook playbook.yml
``` ```
--- ---
:- | - :- | -
@ -336,6 +335,7 @@ $ ansible-playbook playbook.yml
$ ansible-pull $ ansible-pull
$ ansible-pull -U <repository> [options] $ ansible-pull -U <repository> [options]
``` ```
--- ---
:- | - :- | -
@ -394,10 +394,9 @@ $ ansible-pull -U <repository> [options]
<!-- ### ansible-playbook --> <!-- ### ansible-playbook -->
<!-- todo --> <!-- todo -->
另见 另见
--- ---
[Getting started with Ansible](https://docs.ansible.com/ansible/latest/getting_started/index.html) [Getting started with Ansible](https://docs.ansible.com/ansible/latest/getting_started/index.html)
[Introduction to ad hoc commands](https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html) [Introduction to ad hoc commands](https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html)
[Ansible cheatsheet](https://github.com/luckylittle/ansible-cheatsheet/blob/master/ansible-cheatsheet.txt) [Ansible cheatsheet](https://github.com/luckylittle/ansible-cheatsheet/blob/master/ansible-cheatsheet.txt)

View File

@ -59,7 +59,8 @@ $0/NR ▶ │ 1 │ baidu.com │ awk │
$0/NR ▶ │ 2 │ google.com │ 25 │ $0/NR ▶ │ 2 │ google.com │ 25 │
└──────┴──────────────┴───────┘ └──────┴──────────────┴───────┘
``` ```
---
----
```shell ```shell
# 第一个和最后一个字段 # 第一个和最后一个字段
@ -253,7 +254,6 @@ awk -v varName="$PWD" '
END {print varName}' </dev/null END {print varName}' </dev/null
``` ```
Awk 运算符 Awk 运算符
--------- ---------
@ -366,7 +366,6 @@ Awk 函数
`toupper(s)` | 字符串 `s` 转大写 `toupper(s)` | 字符串 `s` 转大写
`getline` | 将 `$0` 设置为当前输入文件中的下一个输入记录 `getline` | 将 `$0` 设置为当前输入文件中的下一个输入记录
### 用户定义函数 ### 用户定义函数
```shell ```shell
@ -424,7 +423,6 @@ awk 'BEGIN {
}' }'
``` ```
### 带拆分的数组 ### 带拆分的数组
```shell ```shell
@ -536,7 +534,6 @@ awk -F: '{
}' /etc/passwd }' /etc/passwd
``` ```
Awk 循环 Awk 循环
---------- ----------
@ -744,6 +741,7 @@ daemon /sbin
------------- -------------
### 正则表达式元字符 ### 正则表达式元字符
- `\` - `\`
- `^` - `^`
- `$` - `$`

View File

@ -64,7 +64,6 @@ NAME = "John" # => Error (关于空间)
见:[特殊参数](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables) 见:[特殊参数](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables)
### 函数 ### 函数
```bash ```bash
@ -265,7 +264,9 @@ for e in "${Fruits[@]}"; do
echo $e echo $e
done done
``` ```
#### With index #### With index
```bash ```bash
for i in "${!Fruits[@]}"; do for i in "${!Fruits[@]}"; do
printf "%s\t%s\n" "$i" "${Fruits[$i]}" printf "%s\t%s\n" "$i" "${Fruits[$i]}"
@ -443,7 +444,6 @@ fi
`[[ f1 -ot f2 ]]` | f2 早于 f1 `[[ f1 -ot f2 ]]` | f2 早于 f1
`[[ f1 -ef f2 ]]` | 相同的文件 `[[ f1 -ef f2 ]]` | 相同的文件
### 更多条件 ### 更多条件
条件 | 描述 条件 | 描述
@ -570,7 +570,6 @@ while :; do
done done
``` ```
### 正在读取行 ### 正在读取行
```bash ```bash
@ -720,7 +719,6 @@ Bash 历史
`!!` 可以替换为任何有效的扩展,即 `!cat``!-2``!42` 等。 `!!` 可以替换为任何有效的扩展,即 `!cat``!-2``!42` 等。
各种各样的 各种各样的
------------- -------------
@ -741,7 +739,6 @@ $(($RANDOM%200)) # Random number 0..199
pwd # still in first directory pwd # still in first directory
``` ```
### 检查命令 ### 检查命令
```bash ```bash
@ -765,7 +762,6 @@ python hello.py &>/dev/null # 标准输出和标准错误到空null
python hello.py < foo.txt # foo.txt 提供给 python 的标准输入 python hello.py < foo.txt # foo.txt 提供给 python 的标准输入
``` ```
### 来源相对 ### 来源相对
```bash ```bash
@ -791,7 +787,6 @@ case "$1" in
esac esac
``` ```
### 陷阱错误 ### 陷阱错误
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
@ -862,7 +857,6 @@ fi
见[特殊参数](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables)。 见[特殊参数](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables)。
### grep 检查 ### grep 检查
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
@ -872,7 +866,6 @@ if grep -q 'foo' ~/.bash_history; then
fi fi
``` ```
### 反斜杠转义 ### 反斜杠转义
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -963,11 +956,11 @@ echo "${args[@]}"
另见 另见
---- ----
* [Shell 教程](https://jaywcjlove.github.io/shell-tutorial) _(jaywcjlove.github.io)_ - [Shell 教程](https://jaywcjlove.github.io/shell-tutorial) _(jaywcjlove.github.io)_
* [Devhints](https://devhints.io/bash) _(devhints.io)_ - [Devhints](https://devhints.io/bash) _(devhints.io)_
* [Bash-hackers wiki](http://wiki.bash-hackers.org/) _(bash-hackers.org)_ - [Bash-hackers wiki](http://wiki.bash-hackers.org/) _(bash-hackers.org)_
* [Shell vars](http://wiki.bash-hackers.org/syntax/shellvars) _(bash-hackers.org)_ - [Shell vars](http://wiki.bash-hackers.org/syntax/shellvars) _(bash-hackers.org)_
* [Learn bash in y minutes](https://learnxinyminutes.com/docs/bash/) _(learnxinyminutes.com)_ - [Learn bash in y minutes](https://learnxinyminutes.com/docs/bash/) _(learnxinyminutes.com)_
* [Bash Guide](http://mywiki.wooledge.org/BashGuide) _(mywiki.wooledge.org)_ - [Bash Guide](http://mywiki.wooledge.org/BashGuide) _(mywiki.wooledge.org)_
* [ShellCheck](https://www.shellcheck.net/) _(shellcheck.net)_ - [ShellCheck](https://www.shellcheck.net/) _(shellcheck.net)_
* [shell - Standard Shell](https://devmanual.gentoo.org/tools-reference/bash/index.html) _(devmanual.gentoo.org)_ - [shell - Standard Shell](https://devmanual.gentoo.org/tools-reference/bash/index.html) _(devmanual.gentoo.org)_

View File

@ -565,8 +565,8 @@ printf("Line 6 - c 的值是 %d\n", c );
`\|` | 按位或运算符,按二进制位进行"或"运算 | `(A \| B)` 将得到 `61` 即为 0011 1101 `\|` | 按位或运算符,按二进制位进行"或"运算 | `(A \| B)` 将得到 `61` 即为 0011 1101
`^` | 异或运算符,按二进制位进行"异或"运算 | `(A ^ B)` 将得到 `49` 即为 0011 0001 `^` | 异或运算符,按二进制位进行"异或"运算 | `(A ^ B)` 将得到 `49` 即为 0011 0001
`~` | 取反运算符,按二进制位进行"取反"运算 | `(~A)` 将得到 `-61` 即为 1100 0011 `~` | 取反运算符,按二进制位进行"取反"运算 | `(~A)` 将得到 `-61` 即为 1100 0011
`<<` | 二进制左移运算符 | `A << 2` 将得到 `240` 即为 1111 0000 `<<` | 二进制左移运算符 | `A << 2` 将得到 `240` 即为 1111 0000
`>>` | 二进制右移运算符 | `A >> 2` 将得到 `15` 即为 0000 1111 `>>` | 二进制右移运算符 | `A >> 2` 将得到 `15` 即为 0000 1111
数据类型 Data Types 数据类型 Data Types
--- ---
@ -608,7 +608,7 @@ printf("%c\n", myLetter);
printf("%lf\n", myDouble); printf("%lf\n", myDouble);
``` ```
--- ----
数据类型 | 说 明 数据类型 | 说 明
:- | :- :- | :-
@ -620,7 +620,6 @@ printf("%lf\n", myDouble);
`double` | 双精度浮点型 `double` | 双精度浮点型
`void` | 无类型 `void` | 无类型
### 基本格式说明符 ### 基本格式说明符
| 格式说明符 | 数据类型 | | 格式说明符 | 数据类型 |
@ -743,8 +742,6 @@ Carole 和 Debra: 我们爱你!
需要把一个宏的参数转换为字符串常量时,使用字符串常量化运算符 `#` 需要把一个宏的参数转换为字符串常量时,使用字符串常量化运算符 `#`
### 标记粘贴运算符(## ### 标记粘贴运算符(##
```c ```c
@ -821,12 +818,12 @@ void myFunction() { // 声明 declaration
} }
``` ```
--- ----
- `Declaration` 声明函数名称、返回类型和参数 _(如果有)_ - `Declaration` 声明函数名称、返回类型和参数 _(如果有)_
- `Definition` 函数体 _(要执行的代码)_ - `Definition` 函数体 _(要执行的代码)_
--- ----
```c ```c
// 函数声明 // 函数声明
@ -949,7 +946,7 @@ printf("%f", floor(1.4)); // 四舍五入 (舍)
printf("%f", pow(4, 3)); // x(4)的y(3)次方 printf("%f", pow(4, 3)); // x(4)的y(3)次方
``` ```
--- ----
- `abs(x)` 绝对值 - `abs(x)` 绝对值
- `acos(x)` 反余弦值 - `acos(x)` 反余弦值
@ -1304,16 +1301,21 @@ void main (){
- 安装 [`Docker`](./docker.md) - 安装 [`Docker`](./docker.md)
- 创建 [`Dockerfile`](./dockerfile.md) 文件 - 创建 [`Dockerfile`](./dockerfile.md) 文件
```dockerfile ```dockerfile
FROM alpine:3.14 FROM alpine:3.14
RUN apk add --no-cache gcc musl-dev RUN apk add --no-cache gcc musl-dev
RUN apk add --no-cache g++ RUN apk add --no-cache g++
``` ```
- 生成本地 myalpine 镜像 - 生成本地 myalpine 镜像
```bash ```bash
docker build -t myalpine . docker build -t myalpine .
``` ```
- 运行映像,把当前路径 `($PWD)` 映射至容器的 `/test` 目录,用 `gcc` 编译程序,`exit`返回 - 运行映像,把当前路径 `($PWD)` 映射至容器的 `/test` 目录,用 `gcc` 编译程序,`exit`返回
```bash ```bash
docker run -it -v $PWD:/test myalpine docker run -it -v $PWD:/test myalpine
root@b1a38bd7107a:/# cd test root@b1a38bd7107a:/# cd test
@ -1324,7 +1326,6 @@ void main (){
``` ```
<!--rehype:className=style-timeline--> <!--rehype:className=style-timeline-->
另见 另见
--- ---

View File

@ -265,7 +265,7 @@ $ cargo install --path .
$ cargo install --list $ cargo install --list
``` ```
---- ---
- `--vers version` - `--vers version`
- `--version version` 指定要安装的版本 - `--version version` 指定要安装的版本
@ -314,13 +314,13 @@ $ cargo uninstall ripgrep
$ cargo login [options] [token] $ cargo login [options] [token]
``` ```
---- ---
:-|:- :-|:-
:-|:- :-|:-
`--registry` | 要使用的注册表的名称 `--registry` | 要使用的注册表的名称
---- ---
:-|:- :-|:-
:-|:- :-|:-
@ -338,7 +338,8 @@ $ cargo owner --add username foo
# 从包中删除所有者: # 从包中删除所有者:
$ cargo owner --remove username foo $ cargo owner --remove username foo
``` ```
----
---
:-|:- :-|:-
:-|:- :-|:-
@ -383,7 +384,7 @@ $ cargo owner --remove username foo
$ cargo package [options] $ cargo package [options]
``` ```
---- ---
- `-l`, `--list` 输出包中包含的文件(不实际进行打包)。 - `-l`, `--list` 输出包中包含的文件(不实际进行打包)。
- `--no-verify` 构建包时不进行校验。 - `--no-verify` 构建包时不进行校验。

View File

@ -107,7 +107,6 @@ d rwx r-x r-x
| `a` | 全部,和 ugo 一样 | | `a` | 全部,和 ugo 一样 |
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 权限 ### 权限
| 缩写 | 权限 | 值 | | 缩写 | 权限 | 值 |
@ -138,7 +137,6 @@ Chmod 示例
| `-` | 删除 | | `-` | 删除 |
| `=` | 设置 | | `=` | 设置 |
### chmod 600 ### chmod 600
```shell ```shell

View File

@ -6,6 +6,8 @@ CSS 定义了一大组[命名颜色](https://www.w3.org/TR/css-color-4/#named-co
Named Colors Named Colors
--- ---
<!-- markdownlint-disable MD038 -->
### 颜色列表 ### 颜色列表
<!--rehype:wrap-class=col-span-3&style=display:none;&wrap-style=padding-top: 0;--> <!--rehype:wrap-class=col-span-3&style=display:none;&wrap-style=padding-top: 0;-->
@ -760,7 +762,6 @@ HSL 颜色示例
</table> </table>
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 150° Green-Cyans ### 150° Green-Cyans
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->
@ -880,7 +881,6 @@ HSL 颜色示例
</table> </table>
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 180° Cyans ### 180° Cyans
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->
@ -1000,7 +1000,6 @@ HSL 颜色示例
</table> </table>
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 210° Cyan-Blues ### 210° Cyan-Blues
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->
@ -1120,7 +1119,6 @@ HSL 颜色示例
</table> </table>
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 240° blues ### 240° blues
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->
@ -1240,7 +1238,6 @@ HSL 颜色示例
</table> </table>
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 270° Blue-Magentas ### 270° Blue-Magentas
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->
@ -1360,7 +1357,6 @@ HSL 颜色示例
</table> </table>
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 300° Magentas ### 300° Magentas
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->
@ -1480,7 +1476,6 @@ HSL 颜色示例
</table> </table>
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 330° Magenta-Reds ### 330° Magenta-Reds
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->
@ -1600,7 +1595,6 @@ HSL 颜色示例
</table> </table>
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
另见 另见
---- ----

View File

@ -209,7 +209,6 @@ $ conan inspect boost/1.74.0
请参阅 [conan get](https://docs.conan.io/en/latest/reference/commands/consumer/get.html) 和 [conan inspect](https://docs.conan.io/en/latest/reference/commands/misc/inspect.html) 参考 请参阅 [conan get](https://docs.conan.io/en/latest/reference/commands/consumer/get.html) 和 [conan inspect](https://docs.conan.io/en/latest/reference/commands/misc/inspect.html) 参考
### Lockfiles ### Lockfiles
创建一个锁文件: 创建一个锁文件:

View File

@ -1,7 +1,6 @@
Cron 备忘清单 Cron 备忘清单
=== ===
[Cron](https://en.wikipedia.org/wiki/Cron) 最适合安排重复性任务。 可以使用关联的 at 实用程序来完成一次性任务的调度。 [Cron](https://en.wikipedia.org/wiki/Cron) 最适合安排重复性任务。 可以使用关联的 at 实用程序来完成一次性任务的调度。
Crontab 格式 Crontab 格式
@ -27,7 +26,7 @@ Min Hour Day Mon Weekday
└───────────────────── 分钟 (0..59) └───────────────────── 分钟 (0..59)
``` ```
------ -------
| 字段 | 范围 | 特殊字符 | | 字段 | 范围 | 特殊字符 |
|--------------|--------|--------------------| |--------------|--------|--------------------|
@ -38,7 +37,6 @@ Min Hour Day Mon Weekday
| 星期几 | 0 - 6 | , - * ? / L # | | 星期几 | 0 - 6 | , - * ? / L # |
<!--rehype:className=show-header --> <!--rehype:className=show-header -->
### 示例 ### 示例
| Example | Description | | Example | Description |
@ -56,7 +54,6 @@ Min Hour Day Mon Weekday
| `0 0 0 1 1 *` | 每年 1 月 1 日(每年) | | `0 0 0 1 1 *` | 每年 1 月 1 日(每年) |
| `@reboot` | 每次重启 _(非标准)_ | | `@reboot` | 每次重启 _(非标准)_ |
### 特殊字符串 ### 特殊字符串
| 特殊字符串 | 意义 | | 特殊字符串 | 意义 |
@ -64,14 +61,13 @@ Min Hour Day Mon Weekday
| @reboot | 运行一次,在系统启动时 _非标准_ | | @reboot | 运行一次,在系统启动时 _非标准_ |
| @yearly | 每年运行一次“0 0 1 1 *” _非标准_ | | @yearly | 每年运行一次“0 0 1 1 *” _非标准_ |
| @annually | (与@yearly 相同_非标准_ | | @annually | (与@yearly 相同_非标准_ |
| @monthly | 每月运行一次“0 0 1 * *_非标准_ | | @monthly | 每月运行一次“0 0 1 \* \*_非标准_ |
| @weekly | 每周运行一次“0 0 * * 0” _非标准_ | | @weekly | 每周运行一次“0 0 \* \* 0” _非标准_ |
| @daily | 每天运行一次“0 0 * * *” _非标准_ | | @daily | 每天运行一次“0 0 \* \* \*” _非标准_ |
| @midnight | (与@daily 相同_非标准_ | | @midnight | (与@daily 相同_非标准_ |
| @hourly | 每小时运行一次“0 * * * *_非标准_ | | @hourly | 每小时运行一次“0 \* \* \* \*_非标准_ |
<!--rehype:className=show-header --> <!--rehype:className=show-header -->
### Crontab 命令 ### Crontab 命令
| - | - | | - | - |
@ -82,7 +78,6 @@ Min Hour Day Mon Weekday
| `crontab -v` | 显示您上次编辑 crontab 文件的时间。 _非标准_ | | `crontab -v` | 显示您上次编辑 crontab 文件的时间。 _非标准_ |
| `echo "@reboot echo hi" | crontab` | 轻松添加任务 | | `echo "@reboot echo hi" | crontab` | 轻松添加任务 |
### 特殊字符 ### 特殊字符
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
@ -97,7 +92,6 @@ Min Hour Day Mon Weekday
`问号(?)` | 可以代替“*”并允许用于月份和星期几。使用仅限于 cron 表达式中的 `月份中的某天``星期几` `问号(?)` | 可以代替“*”并允许用于月份和星期几。使用仅限于 cron 表达式中的 `月份中的某天``星期几`
<!--rehype:className=show-header auto-wrap--> <!--rehype:className=show-header auto-wrap-->
## Also see ## Also see
* [Devhints](https://devhints.io/cron) _(devhints.io)_ * [Devhints](https://devhints.io/cron) _(devhints.io)_

View File

@ -149,14 +149,14 @@ div {
} }
``` ```
查看: [Flexbox](#css-flexbox) | [Flex Tricks](#css-flexbox-tricks) 查看: [Flexbox](#css-flexbox) | [Flex Tricks](#css-flexbox-技巧)
### Grid 布局 ### Grid 布局
```css ```css
#container { #container {
display: grid; display: grid;
grid: repeat(2, 60px) / auto-flow 80px; s grid: repeat(2, 60px) / auto-flow 80px;
} }
#container > div { #container > div {
background-color: #8ca0ff; background-color: #8ca0ff;
@ -165,7 +165,7 @@ div {
} }
``` ```
查看: [Grid Layout](#css-grid-layout) 查看: [Grid Layout](#grid-布局)
### 变量和计数器 ### 变量和计数器
@ -244,7 +244,6 @@ p:first-child {
另见: [元素](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Type_selectors) / [](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Class_selectors) / [ID](https://developer.mozilla.org/zh-CN/docs/Web/CSS/ID_selectors) / [通配](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Universal_selectors) 选择器 另见: [元素](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Type_selectors) / [](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Class_selectors) / [ID](https://developer.mozilla.org/zh-CN/docs/Web/CSS/ID_selectors) / [通配](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Universal_selectors) 选择器
### 组合器 ### 组合器
选择器 | 说明 选择器 | 说明
@ -277,10 +276,10 @@ p:first-child {
选择器 | 说明 选择器 | 说明
:- | :- :- | :-
`a:link ` | 链接正常 [#](https://developer.mozilla.org/zh-CN/docs/Web/CSS/:link) `a:link` | 链接正常 [#](https://developer.mozilla.org/zh-CN/docs/Web/CSS/:link)
`a:active ` | 链接处于点击状态 [#](https://developer.mozilla.org/zh-CN/docs/Web/CSS/:active) `a:active` | 链接处于点击状态 [#](https://developer.mozilla.org/zh-CN/docs/Web/CSS/:active)
`a:hover ` | 鼠标悬停链接 [#](https://developer.mozilla.org/zh-CN/docs/Web/CSS/:hover) `a:hover` | 鼠标悬停链接 [#](https://developer.mozilla.org/zh-CN/docs/Web/CSS/:hover)
`a:visited ` | 访问链接 [#](https://developer.mozilla.org/zh-CN/docs/Web/CSS/:visited) `a:visited` | 访问链接 [#](https://developer.mozilla.org/zh-CN/docs/Web/CSS/:visited)
--- ---
@ -565,7 +564,6 @@ CSS 盒子模型
另见: [Visibility](https://developer.mozilla.org/zh-CN/docs/Web/CSS/visibility) 另见: [Visibility](https://developer.mozilla.org/zh-CN/docs/Web/CSS/visibility)
### Auto 关键字 ### Auto 关键字
```css ```css
@ -577,7 +575,6 @@ div {
另见: [边距(margin)](https://developer.mozilla.org/zh-CN/docs/Web/CSS/margin) 另见: [边距(margin)](https://developer.mozilla.org/zh-CN/docs/Web/CSS/margin)
### 溢出(Overflow) ### 溢出(Overflow)
```css ```css
@ -804,7 +801,7 @@ flex-wrap: nowrap | wrap | wrap-reverse;
flex-direction: row | row-reverse | column | column-reverse; flex-direction: row | row-reverse | column | column-reverse;
``` ```
---- ---
```bash ```bash
╭┈┈╮ ▲ ╭┈┈╮ ┆ ╭┈┈╮ ▲ ╭┈┈╮ ┆
@ -825,7 +822,7 @@ column-reverse column row row-reverse
align-items: flex-start | flex-end | center | baseline | stretch; align-items: flex-start | flex-end | center | baseline | stretch;
``` ```
---- ---
```css ```css
▶ flex-start(起点对齐) ▶ flex-end(终点对齐) ▶ flex-start(起点对齐) ▶ flex-end(终点对齐)
@ -863,7 +860,7 @@ align-content: flex-start | flex-end | center | space-between | space-around | s
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
---- ---
```css ```css
▶ flex-start(起点对齐) ▶ flex-end(终点对齐) ▶ flex-start(起点对齐) ▶ flex-end(终点对齐)
@ -903,7 +900,7 @@ align-content: flex-start | flex-end | center | space-between | space-around | s
} }
``` ```
---- ---
```css ```css
╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮
@ -927,7 +924,7 @@ align-content: flex-start | flex-end | center | space-between | space-around | s
} }
``` ```
---- ---
```css ```css
╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮
@ -983,7 +980,6 @@ CSS Flexbox 技巧
### 移动布局 ### 移动布局
```css ```css
.container { .container {
display: flex; display: flex;
@ -1166,7 +1162,6 @@ grid-row-end: span 2;
} }
``` ```
### Justify Self ### Justify Self
```css ```css
@ -1376,7 +1371,6 @@ a[href^="http"]:empty::before {
如果 `<a>` 标签里面没有内容,将 `href` 的值作为内容展示 如果 `<a>` 标签里面没有内容,将 `href` 的值作为内容展示
### 使用 :root 表示灵活类型 ### 使用 :root 表示灵活类型
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -1429,7 +1423,6 @@ div {
通过样式来控制一个元素 `div` 是否可以编辑 通过样式来控制一个元素 `div` 是否可以编辑
另见 另见
--------- ---------

View File

@ -13,7 +13,6 @@ Curl 是一种在服务器之间传输数据的工具,支持协议,包括 HT
- [Curl GitHub 源码仓库](https://github.com/curl/curl) _(github.com)_ - [Curl GitHub 源码仓库](https://github.com/curl/curl) _(github.com)_
- [Curl 官方网站](https://curl.se/) _(curl.se)_ - [Curl 官方网站](https://curl.se/) _(curl.se)_
### Options ### Options
<!--rehype:wrap-class=col-span-2 row-span-2--> <!--rehype:wrap-class=col-span-2 row-span-2-->

View File

@ -17,17 +17,20 @@ $ pip --version
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
如果你没有安装 PIP你可以从这个页面下载并安装它https://pypi.org/project/pip/ 如果你没有安装 PIP你可以从这个页面下载并安装它<https://pypi.org/project/pip/>
### 入门 ### 入门
<!--rehype:wrap-class=row-span-4--> <!--rehype:wrap-class=row-span-4-->
- 创建虚拟环境 - 创建虚拟环境
```bash ```bash
$ py -m venv myproject # Windows $ py -m venv myproject # Windows
$ python -m venv myproject # Unix/MacOS $ python -m venv myproject # Unix/MacOS
``` ```
- 其中包含子文件夹和文件,如下所示 - 其中包含子文件夹和文件,如下所示
```bash ```bash
myproject myproject
├┈Include ├┈Include
@ -35,21 +38,27 @@ $ pip --version
├┈Scripts ├┈Scripts
╰┈pyvenv.cfg ╰┈pyvenv.cfg
``` ```
- 以下命令来激活环境 - 以下命令来激活环境
```bash ```bash
# Windows: # Windows:
myproject\Scripts\activate.bat myproject\Scripts\activate.bat
# Unix/MacOS: # Unix/MacOS:
source myproject/bin/activate source myproject/bin/activate
``` ```
- 提示符中看到以下结果: - 提示符中看到以下结果:
```bash ```bash
# Windows: # Windows:
(myproject) C:\Users\Your Name> (myproject) C:\Users\Your Name>
# Unix/MacOS: # Unix/MacOS:
(myproject) ... $ (myproject) ... $
``` ```
- 安装 Django - 安装 Django
```bash ```bash
# Windows: # Windows:
(myproject) C:\Users\Name>py -m pip install Django (myproject) C:\Users\Name>py -m pip install Django
@ -762,9 +771,6 @@ function myFunction() {
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
另见 另见
---- ----

View File

@ -21,7 +21,6 @@ $ docker run -d -p 80:80 docker/getting-started
- `-p 80:80` - 将端口 80 映射到容器中的端口 80 - `-p 80:80` - 将端口 80 映射到容器中的端口 80
- `docker/getting-started` - 要使用的镜像 - `docker/getting-started` - 要使用的镜像
在前台创建并运行容器 在前台创建并运行容器
```shell ```shell
@ -86,7 +85,6 @@ Docker 容器
`docker stats nginx-server` | 容器资源使用 `docker stats nginx-server` | 容器资源使用
`docker diff nginx-server` | 列出对容器所做的更改 `docker diff nginx-server` | 列出对容器所做的更改
### 创建容器 ### 创建容器
```shell ```shell
@ -235,9 +233,9 @@ docker network create -d overlay \
| Docker 语法 | 说明 | | Docker 语法 | 说明 |
|------------|------| |------------|------|
`docker search search_word` | 在 docker hub 中搜索镜像。 `docker search search_word` | 在 docker hub 中搜索镜像。
`docker pull user/image ` | 从 docker hub 下载镜像。 `docker pull user/image` | 从 docker hub 下载镜像。
`docker login ` | 向 docker hub 进行身份验证 `docker login` | 向 docker hub 进行身份验证
`docker push user/image ` | 将镜像上传到 docker hub。 `docker push user/image` | 将镜像上传到 docker hub。
### 镜像仓库命令 ### 镜像仓库命令
<!--rehype:wrap-class=row-span-3--> <!--rehype:wrap-class=row-span-3-->
@ -625,8 +623,8 @@ $ docker run --name my-nginx \
```bash ```bash
$ docker run --name my-postgres \ $ docker run --name my-postgres \
-e POSTGRES_PASSWORD=mysecretpassword \ -e POSTGRES_PASSWORD=mysecretpassword \
-e PGDATA=/var/lib/postgresql/data/pgdata \ -e PGDATA=/var/lib/postgresql/data/pgdata \
-v $HOME/nginx/mount:/var/lib/postgresql/data \ -v $HOME/nginx/mount:/var/lib/postgresql/data \
-d postgres -d postgres
``` ```

View File

@ -3,7 +3,6 @@ Electron 备忘清单
此快速参考备忘单提供了 Electron v21 API 说明和使用示例。 此快速参考备忘单提供了 Electron v21 API 说明和使用示例。
入门 入门
---- ----
@ -15,11 +14,14 @@ Electron 备忘清单
#### 创建你的应用程序 #### 创建你的应用程序
- 安装 - 安装
```bash ```bash
mkdir my-app && cd my-app mkdir my-app && cd my-app
npm init npm init
``` ```
在项目根目录会生成 `package.json` 在项目根目录会生成 `package.json`
```json ```json
{ {
"name": "my-app", "name": "my-app",
@ -30,22 +32,30 @@ Electron 备忘清单
"license": "MIT" "license": "MIT"
} }
``` ```
- 安装依赖包 - 安装依赖包
```bash ```bash
npm install --save-dev electron npm install --save-dev electron
``` ```
- 添加开发模式打开您的应用命令 - 添加开发模式打开您的应用命令
```js ```js
"scripts": { "scripts": {
"start": "electron ." "start": "electron ."
} }
``` ```
- 运行命令,启动应用程序 - 运行命令,启动应用程序
```bash ```bash
npm start npm start
``` ```
入口都是 `main` 文件。这个文件控制了主进程它运行在一个完整的Node.js环境中 入口都是 `main` 文件。这个文件控制了主进程它运行在一个完整的Node.js环境中
- 创建 `index.html` 页面 - 创建 `index.html` 页面
```html ```html
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@ -60,7 +70,9 @@ Electron 备忘清单
</body> </body>
</html> </html>
``` ```
- 窗口中打开您的页面 - 窗口中打开您的页面
```js ```js
const { const {
app, app,
@ -385,8 +397,8 @@ BrowserWindow
`useContentSize` _boolean_ | _(宽)__(高)_ 设置为web页面的尺寸。默认值 _(false)_ `useContentSize` _boolean_ | _(宽)__(高)_ 设置为web页面的尺寸。默认值 _(false)_
`center` _boolean_ | 窗口是否在屏幕居中。默认值 _(false)_ `center` _boolean_ | 窗口是否在屏幕居中。默认值 _(false)_
`minHeight` _整数_ | 窗口的最小高度。默认值 _(0)_ `minHeight` _整数_ | 窗口的最小高度。默认值 _(0)_
`maxWidth ` _整数_ | 窗口的最大宽度。默认值不限 `maxWidth` _整数_ | 窗口的最大宽度。默认值不限
`maxHeight ` _整数_ | 窗口的最大高度。默认值不限 `maxHeight` _整数_ | 窗口的最大高度。默认值不限
`resizable` _boolean_ | 窗口大小是否可调整。默认值 _(true)_ `resizable` _boolean_ | 窗口大小是否可调整。默认值 _(true)_
`movable` _boolean_ _(win/mac)_ | 窗口是否可移动。默认值 _(true)_ `movable` _boolean_ _(win/mac)_ | 窗口是否可移动。默认值 _(true)_
`minimizable` _boolean_ _(win/mac)_ | 窗口是否可最小化。默认值 _(true)_ `minimizable` _boolean_ _(win/mac)_ | 窗口是否可最小化。默认值 _(true)_
@ -417,14 +429,14 @@ BrowserWindow
`transparent` _boolean_ | 使窗口 <a href="/zh/docs/latest/tutorial/window-customization#create-transparent-windows">透明</a>。 默认值 _(false)_. 在Windows上仅在无边框窗口下起作用。 `transparent` _boolean_ | 使窗口 <a href="/zh/docs/latest/tutorial/window-customization#create-transparent-windows">透明</a>。 默认值 _(false)_. 在Windows上仅在无边框窗口下起作用。
`type` _string_ | 窗口的类型, 默认为普通窗口. 更多信息见下文 `type` _string_ | 窗口的类型, 默认为普通窗口. 更多信息见下文
`visualEffectState` _string_ _(mac)_ | 在 macOS 上指定外观应如何响应窗口活动状态。 必须与 _(vibrancy)_ 属性一起使用。 可能的值有 `visualEffectState` _string_ _(mac)_ | 在 macOS 上指定外观应如何响应窗口活动状态。 必须与 _(vibrancy)_ 属性一起使用。 可能的值有
` visualEffectState.followWindow` | 当窗口处于激活状态时,后台应自动显示为激活状态,当窗口处于非激活状态时,后台应自动显示为非激活状态。 默认为该值。 `visualEffectState.followWindow` | 当窗口处于激活状态时,后台应自动显示为激活状态,当窗口处于非激活状态时,后台应自动显示为非激活状态。 默认为该值。
` visualEffectState.active` | 后台应一直显示为激活状态。 `visualEffectState.active` | 后台应一直显示为激活状态。
` visualEffectState.inactive` | 后台应一直显示为非激活状态。 `visualEffectState.inactive` | 后台应一直显示为非激活状态。
`titleBarStyle` _string_ _(win/mac)_ | 窗口标题栏样式。默认值 _(default)_ `titleBarStyle` _string_ _(win/mac)_ | 窗口标题栏样式。默认值 _(default)_
` titleBarStyle.default` | 分别返回 _mac_ 或者 _win_ 的标准标题栏 `titleBarStyle.default` | 分别返回 _mac_ 或者 _win_ 的标准标题栏
` titleBarStyle.hidden` | 在一个隐藏的标题栏和一个全尺寸大小的内容窗口中取得结果。 在 macOS 内, 窗口将一直拥有位于左上的标准窗口控制器 _(“traffic lights”)_。 在 Windows上当与 _(titleBarOverlay: true)_ 合并时,它将激活窗口控件叠加(详情请参阅 _(titleBarOverlay)_),否则将不会显示窗口控件。 `titleBarStyle.hidden` | 在一个隐藏的标题栏和一个全尺寸大小的内容窗口中取得结果。 在 macOS 内, 窗口将一直拥有位于左上的标准窗口控制器 _(“traffic lights”)_。 在 Windows上当与 _(titleBarOverlay: true)_ 合并时,它将激活窗口控件叠加(详情请参阅 _(titleBarOverlay)_),否则将不会显示窗口控件。
` titleBarStyle.hiddenInset` _(mac)_ | 隐藏标题栏,使用窗口边缘稍微小的红绿灯按钮替代。 `titleBarStyle.hiddenInset` _(mac)_ | 隐藏标题栏,使用窗口边缘稍微小的红绿灯按钮替代。
` titleBarStyle.customButtonsOnHover` _(mac)_ | 隐藏的标题栏的全尺寸的内容窗口, 红绿灯按钮在鼠标悬停在窗口左上方时显示。**注意:**此选项目前是实验性的。 `titleBarStyle.customButtonsOnHover` _(mac)_ | 隐藏的标题栏的全尺寸的内容窗口, 红绿灯按钮在鼠标悬停在窗口左上方时显示。**注意:**此选项目前是实验性的。
`trafficLightPosition` _Point_ _(mac)_ | 在无边框窗口中设置灯绿灯按钮位置。 `trafficLightPosition` _Point_ _(mac)_ | 在无边框窗口中设置灯绿灯按钮位置。
`roundedCorners` _boolean_ _(mac)_ | 无边框窗口在 macOS 上,是否应该有圆角。 默认值为 _(true)_。 属性设置为 _(false)_ ,将阻止窗口是可全屏的。 `roundedCorners` _boolean_ _(mac)_ | 无边框窗口在 macOS 上,是否应该有圆角。 默认值为 _(true)_。 属性设置为 _(false)_ ,将阻止窗口是可全屏的。
~~`fullscreenWindowTitle`~~ _boolean_ _(mac)_ ~~_已弃用_~~ | _titleBarStyle_ 设置为 _(hiddenInset)_ 时,在 macOS 全屏模式下标题栏显示标题。默认值为 _(false)_. ~~`fullscreenWindowTitle`~~ _boolean_ _(mac)_ ~~_已弃用_~~ | _titleBarStyle_ 设置为 _(hiddenInset)_ 时,在 macOS 全屏模式下标题栏显示标题。默认值为 _(false)_.
@ -433,34 +445,34 @@ BrowserWindow
`zoomToPageWidth` _boolean_ _(mac)_ | 在 macOS 上控制,当按住 option 点击工具栏绿色红绿灯按钮或点击窗口 &gt; 放大菜单项的行为。 如果为 _(true)_,窗口为将会缩放到适合宽度,若为 _(false)_ 将会放大到屏幕宽度。 这也会影响,直接调用 _(maximize())_ 的行为。 默认值为 _(false)_. `zoomToPageWidth` _boolean_ _(mac)_ | 在 macOS 上控制,当按住 option 点击工具栏绿色红绿灯按钮或点击窗口 &gt; 放大菜单项的行为。 如果为 _(true)_,窗口为将会缩放到适合宽度,若为 _(false)_ 将会放大到屏幕宽度。 这也会影响,直接调用 _(maximize())_ 的行为。 默认值为 _(false)_.
`tabbingIdentifier` _string_ _(mac)_ | 选项卡组名称允许在原生选择卡中打开窗口macOS 10.12+ 支持。 Windows 中,有相同选项卡标识的将会组合在一起。 这会添加一个原生新增选项卡按钮到你窗口的选项卡栏,同时 _(app)_ 和窗口允许接收 _(new-window-for-tab)_ 事件。 `tabbingIdentifier` _string_ _(mac)_ | 选项卡组名称允许在原生选择卡中打开窗口macOS 10.12+ 支持。 Windows 中,有相同选项卡标识的将会组合在一起。 这会添加一个原生新增选项卡按钮到你窗口的选项卡栏,同时 _(app)_ 和窗口允许接收 _(new-window-for-tab)_ 事件。
`webPreferences` _Object_ | 网页功能设置。 `webPreferences` _Object_ | 网页功能设置。
` webPreferences.devTools` _boolean_ | 是否开启 DevTools. 如果设置为 _(false)_, 则无法使用 _(BrowserWindow.webContents.openDevTools ())_ 打开 DevTools。 默认值为 _(true)_ `webPreferences.devTools` _boolean_ | 是否开启 DevTools. 如果设置为 _(false)_, 则无法使用 _(BrowserWindow.webContents.openDevTools ())_ 打开 DevTools。 默认值为 _(true)_
` webPreferences.nodeIntegration` _boolean_ | 是否启用Node integration. 默认值为 _(false)_. `webPreferences.nodeIntegration` _boolean_ | 是否启用Node integration. 默认值为 _(false)_.
` webPreferences.nodeIntegrationInWorker` _boolean_ | 是否在Web工作器中启用了Node集成. 默认值为 _(false)_. 更多内容参见 [多线程](https://www.electronjs.org/docs/latest/tutorial/multithreading) `webPreferences.nodeIntegrationInWorker` _boolean_ | 是否在Web工作器中启用了Node集成. 默认值为 _(false)_. 更多内容参见 [多线程](https://www.electronjs.org/docs/latest/tutorial/multithreading)
` webPreferences.nodeIntegrationInSubFrames` _boolean_ **_实验性_**| 是否允许在子页面(iframe)或子窗口(child window)中集成Node.js 预先加载的脚本会被注入到每一个iframe你可以用 _(process.isMainFrame)_ 来判断当前是否处于主框架main frame中。 `webPreferences.nodeIntegrationInSubFrames` _boolean_ **_实验性_**| 是否允许在子页面(iframe)或子窗口(child window)中集成Node.js 预先加载的脚本会被注入到每一个iframe你可以用 _(process.isMainFrame)_ 来判断当前是否处于主框架main frame中。
` webPreferences.preload` _string_ | 在页面运行其他脚本之前预先加载指定的脚本 无论页面是否集成Node, 此脚本都可以访问所有Node API 脚本路径为文件的绝对路径。 当 node integration 关闭时, 预加载的脚本将从全局范围重新引入node的全局引用标志[参考示例](https://www.electronjs.org/docs/latest/api/context-bridge#exposing-node-global-symbols) `webPreferences.preload` _string_ | 在页面运行其他脚本之前预先加载指定的脚本 无论页面是否集成Node, 此脚本都可以访问所有Node API 脚本路径为文件的绝对路径。 当 node integration 关闭时, 预加载的脚本将从全局范围重新引入node的全局引用标志[参考示例](https://www.electronjs.org/docs/latest/api/context-bridge#exposing-node-global-symbols)
` webPreferences.sandbox` _boolean_ | 如果设置该参数, 沙箱的渲染器将与窗口关联, 使它与Chromium OS-level 的沙箱兼容, 并禁用 Node. js 引擎。 它与 _(nodeIntegration)_ 的选项不同,且预加载脚本的 API 也有限制。[更多详情](https://www.electronjs.org/docs/latest/tutorial/sandbox) `webPreferences.sandbox` _boolean_ | 如果设置该参数, 沙箱的渲染器将与窗口关联, 使它与Chromium OS-level 的沙箱兼容, 并禁用 Node. js 引擎。 它与 _(nodeIntegration)_ 的选项不同,且预加载脚本的 API 也有限制。[更多详情](https://www.electronjs.org/docs/latest/tutorial/sandbox)
` webPreferences.session` | [Session](https://www.electronjs.org/docs/latest/api/session#class-session) 设置页面的 session 而不是直接忽略 Session 对象, 也可用 _(partition)_ 选项来代替,它接受一个 partition 字符串. 同时设置了_(session)_ 和 _(partition)_时, _(session)_ 的优先级更高. 默认使用默认的 session. `webPreferences.session` | [Session](https://www.electronjs.org/docs/latest/api/session#class-session) 设置页面的 session 而不是直接忽略 Session 对象, 也可用 _(partition)_ 选项来代替,它接受一个 partition 字符串. 同时设置了_(session)_ 和 _(partition)_时, _(session)_ 的优先级更高. 默认使用默认的 session.
` webPreferences.partition` | string (optional) - 通过 session 的 partition 字符串来设置界面session. 如果 _(partition)_ 以 _(persist:)_开头, 该页面将使用持续的 session并在所有页面生效且使用同一个_(partition)_. 如果没有 _(persist:)_ 前缀, 页面将使用 in-memory session. 通过分配相同的 _(partition)_, 多个页可以共享同一会话。 默认使用默认的 session. `webPreferences.partition` | string (optional) - 通过 session 的 partition 字符串来设置界面session. 如果 _(partition)_ 以 _(persist:)_开头, 该页面将使用持续的 session并在所有页面生效且使用同一个_(partition)_. 如果没有 _(persist:)_ 前缀, 页面将使用 in-memory session. 通过分配相同的 _(partition)_, 多个页可以共享同一会话。 默认使用默认的 session.
` webPreferences.zoomFactor` _number_ | 页面的默认缩放系数, _(3.0)_ 表示 _(300%)_。 默认值为 _(1.0)_. `webPreferences.zoomFactor` _number_ | 页面的默认缩放系数, _(3.0)_ 表示 _(300%)_。 默认值为 _(1.0)_.
` webPreferences.javascript` _boolean_ | 是否启用 JavaScript 支持。 默认值为 _(true)_ `webPreferences.javascript` _boolean_ | 是否启用 JavaScript 支持。 默认值为 _(true)_
` webPreferences.webSecurity` _boolean_ | 当设置为 _(false)_, 它将禁用同源策略 (通常用来测试网站), 如果此选项不是由开发者设置的,还会把 _(allowRunningInsecureContent)_设置为 _(true)_. 默认值为 _(true)_ `webPreferences.webSecurity` _boolean_ | 当设置为 _(false)_, 它将禁用同源策略 (通常用来测试网站), 如果此选项不是由开发者设置的,还会把 _(allowRunningInsecureContent)_设置为 _(true)_. 默认值为 _(true)_
` webPreferences.allowRunningInsecureContent` _boolean_ | 允许一个 https 页面运行来自http url的JavaScript, CSS 或 plugins。 默认值为 _(false)_ `webPreferences.allowRunningInsecureContent` _boolean_ | 允许一个 https 页面运行来自http url的JavaScript, CSS 或 plugins。 默认值为 _(false)_
` webPreferences.images` _boolean_ | 允许加载图片。 默认值为 _(true)_ `webPreferences.images` _boolean_ | 允许加载图片。 默认值为 _(true)_
` webPreferences.imageAnimationPolicy` _string_ | 指定如何运行图像动画 (比如: GIF等). 可以是 _(animate)_, _(animateOnce)__(noAnimation)_。默认值为 _(animate)_ `webPreferences.imageAnimationPolicy` _string_ | 指定如何运行图像动画 (比如: GIF等). 可以是 _(animate)_, _(animateOnce)__(noAnimation)_。默认值为 _(animate)_
` webPreferences.textAreasAreResizable` _boolean_ | 允许调整 TextArea 元素大小。 默认值为 _(true)_ `webPreferences.textAreasAreResizable` _boolean_ | 允许调整 TextArea 元素大小。 默认值为 _(true)_
` webPreferences.webgl` _boolean_ | 启用 WebGL 支持。 默认值为 _(true)_ `webPreferences.webgl` _boolean_ | 启用 WebGL 支持。 默认值为 _(true)_
` webPreferences.plugins` _boolean_ | 是否应该启用插件。 默认值为 _(false)_ `webPreferences.plugins` _boolean_ | 是否应该启用插件。 默认值为 _(false)_
` webPreferences.experimentalFeatures` _boolean_ | 启用 Chromium 的实验功能。 默认值为 _(false)_ `webPreferences.experimentalFeatures` _boolean_ | 启用 Chromium 的实验功能。 默认值为 _(false)_
` webPreferences.scrollBounce` _boolean_ _(mac)_ | 启用滚动回弹(橡皮筋)效果。 默认值为 _(false)_ `webPreferences.scrollBounce` _boolean_ _(mac)_ | 启用滚动回弹(橡皮筋)效果。 默认值为 _(false)_
` webPreferences.enableBlinkFeatures`_string_ | 以 _(逗号)_ 分隔的需要启用的特性列表,譬如 _(CSSVariables,KeyboardEventKey)_ 在 [RuntimeEnabledFeatures.json5](https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70) 文件中查看被支持的所有特性 `webPreferences.enableBlinkFeatures`_string_ | 以 _(逗号)_ 分隔的需要启用的特性列表,譬如 _(CSSVariables,KeyboardEventKey)_ 在 [RuntimeEnabledFeatures.json5](https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70) 文件中查看被支持的所有特性
` webPreferences.disableBlinkFeatures` _string_ | 以 _(,)_ 分隔的禁用特性列表, 如 _(CSSVariables,KeyboardEventKey)_ 在 [RuntimeEnabledFeatures.json5](https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70) 文件中查看被支持的所有特性 `webPreferences.disableBlinkFeatures` _string_ | 以 _(,)_ 分隔的禁用特性列表, 如 _(CSSVariables,KeyboardEventKey)_ 在 [RuntimeEnabledFeatures.json5](https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70) 文件中查看被支持的所有特性
`defaultFontFamily` _Object_ | 为 font-family 设置默认字体 `defaultFontFamily` _Object_ | 为 font-family 设置默认字体
` defaultFontFamily.standard` _string_ |默认值为 _(Times New Roman)_ `defaultFontFamily.standard` _string_ |默认值为 _(Times New Roman)_
` defaultFontFamily.serif` _string_ | 默认值为 _(Times New Roman)_ `defaultFontFamily.serif` _string_ | 默认值为 _(Times New Roman)_
` defaultFontFamily.sansSerif` _string_ | 默认值为 _(Arial)_ `defaultFontFamily.sansSerif` _string_ | 默认值为 _(Arial)_
` defaultFontFamily.monospace` _string_ | 默认值为 _(Courier New)_ `defaultFontFamily.monospace` _string_ | 默认值为 _(Courier New)_
` defaultFontFamily.cursive` _string_ | 默认值为 _(Script)_ `defaultFontFamily.cursive` _string_ | 默认值为 _(Script)_
` defaultFontFamily.fantasy` _string_ | 默认值为 _(Impact)_ `defaultFontFamily.fantasy` _string_ | 默认值为 _(Impact)_
`defaultFontSize` _Integer_ | 默认值为 _(16)_ `defaultFontSize` _Integer_ | 默认值为 _(16)_
`defaultMonospaceFontSize` _Integer_ | 默认值为 _(13)_ `defaultMonospaceFontSize` _Integer_ | 默认值为 _(13)_
`minimumFontSize` _Integer_ | 默认值为 _(0)_ `minimumFontSize` _Integer_ | 默认值为 _(0)_
@ -480,10 +492,10 @@ BrowserWindow
`spellcheck` _boolean_ | 是否启用内置拼写检查器。 默认值为 _(true)_ `spellcheck` _boolean_ | 是否启用内置拼写检查器。 默认值为 _(true)_
`enableWebSQL` _boolean_ | 是否启用 [WebSQL api](https://www.w3.org/TR/webdatabase/)。 默认值为 _(true)_ `enableWebSQL` _boolean_ | 是否启用 [WebSQL api](https://www.w3.org/TR/webdatabase/)。 默认值为 _(true)_
`v8CacheOptions` _string_ | 强制 blink 使用 v8 代码缓存策略。 可接受的值为: `v8CacheOptions` _string_ | 强制 blink 使用 v8 代码缓存策略。 可接受的值为:
` v8CacheOptions.none` | 禁用代码缓存 `v8CacheOptions.none` | 禁用代码缓存
` v8CacheOptions.code` | 基于启发式代码缓存 `v8CacheOptions.code` | 基于启发式代码缓存
` v8CacheOptions.bypassHeatCheck` | 绕过启发式代码缓存,但使用懒编译。 `v8CacheOptions.bypassHeatCheck` | 绕过启发式代码缓存,但使用懒编译。
` v8CacheOptions.bypassHeatCheckAndEagerCompile` | 与上面相同,除了编译是及时的。 默认策略是 _(code)_ `v8CacheOptions.bypassHeatCheckAndEagerCompile` | 与上面相同,除了编译是及时的。 默认策略是 _(code)_
`enablePreferredSizeMode` _boolean_ | 是否启用首选大小模式。 首选大小是包含文档布局所需的最小大小--无需滚动。 启用该属性将导致在首选大小发生变化时,在 _(WebContents)_ 上触发 _(preferred-size-changed)_ 事件。默认值为 _(false)_ `enablePreferredSizeMode` _boolean_ | 是否启用首选大小模式。 首选大小是包含文档布局所需的最小大小--无需滚动。 启用该属性将导致在首选大小发生变化时,在 _(WebContents)_ 上触发 _(preferred-size-changed)_ 事件。默认值为 _(false)_
`titleBarOverlay` _Object/Boolean_ | 当在 macOS 使用无框窗口结合 _(win.setWindowButtonVisibility(true))_ 或使用 _(titleBarStyle)_ 以便标准窗口控制 (在 macOS为 "traffic lights") 可见,此属性将启用 Window Controls Overlay [JavaScript APIs](https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis) 和 [CSS Environment Variables](https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables)。指定 _(true)_ 将导致覆盖默认系统颜色。 默认值为 _(false)_ `titleBarOverlay` _Object/Boolean_ | 当在 macOS 使用无框窗口结合 _(win.setWindowButtonVisibility(true))_ 或使用 _(titleBarStyle)_ 以便标准窗口控制 (在 macOS为 "traffic lights") 可见,此属性将启用 Window Controls Overlay [JavaScript APIs](https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis) 和 [CSS Environment Variables](https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables)。指定 _(true)_ 将导致覆盖默认系统颜色。 默认值为 _(false)_
`color` _String_ _(win)_ | 启用窗口控制时覆盖面的 CSS 颜色 默认是系统颜色 `color` _String_ _(win)_ | 启用窗口控制时覆盖面的 CSS 颜色 默认是系统颜色
@ -684,7 +696,6 @@ child.once('ready-to-show', () => {
`win.setTitleBarOverlay(options)` _(win)_ | 在已开启 Window Controls Overlay 的窗口上,此方法将更新标题栏叠加层的样式 [#](https://www.electronjs.org/zh/docs/latest/api/browser-window#winsettitlebaroverlayoptions-windows) `win.setTitleBarOverlay(options)` _(win)_ | 在已开启 Window Controls Overlay 的窗口上,此方法将更新标题栏叠加层的样式 [#](https://www.electronjs.org/zh/docs/latest/api/browser-window#winsettitlebaroverlayoptions-windows)
<!--rehype:className=style-list--> <!--rehype:className=style-list-->
### 静态方法 ### 静态方法
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->

View File

@ -522,5 +522,3 @@ With prefix argument LINE, put point on LINE."
0 0
(prefix-numeric-value line)))) (prefix-numeric-value line))))
``` ```

View File

@ -3,7 +3,6 @@ Emmet 备忘清单
[Emmet](https://emmet.io/) 是一个用于提升 [HTML](./html.md) 和 CSS 代码编写的 Web 开发人员工具包,它允许您使用著名的 CSS 选择器以光速编写大型 HTML 代码块。 [Emmet](https://emmet.io/) 是一个用于提升 [HTML](./html.md) 和 CSS 代码编写的 Web 开发人员工具包,它允许您使用著名的 CSS 选择器以光速编写大型 HTML 代码块。
Emmet 语法 Emmet 语法
--------------- ---------------
@ -16,7 +15,6 @@ Emmet 语法
- [Emmet for Coda](https://emmet.io/download/coda/) _(emmet.io)_ - [Emmet for Coda](https://emmet.io/download/coda/) _(emmet.io)_
- [Emmet for Atom](https://github.com/emmetio/emmet-atom#readme) _(github.com)_ - [Emmet for Atom](https://github.com/emmetio/emmet-atom#readme) _(github.com)_
### 乘法:* ### 乘法:*
`ul>li*5` `ul>li*5`
@ -81,7 +79,7 @@ p>{Click }+a{here}+{ 继续}
### ID 和 CLASS 属性 ### ID 和 CLASS 属性
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
#header \# header
```html ```html
<div id="header"></div> <div id="header"></div>
@ -199,7 +197,6 @@ ul>li.item$@2*3
</ul> </ul>
``` ```
### 上一层: ^ ### 上一层: ^
div+div>p>span+em^bq div+div>p>span+em^bq
@ -793,7 +790,6 @@ select
select:disabled, select:d 别名 select[disabled.] select:disabled, select:d 别名 select[disabled.]
```html ```html
<select name="" id="" disabled="disabled"></select> <select name="" id="" disabled="disabled"></select>
``` ```
@ -1162,7 +1158,7 @@ html:4s 别名 !!!4s+doc4[lang=${lang}]
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
html:xt 别名 !!!xt+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}] html:xt 别名 !!!xt+doc4[xmlns=<http://www.w3.org/1999/xhtml> xml:lang=${lang}]
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
```html ```html
@ -1179,7 +1175,7 @@ html:xt 别名 !!!xt+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
html:xs 别名 !!!xs+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}] html:xs 别名 !!!xs+doc4[xmlns=<http://www.w3.org/1999/xhtml> xml:lang=${lang}]
```html ```html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@ -1195,7 +1191,7 @@ html:xs 别名 !!!xs+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
html:xxs 别名 !!!xxs+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}] html:xxs 别名 !!!xxs+doc4[xmlns=<http://www.w3.org/1999/xhtml> xml:lang=${lang}]
```html ```html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
@ -1968,6 +1964,7 @@ CSS
font-weight: normal; font-weight: normal;
} }
``` ```
#### @i, @import #### @i, @import
```css ```css
@ -2057,7 +2054,7 @@ CSS
`bfv:h` | backface-visibility:hidden; `bfv:h` | backface-visibility:hidden;
`bfv:v` | backface-visibility:visible; `bfv:v` | backface-visibility:visible;
`bg:ie` | filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='x.png',sizingMethod='crop'); `bg:ie` | filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='x.png',sizingMethod='crop');
`cm` | /* ${child} */ `cm` | /\* ${child} */
`colm` | columns:; `colm` | columns:;
`colmc` | column-count:; `colmc` | column-count:;
`colmf` | column-fill:; `colmf` | column-fill:;
@ -2068,7 +2065,7 @@ CSS
`colmrw` | column-rule-width:; `colmrw` | column-rule-width:;
`colms` | column-span:; `colms` | column-span:;
`colmw` | column-width:; `colmw` | column-width:;
`d:ib+` | display: inline-block;<br /> *display: inline;<br /> *zoom: 1; `d:ib+` | display: inline-block;<br /> *display: inline;<br />*zoom: 1;
`jc` | justify-content:; `jc` | justify-content:;
`jc:c` | justify-content:center; `jc:c` | justify-content:center;
`jc:fe` | justify-content:flex-end; `jc:fe` | justify-content:flex-end;
@ -2384,7 +2381,7 @@ choose+ A别名 xsl:choose>xsl:when+xsl:otherwise
</xsl:choose> </xsl:choose>
``` ```
xsl 别名 !!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{ | } xsl 别名 !!!+xsl:stylesheet[version=1.0 xmlns:xsl=<http://www.w3.org/1999/XSL/Transform>]>{ | }
```xml ```xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
@ -2401,4 +2398,4 @@ xsl 别名 !!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/T
另见 另见
-------- --------
* [Emmet Cheat sheet](https://docs.emmet.io/cheat-sheet/) _(docs.emmet.io)_ - [Emmet Cheat sheet](https://docs.emmet.io/cheat-sheet/) _(docs.emmet.io)_

View File

@ -149,7 +149,6 @@ class Circle extends Shape {
原型的语法糖。 原型的语法糖。
请参阅: [](https://babeljs.io/learn-es2015/#classes) 请参阅: [](https://babeljs.io/learn-es2015/#classes)
Promises Promises
-------- --------
@ -237,7 +236,9 @@ let {title, author} = {
const scores = [22, 33] const scores = [22, 33]
const [math = 50, sci = 50, arts = 50] = scores const [math = 50, sci = 50, arts = 50] = scores
``` ```
---- ----
```js ```js
// Result: // Result:
// math === 22, sci === 33, arts === 50 // math === 22, sci === 33, arts === 50
@ -252,7 +253,9 @@ function greet({ name, greeting }) {
console.log(`${greeting}, ${name}!`) console.log(`${greeting}, ${name}!`)
} }
``` ```
---- ----
```js ```js
greet({ name: 'Larry', greeting: 'Ahoy' }) greet({ name: 'Larry', greeting: 'Ahoy' })
``` ```
@ -266,7 +269,9 @@ function greet({ name = 'Rauno' } = {}) {
console.log(`Hi ${name}!`); console.log(`Hi ${name}!`);
} }
``` ```
---- ----
```js ```js
greet() // Hi Rauno! greet() // Hi Rauno!
greet({ name: 'Larry' }) // Hi Larry! greet({ name: 'Larry' }) // Hi Larry!
@ -279,7 +284,9 @@ function printCoordinates({ left: x, top: y }) {
console.log(`x: ${x}, y: ${y}`) console.log(`x: ${x}, y: ${y}`)
} }
``` ```
---- ----
```js ```js
printCoordinates({ left: 25, top: 90 }) printCoordinates({ left: 25, top: 90 })
``` ```
@ -456,7 +463,9 @@ Objects
```js ```js
module.exports = { hello, bye } module.exports = { hello, bye }
``` ```
同下: 同下:
```js ```js
module.exports = { module.exports = {
hello: hello, bye: bye hello: hello, bye: bye
@ -524,22 +533,30 @@ Modules 模块
import 'helpers' import 'helpers'
// 又名: require('···') // 又名: require('···')
``` ```
---
----
```js ```js
import Express from 'express' import Express from 'express'
// 又名: const Express = require('···').default || require('···') // 又名: const Express = require('···').default || require('···')
``` ```
---
----
```js ```js
import { indent } from 'helpers' import { indent } from 'helpers'
// 又名: const indent = require('···').indent // 又名: const indent = require('···').indent
``` ```
---
----
```js ```js
import * as Helpers from 'helpers' import * as Helpers from 'helpers'
// 又名: const Helpers = require('···') // 又名: const Helpers = require('···')
``` ```
---
----
```js ```js
import { indentSpaces as indent } from 'helpers' import { indentSpaces as indent } from 'helpers'
// 又名: const indent = require('···').indentSpaces // 又名: const indent = require('···').indentSpaces
@ -554,12 +571,16 @@ import { indentSpaces as indent } from 'helpers'
export default function () { ··· } export default function () { ··· }
// 又名: module.exports.default = ··· // 又名: module.exports.default = ···
``` ```
---- ----
```js ```js
export function mymethod () { ··· } export function mymethod () { ··· }
// 又名: module.exports.mymethod = ··· // 又名: module.exports.mymethod = ···
``` ```
---- ----
```js ```js
export const pi = 3.14159 export const pi = 3.14159
// 又名: module.exports.pi = ··· // 又名: module.exports.pi = ···
@ -643,7 +664,6 @@ new URL('data.txt', import.meta.url)
Node.js 环境中,`import.meta.url`返回的总是本地路径,即 `file:URL` 协议的字符串,比如 `file:///home/user/foo.js` Node.js 环境中,`import.meta.url`返回的总是本地路径,即 `file:URL` 协议的字符串,比如 `file:///home/user/foo.js`
Generators Generators
---------- ----------
@ -655,7 +675,9 @@ function* idMaker () {
while (true) { yield id++ } while (true) { yield id++ }
} }
``` ```
---
----
```js ```js
let gen = idMaker() let gen = idMaker()
gen.next().value // → 0 gen.next().value // → 0
@ -707,7 +729,6 @@ gen[Symbol.iterator] = function* () {
`Generator` 函数赋值给 `Symbol.iterator` 属性,从而使得 `gen` 对象具有了 `Iterator` 接口,可以被 `...` 运算符遍历了 `Generator` 函数赋值给 `Symbol.iterator` 属性,从而使得 `gen` 对象具有了 `Iterator` 接口,可以被 `...` 运算符遍历了
### Symbol.iterator 属性 ### Symbol.iterator 属性
```js ```js

View File

@ -10,16 +10,21 @@ Express 备忘清单
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
- 创建项目,添加 `package.json` 配置 - 创建项目,添加 `package.json` 配置
```bash ```bash
$ mkdir myapp # 创建目录 $ mkdir myapp # 创建目录
$ cd myapp # 进入目录 $ cd myapp # 进入目录
$ npm init -y # 初始化一个配置 $ npm init -y # 初始化一个配置
``` ```
- 安装依赖 - 安装依赖
```bash ```bash
$ npm install express # 安装依赖 $ npm install express # 安装依赖
``` ```
- 入口文件 `index.js` 添加代码: - 入口文件 `index.js` 添加代码:
```js ```js
const express = require('express') const express = require('express')
const app = express() const app = express()
@ -31,7 +36,9 @@ Express 备忘清单
console.log(`监听端口${port}示例应用`) console.log(`监听端口${port}示例应用`)
}) })
``` ```
- 使用以下命令运行应用程序 - 使用以下命令运行应用程序
```bash ```bash
$ node index.js $ node index.js
``` ```
@ -189,7 +196,7 @@ app.get('/', function (req, res) {
:- | :- :- | :-
:- | :- :- | :-
`res.app ` | [#](http://expressjs.com/en/4x/api.html#res.app) `res.app` | [#](http://expressjs.com/en/4x/api.html#res.app)
`res.headersSent` | [#](http://expressjs.com/en/4x/api.html#res.headersSent) `res.headersSent` | [#](http://expressjs.com/en/4x/api.html#res.headersSent)
`res.locals` | [#](http://expressjs.com/en/4x/api.html#res.locals) `res.locals` | [#](http://expressjs.com/en/4x/api.html#res.locals)

View File

@ -103,7 +103,6 @@ $ ffmpeg -i movie.webm movie.mp4
`Mi` | 220 | 1048576 | 兆字节 Mebibyte `Mi` | 220 | 1048576 | 兆字节 Mebibyte
`Gi` | 230 | 1073741824 | Gibibyte `Gi` | 230 | 1073741824 | Gibibyte
### 音频参数 ### 音频参数
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
@ -317,7 +316,6 @@ $ ffmpeg -i input.mov -itsoffset 3 -i input.mov -map 1:v -map 0:a -codec:a copy
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
### 图片中的视频 ### 图片中的视频
如果您有多个编号的图像 image1.jpg、image2.jpg... 像这样从它们创建一个视频 如果您有多个编号的图像 image1.jpg、image2.jpg... 像这样从它们创建一个视频
@ -366,14 +364,12 @@ $ ffmpeg -y -threads 8 -i inFile -target pal-dvd -ac 2 -aspect 16:9 -acodec mp2
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
### 转换为灰度 ### 转换为灰度
```bash ```bash
$ ffmpeg -y -i inFile -flags gray outFile $ ffmpeg -y -i inFile -flags gray outFile
``` ```
### 字幕 ### 字幕
<!--rehype:wrap-class=col-span-2 row-span-2--> <!--rehype:wrap-class=col-span-2 row-span-2-->

View File

@ -39,7 +39,6 @@ $ find . -name "json_*"
| `-mindepth` | find / -mindepth 3 -maxdepth 5 -name pass | 在子目录级别 2 和 4 之间 | | `-mindepth` | find / -mindepth 3 -maxdepth 5 -name pass | 在子目录级别 2 和 4 之间 |
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 类型 ### 类型
| | | | | |
@ -224,7 +223,6 @@ $ find . -type d -empty
$ find . -type f -empty -delete $ find . -type f -empty -delete
``` ```
查找日期和时间 查找日期和时间
------------- -------------

View File

@ -374,15 +374,20 @@ Git 技巧
### 重命名分支 ### 重命名分支
- **重命名**为`new` - **重命名**为`new`
```shell ```shell
$ git branch -m <new> $ git branch -m <new>
$ git branch -m <old> <new> #重命名分支 $ git branch -m <old> <new> #重命名分支
``` ```
- **推送**并重置 - **推送**并重置
```shell ```shell
$ git push origin -u <new> $ git push origin -u <new>
``` ```
- **删除**远程分支 - **删除**远程分支
```shell ```shell
$ git push origin --delete <old> #方法1 $ git push origin --delete <old> #方法1
$ git push origin :oldBranchName #方法2 $ git push origin :oldBranchName #方法2
@ -827,7 +832,6 @@ $ git config --global --unset http.https://github.com.proxy
$ git config --global --unset https.https://github.com.proxy $ git config --global --unset https.https://github.com.proxy
``` ```
### clone 最新一次提交 ### clone 最新一次提交
```bash ```bash

View File

@ -212,6 +212,7 @@ jobs:
```shell ```shell
jobs.<job_id>.environment jobs.<job_id>.environment
``` ```
使用单一环境名称的示例 使用单一环境名称的示例
```yml ```yml
@ -251,7 +252,6 @@ steps:
设置环境变量的示例 设置环境变量的示例
```yml ```yml
env: env:
MY_ENV_VAR: ${{ <expression> }} MY_ENV_VAR: ${{ <expression> }}

View File

@ -86,7 +86,6 @@ Gmail 快捷键
`g` 然后 `k` | 前往任务 `g` 然后 `k` | 前往任务
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### Gmail 主题列表选择 ### Gmail 主题列表选择
:- | :- :- | :-

View File

@ -247,7 +247,6 @@ s := strconv.Itoa(i)
fmt.Println(s) // Outputs: 90 fmt.Println(s) // Outputs: 90
``` ```
Golang 字符串 Golang 字符串
-------- --------
@ -256,18 +255,18 @@ Golang 字符串
```go ```go
package main package main
import ( import (
"fmt" "fmt"
s "strings" s "strings"
) )
func main() { func main() {
/* 需要将字符串导入为 s */ /* 需要将字符串导入为 s */
fmt.Println(s.Contains("test", "e")) fmt.Println(s.Contains("test", "e"))
/* 内置 */ /* 内置 */
fmt.Println(len("hello")) // => 5 fmt.Println(len("hello")) // => 5
// 输出: 101 // 输出: 101
fmt.Println("hello"[1]) fmt.Println("hello"[1])
// 输出: e // 输出: e
fmt.Println(string("hello"[1])) fmt.Println(string("hello"[1]))
} }
``` ```
@ -277,38 +276,38 @@ func main() {
```go ```go
package main package main
import ( import (
"fmt" "fmt"
"os" "os"
) )
type point struct { type point struct {
x, y int x, y int
} }
func main() { func main() {
p := point{1, 2} p := point{1, 2}
fmt.Printf("%v\n", p) // => {1 2} fmt.Printf("%v\n", p) // => {1 2}
fmt.Printf("%+v\n", p) // => {x:1 y:2} fmt.Printf("%+v\n", p) // => {x:1 y:2}
fmt.Printf("%#v\n", p) // => main.point{x:1, y:2} fmt.Printf("%#v\n", p) // => main.point{x:1, y:2}
fmt.Printf("%T\n", p) // => main.point fmt.Printf("%T\n", p) // => main.point
fmt.Printf("%t\n", true) // => TRUE fmt.Printf("%t\n", true) // => TRUE
fmt.Printf("%d\n", 123) // => 123 fmt.Printf("%d\n", 123) // => 123
fmt.Printf("%b\n", 14) // => 1110 fmt.Printf("%b\n", 14) // => 1110
fmt.Printf("%c\n", 33) // => ! fmt.Printf("%c\n", 33) // => !
fmt.Printf("%x\n", 456) // => 1c8 fmt.Printf("%x\n", 456) // => 1c8
fmt.Printf("%f\n", 78.9) // => 78.9 fmt.Printf("%f\n", 78.9) // => 78.9
fmt.Printf("%e\n", 123400000.0) // => 1.23E+08 fmt.Printf("%e\n", 123400000.0) // => 1.23E+08
fmt.Printf("%E\n", 123400000.0) // => 1.23E+08 fmt.Printf("%E\n", 123400000.0) // => 1.23E+08
fmt.Printf("%s\n", "\"string\"") // => "string" fmt.Printf("%s\n", "\"string\"") // => "string"
fmt.Printf("%q\n", "\"string\"") // => "\"string\"" fmt.Printf("%q\n", "\"string\"") // => "\"string\""
fmt.Printf("%x\n", "hex this") // => 6.86578E+15 fmt.Printf("%x\n", "hex this") // => 6.86578E+15
fmt.Printf("%p\n", &p) // => 0xc00002c040 fmt.Printf("%p\n", &p) // => 0xc00002c040
fmt.Printf("|%6d|%6d|\n", 12, 345) // => | 12| 345| fmt.Printf("|%6d|%6d|\n", 12, 345) // => | 12| 345|
fmt.Printf("|%6.2f|%6.2f|\n", 1.2, 3.45) // => | 1.20| 3.45| fmt.Printf("|%6.2f|%6.2f|\n", 1.2, 3.45) // => | 1.20| 3.45|
fmt.Printf("|%-6.2f|%-6.2f|\n", 1.2, 3.45) // => |1.20 |3.45 | fmt.Printf("|%-6.2f|%-6.2f|\n", 1.2, 3.45) // => |1.20 |3.45 |
fmt.Printf("|%6s|%6s|\n", "foo", "b") // => | foo| b| fmt.Printf("|%6s|%6s|\n", "foo", "b") // => | foo| b|
fmt.Printf("|%-6s|%-6s|\n", "foo", "b") // => |foo |b | fmt.Printf("|%-6s|%-6s|\n", "foo", "b") // => |foo |b |
s := fmt.Sprintf("a %s", "string") s := fmt.Sprintf("a %s", "string")
fmt.Println(s) fmt.Println(s)
fmt.Fprintf(os.Stderr, "an %s\n", "error") fmt.Fprintf(os.Stderr, "an %s\n", "error")
} }
``` ```
@ -316,8 +315,8 @@ func main() {
### 函数实例 ### 函数实例
| 实例 | Result | | 实例 | Result |
|-------------------------------|-------------| | ----------------------------- | ----------- |
| Contains("test", "es") | true | | Contains("test", "es") | true |
| Count("test", "t") | 2 | | Count("test", "t") | 2 |
| HasPrefix("test", "te") | true | | HasPrefix("test", "te") | true |
@ -441,16 +440,16 @@ Golang 结构和映射
```go ```go
package main package main
import ( import (
"fmt" "fmt"
) )
type Vertex struct { type Vertex struct {
X int X int
Y int Y int
} }
func main() { func main() {
v := Vertex{1, 2} v := Vertex{1, 2}
v.X = 4 v.X = 4
fmt.Println(v.X, v.Y) // => 4 2 fmt.Println(v.X, v.Y) // => 4 2
} }
``` ```
@ -569,6 +568,7 @@ sum(nums...) // => [1 2 3 4] 10
```go ```go
import --> const --> var --> init() import --> const --> var --> init()
``` ```
--- ---
```go ```go
@ -701,22 +701,22 @@ Golang 并发
```go ```go
package main package main
import ( import (
"fmt" "fmt"
"time" "time"
) )
func f(from string) { func f(from string) {
for i := 0; i < 3; i++ { for i := 0; i < 3; i++ {
fmt.Println(from, ":", i) fmt.Println(from, ":", i)
} }
} }
func main() { func main() {
f("direct") f("direct")
go f("goroutine") go f("goroutine")
go func(msg string) { go func(msg string) {
fmt.Println(msg) fmt.Println(msg)
}("going") }("going")
time.Sleep(time.Second) time.Sleep(time.Second)
fmt.Println("done") fmt.Println("done")
} }
``` ```
@ -728,23 +728,23 @@ func main() {
```go ```go
package main package main
import ( import (
"fmt" "fmt"
"sync" "sync"
"time" "time"
) )
func w(id int, wg *sync.WaitGroup) { func w(id int, wg *sync.WaitGroup) {
defer wg.Done() defer wg.Done()
fmt.Printf("%d starting\n", id) fmt.Printf("%d starting\n", id)
time.Sleep(time.Second) time.Sleep(time.Second)
fmt.Printf("%d done\n", id) fmt.Printf("%d done\n", id)
} }
func main() { func main() {
var wg sync.WaitGroup var wg sync.WaitGroup
for i := 1; i <= 5; i++ { for i := 1; i <= 5; i++ {
wg.Add(1) wg.Add(1)
go w(i, &wg) go w(i, &wg)
} }
wg.Wait() wg.Wait()
} }
``` ```
@ -916,6 +916,7 @@ func main() {
------------- -------------
### 关键字(Keywords) ### 关键字(Keywords)
- break - break
- default - default
- func - func
@ -945,8 +946,8 @@ func main() {
### 运算符和标点符号 ### 运算符和标点符号
| | | | | | | | | | | | | | | | | | | |
|---|----|-----|-----|------|----|-----|---|---| | --- | ---- | ----- | ----- | ------ | ---- | ----- | --- | --- |
| `+` | `&` | `+=` | `&=` | `&&` | `==` | `!=` | `(` | `)` | | `+` | `&` | `+=` | `&=` | `&&` | `==` | `!=` | `(` | `)` |
| `-` | `\|` | `-=` | `\|=` | `\|\|` | `<` | `<=` | `[` | `]` | | `-` | `\|` | `-=` | `\|=` | `\|\|` | `<` | `<=` | `[` | `]` |
| `*` | `^` | `*=` | `^=` | `<-` | `>` | `>=` | `{` | `}` | | `*` | `^` | `*=` | `^=` | `<-` | `>` | `>=` | `{` | `}` |
@ -956,6 +957,7 @@ func main() {
另见 另见
-------- --------
- [Devhints](https://devhints.io/go) _(devhints.io)_ - [Devhints](https://devhints.io/go) _(devhints.io)_
- [A tour of Go](https://tour.golang.org/welcome/1) _(tour.golang.org)_ - [A tour of Go](https://tour.golang.org/welcome/1) _(tour.golang.org)_
- [Golang wiki](https://github.com/golang/go/wiki/) _(github.com)_ - [Golang wiki](https://github.com/golang/go/wiki/) _(github.com)_

View File

@ -3,7 +3,6 @@ Grep 备忘清单
本备忘单旨在快速提醒使用命令行程序 grep 所涉及的主要概念,并假设您已经了解其用法。 本备忘单旨在快速提醒使用命令行程序 grep 所涉及的主要概念,并假设您已经了解其用法。
入门 入门
------ ------
<!--rehype:body-class=cols-5--> <!--rehype:body-class=cols-5-->
@ -31,7 +30,6 @@ $ grep 'mellon' myfile.txt
文件名中接受通配符。 文件名中接受通配符。
### 选项示例 ### 选项示例
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->
@ -51,7 +49,6 @@ $ grep 'mellon' myfile.txt
| `-o` | grep -o search_string filename | 只显示字符串的匹配部分 | `-o` | grep -o search_string filename | 只显示字符串的匹配部分
| `-n` | grep -n "go" demo.txt | 显示匹配的行号 | `-n` | grep -n "go" demo.txt | 显示匹配的行号
Grep 正则表达式 Grep 正则表达式
------- -------
@ -97,13 +94,12 @@ Grep 正则表达式
`[0-9]` | 任何数字 `[0-9]` | 任何数字
`[0-9­A-Z­a-z]` | 任何大小写字母或数字 `[0-9­A-Z­a-z]` | 任何大小写字母或数字
### 位置 ### 位置
:- | :- :- | :-
:- | :- :- | :-
`^ ` | 行的开头 `^` | 行的开头
`$ ` | 行结束 `$` | 行结束
`^$` | 空行 `^$` | 空行
`\<` | 词的开头 `\<` | 词的开头
`\>` | 词尾 `\>` | 词尾

View File

@ -3,7 +3,6 @@ HTML 字符实体备忘清单
此备忘清单是 HTML 实体及其编号和名称的完整列表。还包括可以用 HTML 表示的 ASCII 字符的完整列表。 此备忘清单是 HTML 实体及其编号和名称的完整列表。还包括可以用 HTML 表示的 ASCII 字符的完整列表。
HTML 字符实体引用 HTML 字符实体引用
------ ------
<!--rehype:body-class=cols-1--> <!--rehype:body-class=cols-1-->

View File

@ -43,6 +43,7 @@ HTML 备忘清单
<p>我来自快速参考</p> <p>我来自快速参考</p>
<p>分享快速参考备忘单。</p> <p>分享快速参考备忘单。</p>
``` ```
请参阅:[段落元素](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/p) 请参阅:[段落元素](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/p)
### HTML 链接 ### HTML 链接
@ -68,8 +69,6 @@ HTML 备忘清单
请参阅:[\<a> 属性](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/a#attributes) 请参阅:[\<a> 属性](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/a#attributes)
### Image 标签 ### Image 标签
```html ```html
@ -163,10 +162,8 @@ HTML 备忘清单
src="https://www.openstreetmap.org/export/embed.html?bbox=-0.004017949104309083%2C51.47612752641776%2C0.00030577182769775396%2C51.478569861898606&layer=mapnik"> src="https://www.openstreetmap.org/export/embed.html?bbox=-0.004017949104309083%2C51.47612752641776%2C0.00030577182769775396%2C51.478569861898606&layer=mapnik">
</iframe> </iframe>
请参阅:[内联框架元素](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/iframe) 请参阅:[内联框架元素](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/iframe)
### HTML 中的 JavaScript ### HTML 中的 JavaScript
```html ```html
@ -176,7 +173,6 @@ HTML 备忘清单
</script> </script>
``` ```
#### 外部 JavaScript #### 外部 JavaScript
```html ```html
@ -186,7 +182,6 @@ HTML 备忘清单
</body> </body>
``` ```
### HTML 中的 CSS ### HTML 中的 CSS
```html ```html
@ -206,8 +201,6 @@ HTML 备忘清单
</head> </head>
``` ```
HTML5 标签 HTML5 标签
------------- -------------
@ -227,7 +220,6 @@ HTML5 标签
</body> </body>
``` ```
### 标题导航 ### 标题导航
```html ```html
@ -242,7 +234,6 @@ HTML5 标签
</header> </header>
``` ```
### HTML5 Tags ### HTML5 Tags
<!--rehype:wrap-class=row-span-4--> <!--rehype:wrap-class=row-span-4-->
@ -281,7 +272,6 @@ HTML5 标签
[video](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/video) | 嵌入视频 [video](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/video) | 嵌入视频
[wbr](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/wbr) | 换行机会 [wbr](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/wbr) | 换行机会
### HTML5 Video ### HTML5 Video
```html ```html
@ -339,7 +329,6 @@ HTML5 标签
<rp>(</rp><rt>yīn</rt><rp>)</rp> <rp>(</rp><rt>yīn</rt><rp>)</rp>
</ruby> </ruby>
### HTML5 kdi ### HTML5 kdi
```html ```html
@ -358,7 +347,6 @@ HTML5 标签
<li>User <bdi>إيان</bdi>: 90 points</li> <li>User <bdi>إيان</bdi>: 90 points</li>
</ul> </ul>
### HTML5 progress ### HTML5 progress
```html ```html
@ -375,7 +363,6 @@ HTML5 标签
<p>我爱<mark>备忘清单</mark></p> <p>我爱<mark>备忘清单</mark></p>
HTML 表格 HTML 表格
-------------- --------------
@ -517,7 +504,6 @@ HTML 表单
<label for="ck">记住我</label> <label for="ck">记住我</label>
</form> </form>
HTML `<form>` 元素用于收集信息并将其发送到外部源。 HTML `<form>` 元素用于收集信息并将其发送到外部源。
### Form 属性 ### Form 属性
@ -602,13 +588,16 @@ Textarea 是一个多行文本输入控件
单选按钮用于让用户只选择一个 单选按钮用于让用户只选择一个
### Checkboxes ### Checkboxes
```html ```html
<input type="checkbox" name="s" id="soc"> <input type="checkbox" name="s" id="soc">
<label for="soc">Soccer</label> <label for="soc">Soccer</label>
<input type="checkbox" name="s" id="bas"> <input type="checkbox" name="s" id="bas">
<label for="bas">Baseball</label> <label for="bas">Baseball</label>
``` ```
#### ↓ 预览 #### ↓ 预览
<form style="padding: 20px;"> <form style="padding: 20px;">
<input type="checkbox" name="sports" id="soccer"> <input type="checkbox" name="sports" id="soccer">
<label for="soccer">Soccer</label> <label for="soccer">Soccer</label>
@ -718,7 +707,6 @@ Textarea 是一个多行文本输入控件
`将数据提交到服务器` 重置为默认值 `将数据提交到服务器` 重置为默认值
HTML input 标签 HTML input 标签
----------- -----------
<!--rehype:body-class=cols-2--> <!--rehype:body-class=cols-2-->
@ -729,10 +717,10 @@ HTML input 标签
输入标记是一个空元素,用于标识要从用户处获取的特定类型的字段信息。 输入标记是一个空元素,用于标识要从用户处获取的特定类型的字段信息。
```html ```html
<input type="text" name="?" value="?" minlength="6" required /> <input type="text" name="?" value="?" minlength="6" required />
``` ```
---- ---
:-|:- :-|:-
:-|:- :-|:-
@ -794,7 +782,6 @@ HTML input 标签
| `type="search"` | <input type="search"> | | `type="search"` | <input type="search"> |
| `type="range"` | <input type="range"> | | `type="range"` | <input type="range"> |
### Input CSS 选择器 ### Input CSS 选择器
| | | | | |
@ -820,6 +807,7 @@ meta 标记描述 HTML 文档中的元数据。它解释了关于 HTML 的其他
<meta property="og:title" content="···"> <meta property="og:title" content="···">
<meta name="twitter:title" content="···"> <meta name="twitter:title" content="···">
``` ```
--- ---
```html ```html
@ -828,6 +816,7 @@ meta 标记描述 HTML 文档中的元数据。它解释了关于 HTML 的其他
<meta property="og:url" content="https://···"> <meta property="og:url" content="https://···">
<meta name="twitter:url" content="https://···"> <meta name="twitter:url" content="https://···">
``` ```
--- ---
```html ```html
@ -836,6 +825,7 @@ meta 标记描述 HTML 文档中的元数据。它解释了关于 HTML 的其他
<meta property="og:description" content="···"> <meta property="og:description" content="···">
<meta name="twitter:description" content="···"> <meta name="twitter:description" content="···">
``` ```
--- ---
```html ```html
@ -843,12 +833,14 @@ meta 标记描述 HTML 文档中的元数据。它解释了关于 HTML 的其他
<meta property="og:image" content="https://···"> <meta property="og:image" content="https://···">
<meta name="twitter:image" content="https://···"> <meta name="twitter:image" content="https://···">
``` ```
--- ---
```html ```html
<!-- ua --> <!-- ua -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
``` ```
--- ---
```html ```html

View File

@ -17,63 +17,63 @@ HTTP 状态码
### 2xx. 成功的 ### 2xx. 成功的
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
* [200: OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) _请求没问题_<!--rehype:tooltips--> - [200: OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) _请求没问题_<!--rehype:tooltips-->
* [201: Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) _请求完成并创建了一个新资源_<!--rehype:tooltips--> - [201: Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) _请求完成并创建了一个新资源_<!--rehype:tooltips-->
* [202: Accepted](https://tools.ietf.org/html/rfc7231#section-6.3.3) _接受请求进行处理但处理未完成_<!--rehype:tooltips--> - [202: Accepted](https://tools.ietf.org/html/rfc7231#section-6.3.3) _接受请求进行处理但处理未完成_<!--rehype:tooltips-->
* [203: Non-Authoritative Information](https://tools.ietf.org/html/rfc7231#section-6.3.4) _实体标头中的信息来自本地或第三方副本而不是来自原始服务器_<!--rehype:tooltips--> - [203: Non-Authoritative Information](https://tools.ietf.org/html/rfc7231#section-6.3.4) _实体标头中的信息来自本地或第三方副本而不是来自原始服务器_<!--rehype:tooltips-->
* [204: No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) _响应中给出了状态码和标头但响应中没有实体主体_<!--rehype:tooltips--> - [204: No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) _响应中给出了状态码和标头但响应中没有实体主体_<!--rehype:tooltips-->
* [205: Reset Content](https://tools.ietf.org/html/rfc7231#section-6.3.6) _浏览器应清除用于此事务的表单以获取其他输入_<!--rehype:tooltips--> - [205: Reset Content](https://tools.ietf.org/html/rfc7231#section-6.3.6) _浏览器应清除用于此事务的表单以获取其他输入_<!--rehype:tooltips-->
* [206: Partial Content](https://tools.ietf.org/html/rfc7233#section-4.1) _服务器正在返回请求大小的部分数据。 用于响应指定 Range 标头的请求。 服务器必须使用 Content-Range 标头指定响应中包含的范围_<!--rehype:tooltips--> - [206: Partial Content](https://tools.ietf.org/html/rfc7233#section-4.1) _服务器正在返回请求大小的部分数据。 用于响应指定 Range 标头的请求。 服务器必须使用 Content-Range 标头指定响应中包含的范围_<!--rehype:tooltips-->
### 4xx. 客户端错误 ### 4xx. 客户端错误
<!--rehype:wrap-class=row-span-3--> <!--rehype:wrap-class=row-span-3-->
* [400: Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) _服务器不理解该请求_<!--rehype:tooltips--> - [400: Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) _服务器不理解该请求_<!--rehype:tooltips-->
* [401: Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1) _请求的页面需要用户名和密码_<!--rehype:tooltips--> - [401: Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1) _请求的页面需要用户名和密码_<!--rehype:tooltips-->
* [402: Payment Required](https://tools.ietf.org/html/rfc7231#section-6.5.2) _您还不能使用此代码_<!--rehype:tooltips--> - [402: Payment Required](https://tools.ietf.org/html/rfc7231#section-6.5.2) _您还不能使用此代码_<!--rehype:tooltips-->
* [403: Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) _禁止访问请求的页面_<!--rehype:tooltips--> - [403: Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) _禁止访问请求的页面_<!--rehype:tooltips-->
* [404: Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) _服务器找不到请求的页面_<!--rehype:tooltips--> - [404: Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) _服务器找不到请求的页面_<!--rehype:tooltips-->
* [405: Method Not Allowed](https://tools.ietf.org/html/rfc7231#section-6.5.5) _请求中指定的方法是不允许的_<!--rehype:tooltips--> - [405: Method Not Allowed](https://tools.ietf.org/html/rfc7231#section-6.5.5) _请求中指定的方法是不允许的_<!--rehype:tooltips-->
* [406: Not Acceptable](https://tools.ietf.org/html/rfc7231#section-6.5.6) _服务器只能生成客户端不接受的响应_<!--rehype:tooltips--> - [406: Not Acceptable](https://tools.ietf.org/html/rfc7231#section-6.5.6) _服务器只能生成客户端不接受的响应_<!--rehype:tooltips-->
* [407: Proxy Authentication Required](https://tools.ietf.org/html/rfc7235#section-3.2) _您必须先通过代理服务器进行身份验证然后才能提供此请求_<!--rehype:tooltips--> - [407: Proxy Authentication Required](https://tools.ietf.org/html/rfc7235#section-3.2) _您必须先通过代理服务器进行身份验证然后才能提供此请求_<!--rehype:tooltips-->
* [408: Request Timeout](https://tools.ietf.org/html/rfc7231#section-6.5.7) _请求花费的时间比服务器准备等待的时间长_<!--rehype:tooltips--> - [408: Request Timeout](https://tools.ietf.org/html/rfc7231#section-6.5.7) _请求花费的时间比服务器准备等待的时间长_<!--rehype:tooltips-->
* [409: Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8) _由于冲突请求无法完成_<!--rehype:tooltips--> - [409: Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8) _由于冲突请求无法完成_<!--rehype:tooltips-->
* [410: Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9) _请求的页面不再可用_<!--rehype:tooltips--> - [410: Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9) _请求的页面不再可用_<!--rehype:tooltips-->
* [411: Length Required](https://tools.ietf.org/html/rfc7231#section-6.5.10) _“Content-Length”未定义。 没有它服务器将不会接受请求_<!--rehype:tooltips--> - [411: Length Required](https://tools.ietf.org/html/rfc7231#section-6.5.10) _“Content-Length”未定义。 没有它服务器将不会接受请求_<!--rehype:tooltips-->
* [412: Precondition Failed](https://tools.ietf.org/html/rfc7232#section-4.2) _请求中给出的前提条件被服务器评估为 false_<!--rehype:tooltips--> - [412: Precondition Failed](https://tools.ietf.org/html/rfc7232#section-4.2) _请求中给出的前提条件被服务器评估为 false_<!--rehype:tooltips-->
* [413: Payload Too Large](https://tools.ietf.org/html/rfc7231#section-6.5.11) _服务器不会接受请求因为请求实体太大_<!--rehype:tooltips--> - [413: Payload Too Large](https://tools.ietf.org/html/rfc7231#section-6.5.11) _服务器不会接受请求因为请求实体太大_<!--rehype:tooltips-->
* [414: URI Too Long](https://tools.ietf.org/html/rfc7231#section-6.5.12) _服务器不会接受请求因为 url 太长。 当您将“发布”请求转换为具有长查询信息的“获取”请求时发生_<!--rehype:tooltips--> - [414: URI Too Long](https://tools.ietf.org/html/rfc7231#section-6.5.12) _服务器不会接受请求因为 url 太长。 当您将“发布”请求转换为具有长查询信息的“获取”请求时发生_<!--rehype:tooltips-->
* [415: Unsupported Media Type](https://tools.ietf.org/html/rfc7231#section-6.5.13) _服务器不会接受请求因为不支持媒体类型_<!--rehype:tooltips--> - [415: Unsupported Media Type](https://tools.ietf.org/html/rfc7231#section-6.5.13) _服务器不会接受请求因为不支持媒体类型_<!--rehype:tooltips-->
* [416: Range Not Satisfiable](https://tools.ietf.org/html/rfc7233#section-4.4) _请求的字节范围不可用且超出范围_<!--rehype:tooltips--> - [416: Range Not Satisfiable](https://tools.ietf.org/html/rfc7233#section-4.4) _请求的字节范围不可用且超出范围_<!--rehype:tooltips-->
* [417: Expectation Failed](https://tools.ietf.org/html/rfc7231#section-6.5.14) _此服务器无法满足在 Expect 请求标头字段中给出的期望_<!--rehype:tooltips--> - [417: Expectation Failed](https://tools.ietf.org/html/rfc7231#section-6.5.14) _此服务器无法满足在 Expect 请求标头字段中给出的期望_<!--rehype:tooltips-->
* [426: Upgrade Required](https://tools.ietf.org/html/rfc7231#section-6.5.15) _服务器拒绝使用当前协议执行请求但在客户端升级到不同协议后可能愿意这样做_<!--rehype:tooltips--> - [426: Upgrade Required](https://tools.ietf.org/html/rfc7231#section-6.5.15) _服务器拒绝使用当前协议执行请求但在客户端升级到不同协议后可能愿意这样做_<!--rehype:tooltips-->
* [451: Unavailable For Legal Reasons](https://datatracker.ietf.org/doc/html/rfc7725#section-3) _此状态代码表示服务器拒绝访问资源作为法律要求的结果_<!--rehype:tooltips--> - [451: Unavailable For Legal Reasons](https://datatracker.ietf.org/doc/html/rfc7725#section-3) _此状态代码表示服务器拒绝访问资源作为法律要求的结果_<!--rehype:tooltips-->
### 1xx. 信息 ### 1xx. 信息
* [100: Continue](https://tools.ietf.org/html/rfc7231#section-6.2.1) _服务器只收到了请求的一部分但只要没有被拒绝客户端就应该继续请求_<!--rehype:tooltips--> - [100: Continue](https://tools.ietf.org/html/rfc7231#section-6.2.1) _服务器只收到了请求的一部分但只要没有被拒绝客户端就应该继续请求_<!--rehype:tooltips-->
* [101: Switching Protocols](https://tools.ietf.org/html/rfc7231#section-6.2.2) _服务器切换协议_<!--rehype:tooltips--> - [101: Switching Protocols](https://tools.ietf.org/html/rfc7231#section-6.2.2) _服务器切换协议_<!--rehype:tooltips-->
* [102: Processing](https://tools.ietf.org/html/rfc2518#section-10.1) _用于通知客户端服务器已接受完整请求但尚未完成的临时响应_<!--rehype:tooltips--> - [102: Processing](https://tools.ietf.org/html/rfc2518#section-10.1) _用于通知客户端服务器已接受完整请求但尚未完成的临时响应_<!--rehype:tooltips-->
### 3xx. 重定向 ### 3xx. 重定向
* [300: Multiple Choices](https://tools.ietf.org/html/rfc7231#section-6.4.1) _一个链接列表。 用户可以选择一个链接并转到该位置。 最多五个地址_<!--rehype:tooltips--> - [300: Multiple Choices](https://tools.ietf.org/html/rfc7231#section-6.4.1) _一个链接列表。 用户可以选择一个链接并转到该位置。 最多五个地址_<!--rehype:tooltips-->
* [301: Moved Permanently](https://tools.ietf.org/html/rfc7231#section-6.4.2) _请求的页面已移至新的 url_<!--rehype:tooltips--> - [301: Moved Permanently](https://tools.ietf.org/html/rfc7231#section-6.4.2) _请求的页面已移至新的 url_<!--rehype:tooltips-->
* [302: Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) _请求的页面已临时移动到新的 url_<!--rehype:tooltips--> - [302: Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) _请求的页面已临时移动到新的 url_<!--rehype:tooltips-->
* [303: See Other](https://tools.ietf.org/html/rfc7231#section-6.4.4) _请求的页面可以在不同的 url 下找到_<!--rehype:tooltips--> - [303: See Other](https://tools.ietf.org/html/rfc7231#section-6.4.4) _请求的页面可以在不同的 url 下找到_<!--rehype:tooltips-->
* [304: Not Modified](https://tools.ietf.org/html/rfc7232#section-4.1) _这是对 If-Modified-Since 或 If-None-Match 标头的响应代码,其中 URL 自指定日期以来未修改_<!--rehype:tooltips--> - [304: Not Modified](https://tools.ietf.org/html/rfc7232#section-4.1) _这是对 If-Modified-Since 或 If-None-Match 标头的响应代码,其中 URL 自指定日期以来未修改_<!--rehype:tooltips-->
* [305: Use Proxy](https://tools.ietf.org/html/rfc7231#section-6.4.5) _请求的 URL 必须通过 Location 标头中提到的代理访问_<!--rehype:tooltips--> - [305: Use Proxy](https://tools.ietf.org/html/rfc7231#section-6.4.5) _请求的 URL 必须通过 Location 标头中提到的代理访问_<!--rehype:tooltips-->
* [306: Unused](https://tools.ietf.org/html/rfc7231#section-6.4.6) _此代码在以前的版本中使用过。 它不再使用但代码被保留_<!--rehype:tooltips--> - [306: Unused](https://tools.ietf.org/html/rfc7231#section-6.4.6) _此代码在以前的版本中使用过。 它不再使用但代码被保留_<!--rehype:tooltips-->
* [307: Temporary Redirect](https://tools.ietf.org/html/rfc7231#section-6.4.7) _请求的页面已临时移动到新的 url_<!--rehype:tooltips--> - [307: Temporary Redirect](https://tools.ietf.org/html/rfc7231#section-6.4.7) _请求的页面已临时移动到新的 url_<!--rehype:tooltips-->
### 5xx. 服务器错误 ### 5xx. 服务器错误
* [500: Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) _请求未完成。服务器遇到了意外情况_<!--rehype:tooltips--> - [500: Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) _请求未完成。服务器遇到了意外情况_<!--rehype:tooltips-->
* [501: Not Implemented](https://tools.ietf.org/html/rfc7231#section-6.6.2) _请求未完成。服务器不支持所需的功能_<!--rehype:tooltips--> - [501: Not Implemented](https://tools.ietf.org/html/rfc7231#section-6.6.2) _请求未完成。服务器不支持所需的功能_<!--rehype:tooltips-->
* [502: Bad Gateway](https://tools.ietf.org/html/rfc7231#section-6.6.3) _请求未完成。服务器收到来自上游服务器的无效响应_<!--rehype:tooltips--> - [502: Bad Gateway](https://tools.ietf.org/html/rfc7231#section-6.6.3) _请求未完成。服务器收到来自上游服务器的无效响应_<!--rehype:tooltips-->
* [503: Service Unavailable](https://tools.ietf.org/html/rfc7231#section-6.6.4) _请求未完成。服务器暂时超载或停机_<!--rehype:tooltips--> - [503: Service Unavailable](https://tools.ietf.org/html/rfc7231#section-6.6.4) _请求未完成。服务器暂时超载或停机_<!--rehype:tooltips-->
* [504: Gateway Timeout](https://tools.ietf.org/html/rfc7231#section-6.6.5) _网关已超时_<!--rehype:tooltips--> - [504: Gateway Timeout](https://tools.ietf.org/html/rfc7231#section-6.6.5) _网关已超时_<!--rehype:tooltips-->
* [505: HTTP Version Not Supported](https://tools.ietf.org/html/rfc7231#section-6.6.6) _服务器不支持“http 协议”版本_<!--rehype:tooltips--> - [505: HTTP Version Not Supported](https://tools.ietf.org/html/rfc7231#section-6.6.6) _服务器不支持“http 协议”版本_<!--rehype:tooltips-->
### RESTful API ### RESTful API

View File

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

View File

@ -73,6 +73,7 @@ for (char c: word.toCharArray()) {
} }
// 输出: Q-u-i-c-k-R-e-f- // 输出: Q-u-i-c-k-R-e-f-
``` ```
查看: [Loops](#java-循环) 查看: [Loops](#java-循环)
### 数组 Arrays ### 数组 Arrays
@ -85,6 +86,7 @@ String[] letters = {"A", "B", "C"};
int[] mylist = {100, 200}; int[] mylist = {100, 200};
boolean[] answers = {true, false}; boolean[] answers = {true, false};
``` ```
查看: [Arrays](#java-数组) 查看: [Arrays](#java-数组)
### Swap ### Swap
@ -127,9 +129,10 @@ if (j == 10) {
} }
``` ```
查看: [Conditionals](#java-conditionals) 查看: [Conditionals](#条件语句 Conditionals)
### 用户输入 ### 用户输入
```java ```java
Scanner in = new Scanner(System.in); Scanner in = new Scanner(System.in);
String str = in.nextLine(); String str = in.nextLine();
@ -175,48 +178,60 @@ StringBuilder sb = new StringBuilder(10);
└───┴───┴───┴───┴───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┴───┴───┴───┴───┘
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
``` ```
--- ---
```java ```java
sb.append("Reference"); sb.append("Reference");
``` ```
--- ---
```java ```java
┌───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┬───┬───┬───┬───┐
| R | e | f | e | r | e | n | c | e | | R | e | f | e | r | e | n | c | e |
└───┴───┴───┴───┴───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┴───┴───┴───┴───┘
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
``` ```
--- ---
```java ```java
sb.delete(3, 9); sb.delete(3, 9);
``` ```
--- ---
```java ```java
┌───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┬───┬───┬───┬───┐
| R | e | f | | | | | | | | R | e | f | | | | | | |
└───┴───┴───┴───┴───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┴───┴───┴───┴───┘
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
``` ```
--- ---
```java ```java
sb.insert(0, "My "); sb.insert(0, "My ");
``` ```
--- ---
```java ```java
┌───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┬───┬───┬───┬───┐
| M | y | | R | e | f | | | | | M | y | | R | e | f | | | |
└───┴───┴───┴───┴───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┴───┴───┴───┴───┘
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
``` ```
--- ---
```java ```java
sb.append("!"); sb.append("!");
``` ```
--- ---
```java ```java
┌───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┬───┬───┬───┬───┐
| M | y | | R | e | f | ! | | | | M | y | | R | e | f | ! | | |
@ -370,7 +385,7 @@ Java 条件语句
- `!` _(逻辑补码运算符;反转布尔值)_ - `!` _(逻辑补码运算符;反转布尔值)_
<!--rehype:className=style-round--> <!--rehype:className=style-round-->
---- ---
- `==` _(等于)_ - `==` _(等于)_
- `!=` _(不等于)_ - `!=` _(不等于)_
@ -380,19 +395,19 @@ Java 条件语句
- `<=` _(小于或等于)_ - `<=` _(小于或等于)_
<!--rehype:className=cols-2 style-round--> <!--rehype:className=cols-2 style-round-->
---- ---
- `&&` _条件与_ - `&&` _条件与_
- `||` _条件或_ - `||` _条件或_
- [?:](#三元运算符) _三元(if-then-else 语句的简写)_ - [?:](#三元运算符) _三元(if-then-else 语句的简写)_
<!--rehype:className=style-round--> <!--rehype:className=style-round-->
---- ---
- `instanceof` _(将对象与指定类型进行比较)_ - `instanceof` _(将对象与指定类型进行比较)_
<!--rehype:className=style-round--> <!--rehype:className=style-round-->
---- ---
- `~` _(一元按位补码)_ - `~` _(一元按位补码)_
- `<<` _(签名左移)_ - `<<` _(签名左移)_
@ -462,7 +477,7 @@ for (int i = 0; i < 10; i++) {
// 输出: 0123456789 // 输出: 0123456789
``` ```
------ ---
```java ```java
for (int i = 0,j = 0; i < 3; i++,j--) { for (int i = 0,j = 0; i < 3; i++,j--) {

View File

@ -54,7 +54,6 @@ count = 10;
console.log(count); // => 10 console.log(count); // => 10
``` ```
### const 关键字 ### const 关键字
```javascript ```javascript
@ -238,11 +237,9 @@ parseFloat();
parseInt(); parseInt();
``` ```
JavaScript 条件 JavaScript 条件
---- ----
### 操作符 ### 操作符
<!--rehype:wrap-class=row-span-3--> <!--rehype:wrap-class=row-span-3-->
@ -273,7 +270,7 @@ true && false; // false
1 === '1' // false 1 === '1' // false
``` ```
#### 逻辑运算符 ! #### 逻辑运算符
```javascript ```javascript
let lateToWork = true; let lateToWork = true;
@ -727,7 +724,6 @@ numbers.concat(newFirstNumber)
如果你想避免改变你的原始数组,你可以使用 concat。 如果你想避免改变你的原始数组,你可以使用 concat。
### 方法 .splice() ### 方法 .splice()
```javascript ```javascript
@ -1295,7 +1291,6 @@ class Song {
} }
``` ```
JavaScript Modules JavaScript Modules
---- ----
<!--rehype:body-class=cols-2--> <!--rehype:body-class=cols-2-->

View File

@ -546,7 +546,6 @@ test('async test', () => {
从你的测试中 _返回_ 一个 `Promise` 从你的测试中 _返回_ 一个 `Promise`
## 模拟 ## 模拟
### 模拟函数 ### 模拟函数
@ -800,7 +799,6 @@ const fs = require('fs')
const fs = require.requireActual('fs') const fs = require.requireActual('fs')
``` ```
数据驱动测试Jest 23+ 数据驱动测试Jest 23+
---- ----
@ -886,7 +884,6 @@ test('第二个文本', () => {
`Node.js``Jest` 会缓存你需要的模块。 要测试具有副作用的模块,您需要在测试之间重置模块注册表 `Node.js``Jest` 会缓存你需要的模块。 要测试具有副作用的模块,您需要在测试之间重置模块注册表
另见 另见
---- ----

View File

@ -75,8 +75,8 @@ JSON 备忘清单
```json ```json
{ "foo": 'bar' } { "foo": 'bar' }
``` ```
Have to be delimited by double quotes
Have to be delimited by double quotes
### 数字 ### 数字
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -297,6 +297,7 @@ let myArray = [
} }
]; ];
``` ```
---- ----
| | | | | |
@ -320,7 +321,7 @@ let myArray = [
]; ];
``` ```
----- ----
| | | | | |
|--------------|-----------| |--------------|-----------|
@ -328,7 +329,6 @@ let myArray = [
| `myArray[5]` | true | | `myArray[5]` | true |
| `myArray[6]` | undefined | | `myArray[6]` | undefined |
另见 另见
---- ----

View File

@ -3,7 +3,6 @@ Koajs 备忘清单
基于 Node.js 平台的下一代 web 开发框架,包含 [Koa](https://koajs.com/) 的 API 参考列表和一些示例。 基于 Node.js 平台的下一代 web 开发框架,包含 [Koa](https://koajs.com/) 的 API 参考列表和一些示例。
入门 入门
--- ---
@ -13,6 +12,7 @@ Koajs 备忘清单
[Koa](https://koajs.com/) 需要 [node v7.6.0](https://nodejs.org) 或更高版本来支持ES2015、异步方法你可以安装自己支持的 `node` 版本 [Koa](https://koajs.com/) 需要 [node v7.6.0](https://nodejs.org) 或更高版本来支持ES2015、异步方法你可以安装自己支持的 `node` 版本
- 安装依赖 - 安装依赖
```bash ```bash
$ mkdir myapp # 创建目录 $ mkdir myapp # 创建目录
$ cd myapp # 进入目录 $ cd myapp # 进入目录
@ -20,7 +20,9 @@ Koajs 备忘清单
$ npm init -y # 初始化一个配置 $ npm init -y # 初始化一个配置
$ npm install koa # 安装依赖 $ npm install koa # 安装依赖
``` ```
- 入口文件 `index.js` 添加代码: - 入口文件 `index.js` 添加代码:
```js ```js
const Koa = require('koa'); const Koa = require('koa');
const app = new Koa(); const app = new Koa();
@ -31,7 +33,9 @@ Koajs 备忘清单
app.listen(3000); app.listen(3000);
``` ```
- 使用以下命令运行应用程序 - 使用以下命令运行应用程序
```bash ```bash
$ node index.js $ node index.js
``` ```

View File

@ -199,7 +199,7 @@ $ lerna publish --canary preminor
} }
``` ```
---- ---
:- | :- :- | :-
:- | :- :- | :-
@ -239,7 +239,7 @@ $ lerna version -m "chore(doc): publish %v"
- `prerelease` 预发行 - `prerelease` 预发行
<!--rehype:className=cols-2--> <!--rehype:className=cols-2-->
---- ---
:- | :- :- | :-
:- | :- :- | :-
@ -311,7 +311,6 @@ $ lerna bootstrap --hoist
`--force-local` [#](https://github.com/lerna/lerna/tree/main/commands/bootstrap#--force-local) | 此标志会导致引导命令始终对本地依赖项进行符号链接,而不管匹配的版本范围如何 `--force-local` [#](https://github.com/lerna/lerna/tree/main/commands/bootstrap#--force-local) | 此标志会导致引导命令始终对本地依赖项进行符号链接,而不管匹配的版本范围如何
<!--rehype:className=style-list-arrow--> <!--rehype:className=style-list-arrow-->
### info 本地环境信息 ### info 本地环境信息
```bash ```bash
@ -424,13 +423,13 @@ lerna la
- 如果不存在 `.gitignore`,则生成一个忽略文件 - 如果不存在 `.gitignore`,则生成一个忽略文件
<!--rehype:className=style-timeline--> <!--rehype:className=style-timeline-->
---- ---
```shell ```shell
$ lerna init --independent $ lerna init --independent
``` ```
---- ---
:- | :- :- | :-
:- | :- :- | :-
@ -527,7 +526,6 @@ $ lerna diff package-name # 区分一个特定的包
类似于 `lerna changed`,此命令运行 `git diff` 类似于 `lerna changed`,此命令运行 `git diff`
### clean ### clean
从所有包中删除 `node_modules` 目录 从所有包中删除 `node_modules` 目录

View File

@ -72,7 +72,6 @@ $ lessc styles.less styles.css
另见: [混合(Mixin)的更多信息](https://lesscss.org/features/#mixins-feature) 另见: [混合(Mixin)的更多信息](https://lesscss.org/features/#mixins-feature)
### 嵌套(Nesting) ### 嵌套(Nesting)
```css ```css

View File

@ -78,7 +78,6 @@ $ kill -9 `lsof -t -u apache`
$ kill -9 $(lsof -t -i :8080) $ kill -9 $(lsof -t -i :8080)
``` ```
### 参数 ### 参数
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -109,13 +108,12 @@ lsof -p $pid
lsof -i:9981 -P -t -sTCP:LISTEN lsof -i:9981 -P -t -sTCP:LISTEN
``` ```
### 列出打开文件的进程: ### 列出打开文件的进程
```bash ```bash
lsof $filename lsof $filename
``` ```
示例 示例
--- ---
@ -219,7 +217,6 @@ migration 2 root txt unknown /proc/2/exe
`NAME` | 打开文件的确切名称 `NAME` | 打开文件的确切名称
`REG` | 常规文件 `REG` | 常规文件
另见 另见
--- ---

View File

@ -3,7 +3,6 @@ Markdown 备忘清单
这是 Markdown 语法的快速参考备忘单。 这是 Markdown 语法的快速参考备忘单。
Markdown 快速参考 Markdown 快速参考
---- ----
@ -30,7 +29,6 @@ Header 2
-------- --------
``` ```
### 块引用 ### 块引用
```markdown ```markdown
@ -64,6 +62,7 @@ Header 2
+ Item 1 + Item 1
+ Item 2 + Item 2
``` ```
或者**任务**列表 或者**任务**列表
```markdown ```markdown
@ -132,11 +131,13 @@ ___
### 代码 ### 代码
~~~markdown ```markdown
```javascript ```javascript
console.log("This is a block code") console.log("This is a block code")
``` ```
~~~
```
```markdown ```markdown
~~~css ~~~css
@ -144,12 +145,10 @@ console.log("This is a block code")
~~~ ~~~
``` ```
```markdown ```markdown
4 空格缩进做一个代码块 4 空格缩进做一个代码块
``` ```
#### 内联代码 #### 内联代码
```markdown ```markdown

View File

@ -6,7 +6,6 @@ MATLAB 备忘清单
入门 入门
--- ---
### 介绍 ### 介绍
MATLAB 是 `matrix laboratory` 的缩写形式 MATLAB 是 `matrix laboratory` 的缩写形式
@ -24,14 +23,18 @@ MATLAB 允许您使用单一的算术运算符或函数来处理矩阵中的所
```matlab ```matlab
a + 10 a + 10
``` ```
MATLAB 将执行上述语句,并返回以下结果: MATLAB 将执行上述语句,并返回以下结果:
``` ```
ans = 3×3 ans = 3×3
11 13 15 11 13 15
12 14 16 12 14 16
17 18 20 17 18 20
``` ```
---
----
```matlab ```matlab
sin(a) sin(a)
``` ```
@ -50,7 +53,9 @@ ans = 3×3
```matlab ```matlab
a' a'
``` ```
---- ----
``` ```
ans = 3×3 ans = 3×3
1 2 7 1 2 7
@ -63,7 +68,9 @@ ans = 3×3
```matlab ```matlab
p = a*inv(a) p = a*inv(a)
``` ```
---- ----
``` ```
p = 3×3 p = 3×3
1.0000 0 0 1.0000 0 0
@ -79,7 +86,9 @@ p = 3×3
```matlab ```matlab
A = [a,a] A = [a,a]
``` ```
---- ----
``` ```
A = 3×6 A = 3×6
@ -93,7 +102,9 @@ A = 3×6
```matlab ```matlab
A = [a; a] A = [a; a]
``` ```
---- ----
``` ```
A = 6×3 A = 6×3
@ -126,7 +137,9 @@ a = 1×4
```matlab ```matlab
a = [1 3 5; 2 4 6; 7 8 10] a = [1 3 5; 2 4 6; 7 8 10]
``` ```
---- ----
``` ```
a = 3×3 a = 3×3
1 3 5 1 3 5
@ -139,7 +152,9 @@ a = 3×3
```matlab ```matlab
z = zeros(5,1) z = zeros(5,1)
``` ```
---- ----
``` ```
z = 5×1 z = 5×1
0 0
@ -156,6 +171,7 @@ z = 5×1
```matlab ```matlab
sqrt(-1) sqrt(-1)
``` ```
---- ----
``` ```
@ -167,7 +183,9 @@ ans = 0.0000 + 1.0000i
```matlab ```matlab
c = [3+4i, 4+3j; -i, 10j] c = [3+4i, 4+3j; -i, 10j]
``` ```
---- ----
``` ```
c = 2×2 complex c = 2×2 complex
@ -198,7 +216,6 @@ c = 2×2 complex
:- | :- :- | :-
[DisplayFormatOptions](https://ww2.mathworks.cn/help/matlab/ref/ans.html) | 命令行窗口中的输出显示格式 [DisplayFormatOptions](https://ww2.mathworks.cn/help/matlab/ref/ans.html) | 命令行窗口中的输出显示格式
### 矩阵和数组 ### 矩阵和数组
<!--rehype:wrap-class=row-span-5--> <!--rehype:wrap-class=row-span-5-->
@ -478,7 +495,6 @@ c = 2×2 complex
### 字符串匹配模式 - 自定义模式显示 ### 字符串匹配模式 - 自定义模式显示
:- | :- | :- :- | :- | :-
:- | :- | :- :- | :- | :-
[maskedPattern](https://ww2.mathworks.cn/help/matlab/ref/maskedpattern.html) | 具有指定显示名称的模式 [maskedPattern](https://ww2.mathworks.cn/help/matlab/ref/maskedpattern.html) | 具有指定显示名称的模式
@ -494,7 +510,6 @@ c = 2×2 complex
[regexptranslate](https://ww2.mathworks.cn/help/matlab/ref/regexptranslate.html) | 将文本转换为正则表达式 [regexptranslate](https://ww2.mathworks.cn/help/matlab/ref/regexptranslate.html) | 将文本转换为正则表达式
[regexpPattern](https://ww2.mathworks.cn/help/matlab/ref/regexppattern.html) | 匹配指定正则表达式的模式 [regexpPattern](https://ww2.mathworks.cn/help/matlab/ref/regexppattern.html) | 匹配指定正则表达式的模式
### 字符串匹配模式 - 联接和拆分 ### 字符串匹配模式 - 联接和拆分
:- | :- | :- :- | :- | :-
@ -543,7 +558,6 @@ c = 2×2 complex
[strncmp](https://ww2.mathworks.cn/help/matlab/ref/strncmp.html) | 比较字符串的前 <code class="literal">n</code> 个字符(区分大小写) [strncmp](https://ww2.mathworks.cn/help/matlab/ref/strncmp.html) | 比较字符串的前 <code class="literal">n</code> 个字符(区分大小写)
[strncmpi](https://ww2.mathworks.cn/help/matlab/ref/strncmpi.html) | 比较字符串的前 <code class="literal">n</code> 个字符(不区分大小写) [strncmpi](https://ww2.mathworks.cn/help/matlab/ref/strncmpi.html) | 比较字符串的前 <code class="literal">n</code> 个字符(不区分大小写)
### 基本算术 ### 基本算术
<!--rehype:wrap-class=row-span-3--> <!--rehype:wrap-class=row-span-3-->
@ -620,7 +634,6 @@ c = 2×2 complex
:- | :- | :- :- | :- | :-
[bsxfun](https://ww2.mathworks.cn/help/matlab/ref/bsxfun.html) | 对两个数组应用按元素运算(启用隐式扩展) [bsxfun](https://ww2.mathworks.cn/help/matlab/ref/bsxfun.html) | 对两个数组应用按元素运算(启用隐式扩展)
### 关系运算 ### 关系运算
值的比较 值的比较
@ -688,7 +701,6 @@ true 或 false 条件
[bitshift](https://ww2.mathworks.cn/help/matlab/ref/bitshift.html) | 将位移动指定位数 [bitshift](https://ww2.mathworks.cn/help/matlab/ref/bitshift.html) | 将位移动指定位数
[swapbytes](https://ww2.mathworks.cn/help/matlab/ref/swapbytes.html) | 交换字节顺序 [swapbytes](https://ww2.mathworks.cn/help/matlab/ref/swapbytes.html) | 交换字节顺序
数据导入和导出 数据导入和导出
--- ---
@ -824,7 +836,6 @@ true 或 false 条件
### NetCDF 库程序包 - 维度 ### NetCDF 库程序包 - 维度
:- | :- | :- :- | :- | :-
:- | :- | :- :- | :- | :-
[netcdf.defDim](https://ww2.mathworks.cn/help/matlab/ref/netcdf.defdim.html) | 创建 netCDF 维度 [netcdf.defDim](https://ww2.mathworks.cn/help/matlab/ref/netcdf.defdim.html) | 创建 netCDF 维度
@ -907,7 +918,6 @@ true 或 false 条件
[h5write](https://ww2.mathworks.cn/help/matlab/ref/h5write.html) | 写入 HDF5 数据集 [h5write](https://ww2.mathworks.cn/help/matlab/ref/h5write.html) | 写入 HDF5 数据集
[h5writeatt](https://ww2.mathworks.cn/help/matlab/ref/h5writeatt.html) | 写入 HDF5 属性 [h5writeatt](https://ww2.mathworks.cn/help/matlab/ref/h5writeatt.html) | 写入 HDF5 属性
### HDF5 库程序包 ### HDF5 库程序包
<!--rehype:wrap-class=row-span-4--> <!--rehype:wrap-class=row-span-4-->
@ -966,7 +976,6 @@ true 或 false 条件
[hdfdf24](https://ww2.mathworks.cn/help/matlab/ref/hdfdf24.html) | HDF 24 位光栅图像 (DF24) 接口的入口 [hdfdf24](https://ww2.mathworks.cn/help/matlab/ref/hdfdf24.html) | HDF 24 位光栅图像 (DF24) 接口的入口
[hdfdfr8](https://ww2.mathworks.cn/help/matlab/ref/hdfdfr8.html) | HDF 8 位光栅图像 (DFR8) 接口的入口 [hdfdfr8](https://ww2.mathworks.cn/help/matlab/ref/hdfdfr8.html) | HDF 8 位光栅图像 (DFR8) 接口的入口
### FITS 文件 - 函数 ### FITS 文件 - 函数
:- | :- :- | :-
@ -1305,7 +1314,6 @@ true 或 false 条件
[setRTS](https://ww2.mathworks.cn/help/matlab/ref/serialport.setrts.html) | 设置串行 RTS 引脚 [setRTS](https://ww2.mathworks.cn/help/matlab/ref/serialport.setrts.html) | 设置串行 RTS 引脚
[setDTR](https://ww2.mathworks.cn/help/matlab/ref/serialport.setdtr.html) | 设置串行 DTR 引脚 [setDTR](https://ww2.mathworks.cn/help/matlab/ref/serialport.setdtr.html) | 设置串行 DTR 引脚
### TCP/IP 通信 - 连接和配置 ### TCP/IP 通信 - 连接和配置
:- | :- :- | :-

View File

@ -3,7 +3,6 @@ MIME 类型 备忘清单
此备忘单列出了一些常见的 Web MIME 类型。 您可以查看包含所有已注册 MIME 类型的 [IANA/MIME 媒体类型注册表](https://www.iana.org/assignments/media-types/media-types.xhtml)。 此备忘单列出了一些常见的 Web MIME 类型。 您可以查看包含所有已注册 MIME 类型的 [IANA/MIME 媒体类型注册表](https://www.iana.org/assignments/media-types/media-types.xhtml)。
入门 入门
---- ----
@ -17,7 +16,6 @@ MIME 类型 备忘清单
- 对于 Internet 上的文件格式或格式内容 - 对于 Internet 上的文件格式或格式内容
<!--rehype:className=style-round--> <!--rehype:className=style-round-->
MIME 类型列表 MIME 类型列表
-------- --------

View File

@ -3,7 +3,6 @@ MySQL 备忘清单
本备忘单旨在快速理解 [MySQL](https://mysql.com) 所涉及的主要概念提供了最常用的SQL语句供您参考。 本备忘单旨在快速理解 [MySQL](https://mysql.com) 所涉及的主要概念提供了最常用的SQL语句供您参考。
入门 入门
--- ---
@ -65,9 +64,9 @@ mysql -h <host> -u <user> -p [db_name]
`SHOW TABLES;` | 列出当前数据库的表 `SHOW TABLES;` | 列出当前数据库的表
`SHOW FIELDS FROM` t`;` | 表的列表字段 `SHOW FIELDS FROM` t`;` | 表的列表字段
`DESC` t`;` | 显示表格结构 `DESC` t`;` | 显示表格结构
`SHOW CREATE TABLE `t`;` | 显示创建表sql `SHOW CREATE TABLE`t`;` | 显示创建表sql
`TRUNCATE TABLE `t`;` | 删除表中的所有数据 `TRUNCATE TABLE`t`;` | 删除表中的所有数据
`DROP TABLE `t`;` | 删除表格 `DROP TABLE`t`;` | 删除表格
#### Proccess #### Proccess
@ -388,6 +387,7 @@ CREATE TABLE t(
CHECK(c1> 0 AND c1 >= c2) CHECK(c1> 0 AND c1 >= c2)
); );
``` ```
c2列中的设置值不为NULL c2列中的设置值不为NULL
```sql ```sql
@ -556,7 +556,6 @@ DROP INDEX idx_name;
MySQL 数据类型 MySQL 数据类型
--------- ---------
### Strings ### Strings
| - | - | | - | - |
@ -573,16 +572,15 @@ MySQL 数据类型
| `ENUM` | One of preset options | | `ENUM` | One of preset options |
| `SET` | Selection of preset options | | `SET` | Selection of preset options |
### Date & time ### Date & time
| Data Type | Format | | Data Type | Format |
|-------------|---------------------| |-------------|---------------------|
| `DATE ` | yyyy-MM-dd | | `DATE` | yyyy-MM-dd |
| `TIME ` | hh:mm:ss | | `TIME` | hh:mm:ss |
| `DATETIME ` | yyyy-MM-dd hh:mm:ss | | `DATETIME` | yyyy-MM-dd hh:mm:ss |
| `TIMESTAMP` | yyyy-MM-dd hh:mm:ss | | `TIMESTAMP` | yyyy-MM-dd hh:mm:ss |
| `YEAR ` | yyyy | | `YEAR` | yyyy |
### Numeric ### Numeric

View File

@ -25,7 +25,6 @@ $ nc -lp port [host] [port]
### 选项示例 ### 选项示例
<!--rehype:wrap-class=col-span-3 row-span-2--> <!--rehype:wrap-class=col-span-3 row-span-2-->
选项 | 示例 | 说明 选项 | 示例 | 说明
:- | :- | :- :- | :- | :-
`-h` | nc -h | 帮助 `-h` | nc -h | 帮助
@ -40,7 +39,6 @@ $ nc -lp port [host] [port]
`-4` | nc -4 -l 8000 | 仅限 `IPv4` `-4` | nc -4 -l 8000 | 仅限 `IPv4`
`-6` | nc -6 -l 8000 | 仅限 `IPv6` `-6` | nc -6 -l 8000 | 仅限 `IPv6`
### 聊天客户端-服务器 ### 聊天客户端-服务器
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->

View File

@ -42,7 +42,6 @@ $ netstat -h
`netstat -au` | 所有 UDP 连接 `netstat -au` | 所有 UDP 连接
`netstat -ant` | 显示没有反向 DNS 查找的 IP 地址 `netstat -ant` | 显示没有反向 DNS 查找的 IP 地址
选项 | 说明 选项 | 说明
:- | :- :- | :-
`netstat` | 活动连接 `netstat` | 活动连接
@ -53,7 +52,6 @@ $ netstat -h
`netstat -tnl` | 监听 TCP 端口 `netstat -tnl` | 监听 TCP 端口
`netstat -unl` | 监听 UDP 端口 `netstat -unl` | 监听 UDP 端口
### 网络 ### 网络
选项 | 说明 选项 | 说明
@ -65,7 +63,6 @@ $ netstat -h
### 路由 ### 路由
选项 | 说明 选项 | 说明
:- | :- :- | :-
`netstat -r` | 显示路由表 `netstat -r` | 显示路由表

View File

@ -313,7 +313,6 @@ server {
您可以使用 Let's Encrypt 轻松保护您的网站/应用程序。去 [lets-encrypt](https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx.html) 获取更多信息 您可以使用 Let's Encrypt 轻松保护您的网站/应用程序。去 [lets-encrypt](https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx.html) 获取更多信息
### 重定向(301永久) ### 重定向(301永久)
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->

View File

@ -86,11 +86,9 @@ $ npm cache verify # 验证缓存文件夹的内容,垃圾收集任何不需
`npm update -g` | 更新全局包 `npm update -g` | 更新全局包
`npm update lodash` | 更新 `lodash` `npm update lodash` | 更新 `lodash`
### 杂项功能 ### 杂项功能
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
```bash ```bash
# 将某人添加为所有者 # 将某人添加为所有者
$ npm owner add USERNAME PACKAGENAME $ npm owner add USERNAME PACKAGENAME
@ -168,7 +166,6 @@ $ nrm use cnpm
`$PREFIX/etc/npmrc` | 全局配置文件 `$PREFIX/etc/npmrc` | 全局配置文件
`/path/to/npm/npmrc` | npm 内置配置文件 `/path/to/npm/npmrc` | npm 内置配置文件
### 配置内容 ### 配置内容
```ini ```ini
@ -180,17 +177,16 @@ $ nrm use cnpm
注释使用 `#`, `;` 放置到一行的开头, [`.npmrc`](https://docs.npmjs.com/cli/v8/configuring-npm/npmrc) 文件由指定此注释语法的 [`npm/ini`](https://github.com/npm/ini) 解析 注释使用 `#`, `;` 放置到一行的开头, [`.npmrc`](https://docs.npmjs.com/cli/v8/configuring-npm/npmrc) 文件由指定此注释语法的 [`npm/ini`](https://github.com/npm/ini) 解析
### registry ### registry
:- | :- :- | :-
:- | :- :- | :-
`npm` | https://registry.npmjs.org/ `npm` | <https://registry.npmjs.org/>
`yarn` | https://registry.yarnpkg.com/ `yarn` | <https://registry.yarnpkg.com/>
`tencent` | https://mirrors.cloud.tencent.com/npm/ `tencent` | <https://mirrors.cloud.tencent.com/npm/>
`cnpm` | https://r.cnpmjs.org/ `cnpm` | <https://r.cnpmjs.org/>
`taobao` | https://registry.npmmirror.com/ `taobao` | <https://registry.npmmirror.com/>
`npmMirror` | https://skimdb.npmjs.com/registry/ `npmMirror` | <https://skimdb.npmjs.com/registry/>
### `.npmignore` ### `.npmignore`

View File

@ -21,7 +21,7 @@ package.json 备忘清单
} }
``` ```
**规则** #### 规则
- 必须小于或等于214个字符(包括 `@scope/` 范围包) - 必须小于或等于214个字符(包括 `@scope/` 范围包)
- 不能以点(`.`)或下划线(`_`)开头 - 不能以点(`.`)或下划线(`_`)开头
@ -577,7 +577,6 @@ https://registry.npmjs.org/[包名]/-/[包名]-[version].tgz
此选项指定你的包的操作系统兼容性,它会检查 `process.platform` 此选项指定你的包的操作系统兼容性,它会检查 `process.platform`
### `cpu` ### `cpu`
```json ```json
@ -624,6 +623,8 @@ Yarn
### `flat` ### `flat`
<!-- markdownlint-disable MD042 -->
如果你的包只允许给定依赖的一个版本,你想强制和命令行上 [yarn install --flat](#) 相同的行为,把这个值设为 `true` 如果你的包只允许给定依赖的一个版本,你想强制和命令行上 [yarn install --flat](#) 相同的行为,把这个值设为 `true`
```json ```json
@ -651,7 +652,6 @@ Yarn
注意,`yarn install --flat` 命令将会自动在 `package.json` 文件里加入 `resolutions` 字段。 注意,`yarn install --flat` 命令将会自动在 `package.json` 文件里加入 `resolutions` 字段。
另见 另见
---- ----

View File

@ -3,7 +3,6 @@ PostgreSQL 备忘清单
[PostgreSQL](https://www.postgresql.org/docs/current/) 备忘清单为您提供了常用的 PostgreSQL 命令和语句。 [PostgreSQL](https://www.postgresql.org/docs/current/) 备忘清单为您提供了常用的 PostgreSQL 命令和语句。
入门 入门
--------------- ---------------
@ -34,7 +33,6 @@ postgres=# \q
postgres=# \! postgres=# \!
``` ```
### psql 命令 ### psql 命令
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
@ -52,7 +50,6 @@ postgres=# \!
`-V` | psql -V | 打印 psql 版本 `-V` | psql -V | 打印 psql 版本
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 获得帮助 ### 获得帮助
:- | - :- | -
@ -428,8 +425,6 @@ PostgreSQL 命令
`\dp` | 列出表访问权限 `\dp` | 列出表访问权限
`\det[+]` | 列出外部表 `\det[+]` | 列出外部表
### 查询缓冲区 ### 查询缓冲区
:- | - :- | -
@ -441,8 +436,6 @@ PostgreSQL 命令
`\s [FILE]` | 显示历史记录或保存到文件 `\s [FILE]` | 显示历史记录或保存到文件
`\w FILE` | 将查询缓冲区写入文件 `\w FILE` | 将查询缓冲区写入文件
### 信息 ### 信息
<!--rehype:wrap-class=row-span-4--> <!--rehype:wrap-class=row-span-4-->
@ -479,7 +472,6 @@ PostgreSQL 命令
`S`:显示系统对象,`+`:附加细节 `S`:显示系统对象,`+`:附加细节
### 连接 ### 连接
:- | - :- | -
@ -489,7 +481,6 @@ PostgreSQL 命令
`\password [USER]` | 更改密码 `\password [USER]` | 更改密码
`\conninfo` | 显示信息 `\conninfo` | 显示信息
### 格式化 ### 格式化
:- | - :- | -
@ -536,7 +527,6 @@ PostgreSQL 命令
- `\lo_list` - `\lo_list`
- `\lo_unlink LOBOID` - `\lo_unlink LOBOID`
各种各样的 各种各样的
------------- -------------
@ -635,4 +625,5 @@ $ sudo systemctl restart postgresql
Also see Also see
-------- --------
- [Posgres-cheatsheet](https://gist.github.com/apolloclark/ea5466d5929e63043dcf#posgres-cheatsheet) _(gist.github.com)_ - [Posgres-cheatsheet](https://gist.github.com/apolloclark/ea5466d5929e63043dcf#posgres-cheatsheet) _(gist.github.com)_

View File

@ -57,6 +57,7 @@ llo
查看: [Strings](#python-字符串) 查看: [Strings](#python-字符串)
### Lists ### Lists
```python ```python
mylist = [] mylist = []
mylist.append(1) mylist.append(1)
@ -67,7 +68,6 @@ for item in mylist:
查看: [Lists](#python-lists) 查看: [Lists](#python-lists)
### If Else ### If Else
```python ```python
@ -77,6 +77,7 @@ if num > 0:
else: else:
print("num is not greater than 0") print("num is not greater than 0")
``` ```
查看: [流程控制](#python-流程控制) 查看: [流程控制](#python-流程控制)
### 循环 ### 循环
@ -88,8 +89,8 @@ for item in range(6):
else: else:
print("Finally finished!") print("Finally finished!")
``` ```
查看: [Loops](#python-循环)
查看: [Loops](#python-循环)
### 函数 ### 函数
@ -101,7 +102,7 @@ else:
来自函数的你好 来自函数的你好
``` ```
查看: [Functions](#python-functions) 查看: [Functions](#函数)
### 文件处理 ### 文件处理
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
@ -151,7 +152,7 @@ message += "Part 2."
'10 + 10 = 20' '10 + 10 = 20'
``` ```
查看: [Python F-Strings](#python-f-strings-since-python) 查看: [Python F-Strings](#f-字符串(Python 3.6+))
Python 数据类型 Python 数据类型
--------------- ---------------
@ -165,6 +166,7 @@ multi_string = """Multiline Strings
Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet,
consectetur adipiscing elit """ consectetur adipiscing elit """
``` ```
查看: [Strings](#python-字符串) 查看: [Strings](#python-字符串)
### 数字 ### 数字
@ -194,8 +196,8 @@ list2 = [True, False, False]
list3 = [1, 5, 7, 9, 3] list3 = [1, 5, 7, 9, 3]
list4 = list((1, 5, 7, 9, 3)) list4 = list((1, 5, 7, 9, 3))
``` ```
查看: [Lists](#python-lists)
查看: [Lists](#python-lists)
### 元组 Tuple ### 元组 Tuple
@ -361,6 +363,7 @@ o
`len()` 函数返回字符串的长度 `len()` 函数返回字符串的长度
### 多份 ### 多份
```python ```python
>>> s = '===+' >>> s = '===+'
>>> n = 8 >>> n = 8
@ -396,7 +399,9 @@ True
name = "John" name = "John"
print("Hello, %s!" % name) print("Hello, %s!" % name)
``` ```
--- ---
```python ```python
name = "John" name = "John"
age = 23 age = 23
@ -789,7 +794,7 @@ x = 0
for index in range(10): for index in range(10):
x = index * 10 x = index * 10
if index == 5: if index == 5:
break break
print(x) print(x)
``` ```
@ -799,7 +804,7 @@ for index in range(10):
for index in range(3, 8): for index in range(3, 8):
x = index * 10 x = index * 10
if index == 5: if index == 5:
continue continue
print(x) print(x)
``` ```
@ -948,6 +953,7 @@ with open("myfile.txt") as file:
for line in file: for line in file:
print(line) print(line)
``` ```
#### 带行号 #### 带行号
```python ```python
@ -956,7 +962,6 @@ for i, line in enumerate(file, start=1):
print("Number %s: %s" % (i, line)) print("Number %s: %s" % (i, line))
``` ```
### 字符串 ### 字符串
#### 写一个字符串 #### 写一个字符串
@ -1083,6 +1088,7 @@ class ChildClass(ParentClass):
# 调用父级的 print_test() # 调用父级的 print_test()
super().print_test() super().print_test()
``` ```
--- ---
```python ```python
@ -1172,7 +1178,8 @@ Yoki.sound() # => Woof!
```python ```python
# 这是单行注释 # 这是单行注释
``` ```
----------
---
```python ```python
""" 可以写多行字符串 """ 可以写多行字符串
@ -1180,7 +1187,9 @@ Yoki.sound() # => Woof!
作为文档。 作为文档。
""" """
``` ```
----------
---
```python ```python
''' 可以写多行字符串 ''' 可以写多行字符串
使用三个',并且经常使用 使用三个',并且经常使用

View File

@ -111,7 +111,6 @@ function () {}
如果代码块内容太长,使用强制换行类(`wrap-text`)解决 如果代码块内容太长,使用强制换行类(`wrap-text`)解决
### 展示表格表头 ### 展示表格表头
```markdown ```markdown
@ -231,7 +230,6 @@ const school = <div>学校</div>;
`<!--rehype:className=style-timeline-->` | 时间轴样式 `<!--rehype:className=style-timeline-->` | 时间轴样式
`<!--rehype:className=style-arrow-->` | 箭头标记 `<!--rehype:className=style-arrow-->` | 箭头标记
### 隐藏卡片标题 ### 隐藏卡片标题
<!--rehype:style=display:none;&wrap-style=padding-top: 0;--> <!--rehype:style=display:none;&wrap-style=padding-top: 0;-->
@ -583,7 +581,6 @@ H2 部分
`Title 1` 标题添加 `col-span-2``row-span-2` 占位类,使用 `空格` 间隔。 `Title 1` 标题添加 `col-span-2``row-span-2` 占位类,使用 `空格` 间隔。
表格 表格
--- ---
@ -700,14 +697,19 @@ H2 部分
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
- **重命名为 new_name** - **重命名为 new_name**
```bash ```bash
$ git branch -m <new_name> $ git branch -m <new_name>
``` ```
- 推送和**重置** - 推送和**重置**
```bash ```bash
$ git push origin -u <new_name> $ git push origin -u <new_name>
``` ```
- 删除远程分支 - 删除远程分支
```bash ```bash
$ git push origin --delete <old> $ git push origin --delete <old>
``` ```

View File

@ -3,7 +3,6 @@ React 备忘清单
适合初学者的综合 React 备忘清单。 适合初学者的综合 React 备忘清单。
入门 入门
---- ----
@ -59,7 +58,6 @@ import World, { Hello } from './hello.js';
使用 `import` 导入 `Hello` 组件,在示例中使用。 使用 `import` 导入 `Hello` 组件,在示例中使用。
### React 组件中的 CSS ### React 组件中的 CSS
```jsx {2,5} ```jsx {2,5}
@ -82,7 +80,6 @@ export const Student = (
); );
``` ```
### 属性 ### 属性
```jsx ```jsx
@ -112,7 +109,6 @@ class Student extends React.Component {
`class` 组件使用 `this.props` 访问传递给组件的属性。 `class` 组件使用 `this.props` 访问传递给组件的属性。
### Children ### Children
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -138,7 +134,7 @@ function AlertBox(props) {
} }
``` ```
---- -----
```jsx ```jsx
{props.children} {props.children}
@ -158,7 +154,7 @@ class AlertBox extends React.Component {
} }
``` ```
---- -----
```jsx ```jsx
{this.props.children} {this.props.children}
@ -297,7 +293,7 @@ function Student() {
### Portals ### Portals
React 并*没有*创建一个新的 `div`。它只是把子元素渲染到 `domNode` 中。`domNode` 是一个可以在任何位置的有效 DOM 节点。 React 并_没有_创建一个新的 `div`。它只是把子元素渲染到 `domNode` 中。`domNode` 是一个可以在任何位置的有效 DOM 节点。
```jsx ```jsx
render() { render() {
@ -438,7 +434,7 @@ function CustomTextInput(props) {
</div> </div>
``` ```
---- -----
- [识别不安全的生命周期](https://zh-hans.reactjs.org/docs/strict-mode.html#identifying-unsafe-lifecycles) - [识别不安全的生命周期](https://zh-hans.reactjs.org/docs/strict-mode.html#identifying-unsafe-lifecycles)
- [关于使用过时字符串 ref API 的警告](https://zh-hans.reactjs.org/docs/strict-mode.html#warning-about-legacy-string-ref-api-usage) - [关于使用过时字符串 ref API 的警告](https://zh-hans.reactjs.org/docs/strict-mode.html#warning-about-legacy-string-ref-api-usage)
@ -754,7 +750,7 @@ export default function Weather(props) {
} }
``` ```
---- -----
```js ```js
{isShow && <div>内容</div>} {isShow && <div>内容</div>}
@ -860,7 +856,6 @@ class Welcome extends React.Component {
`this.props` | 组件接受参数 `this.props` | 组件接受参数
`this.state` | 组件内状态 `this.state` | 组件内状态
### Pure 组件 ### Pure 组件
```jsx ```jsx
@ -1003,7 +998,7 @@ Menu.Item = ({ children }) => (
); );
``` ```
---- -----
```jsx ```jsx
<Menu> <Menu>
@ -1330,7 +1325,7 @@ PropTypes 属性类型检查
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
``` ```
---- -----
:- | - :- | -
:- | - :- | -
@ -1354,7 +1349,6 @@ import PropTypes from 'prop-types'
`oneOf(any)` | 枚举类型 `oneOf(any)` | 枚举类型
`oneOfType([type])` | 几种类型中的任意一个类型 `oneOfType([type])` | 几种类型中的任意一个类型
#### _数组 Array_ #### _数组 Array_
:- | - :- | -

View File

@ -33,7 +33,6 @@ RegEX 备忘清单
`[a-zA-Z]` | 范围内的字符:<br>`a-z``A-Z` `[a-zA-Z]` | 范围内的字符:<br>`a-z``A-Z`
`[a-zA-Z0-9]` | 范围内的字符:<br>`a-z``A-Z``0-9` `[a-zA-Z0-9]` | 范围内的字符:<br>`a-z``A-Z``0-9`
### 量词 ### 量词
范例 | 说明 范例 | 说明
@ -115,7 +114,6 @@ RegEX 备忘清单
`[\b]` | 退格字符 `[\b]` | 退格字符
`\` | 使任何字符文字 `\` | 使任何字符文字
### 锚点 ### 锚点
范例 | 说明 范例 | 说明
@ -129,7 +127,6 @@ RegEX 备忘清单
`\b` | 一个词的边界 `\b` | 一个词的边界
`\B` | 非单词边界 `\B` | 非单词边界
### 替代 ### 替代
范例 | 说明 范例 | 说明
@ -210,8 +207,8 @@ RegEX 备忘清单
`(?!...)` | 负先行断言 `(?!...)` | 负先行断言
`(?<=...)` | 正后发断言 `(?<=...)` | 正后发断言
`(?<!...)` | 负后发断言 `(?<!...)` | 负后发断言
`?= `|正先行断言-存在 `?=`|正先行断言-存在
`?! `|负先行断言-排除 `?!`|负先行断言-排除
`?<=`|正后发断言-存在 `?<=`|正后发断言-存在
`?<!`|负后发断言-排除 `?<!`|负后发断言-排除
@ -276,26 +273,25 @@ RegEX 备忘清单
范例 | 说明 范例 | 说明
:-|- :-|-
`ring ` | 匹配 <yel>ring</yel> sp<yel>ring</yel>board 等。 `ring` | 匹配 <yel>ring</yel> sp<yel>ring</yel>board 等。
`. ` | 匹配 <yel>a</yel><yel>9</yel><yel>+</yel> 等。 `.` | 匹配 <yel>a</yel><yel>9</yel><yel>+</yel> 等。
`h.o ` | 匹配 <yel>hoo</yel><yel>h2o</yel><yel>h/o</yel> 等。 `h.o` | 匹配 <yel>hoo</yel><yel>h2o</yel><yel>h/o</yel> 等。
`ring\? ` | 匹配 <yel>ring?</yel> `ring\?` | 匹配 <yel>ring?</yel>
`\(quiet\) ` | 匹配<yel>(安静)</yel> `\(quiet\)` | 匹配<yel>(安静)</yel>
`c:\\windows ` | 匹配 <yel>c:\windows</yel> `c:\\windows` | 匹配 <yel>c:\windows</yel>
使用 `\` 搜索这些特殊字符:<br> `[ \ ^ $ . | ? * + ( ) { }` 使用 `\` 搜索这些特殊字符:<br> `[ \ ^ $ . | ? * + ( ) { }`
### 速记类 ### 速记类
范例 | 说明 范例 | 说明
:-|- :-|-
`\w ` | “单词”字符 <br> _(字母、数字或下划线)_ `\w` | “单词”字符 <br> _(字母、数字或下划线)_
`\d ` | 数字 `\d` | 数字
`\s ` | 空格 <br> _(空格、制表符、vtab、换行符)_ `\s` | 空格 <br> _(空格、制表符、vtab、换行符)_
`\W, \D, or \S ` | 不是单词、数字或空格 `\W, \D, or \S` | 不是单词、数字或空格
`[\D\S] ` | 表示不是数字或空格,两者都匹配 `[\D\S]` | 表示不是数字或空格,两者都匹配
`[^\d\s] ` | 禁止数字和空格 `[^\d\s]` | 禁止数字和空格
### 出现次数 ### 出现次数
@ -311,9 +307,9 @@ RegEX 备忘清单
范例 | 说明 范例 | 说明
:-|- :-|-
`cat\|dog ` | 匹配 <yel>cat</yel><yel>dog</yel> `cat\|dog` | 匹配 <yel>cat</yel><yel>dog</yel>
`id\|identity ` | 匹配 <yel>id</yel><yel>id</yel>entity `id\|identity` | 匹配 <yel>id</yel><yel>id</yel>entity
`identity\|id ` | 匹配 <yel>id</yel><yel>identity</yel> `identity\|id` | 匹配 <yel>id</yel><yel>identity</yel>
当替代品重叠时,命令从长到短 当替代品重叠时,命令从长到短
@ -334,7 +330,7 @@ RegEX 备忘清单
范例 | 说明 范例 | 说明
:-|- :-|-
`* + {n,}`<br>_greedy_ | 尽可能匹配 `* + {n,}`<br>_greedy_ | 尽可能匹配
`<.+> ` | 在 <yel>\<b>bold\<\/b></yel> 中找到 1 个大匹配项 `<.+>` | 在 <yel>\<b>bold\<\/b></yel> 中找到 1 个大匹配项
`*? +? {n,}?`<br>_lazy_ | 尽可能少匹配 `*? +? {n,}?`<br>_lazy_ | 尽可能少匹配
`<.+?>` | 在 \<<yel>b</yel>>bold\<<yel>\/b</yel>> 中找到 2 个匹配项 `<.+?>` | 在 \<<yel>b</yel>>bold\<<yel>\/b</yel>> 中找到 2 个匹配项
@ -343,18 +339,17 @@ RegEX 备忘清单
范例 | 说明 范例 | 说明
:-|- :-|-
`\b ` | “单词”边缘(非“单词”字符旁边) `\b` | “单词”边缘(非“单词”字符旁边)
`\bring ` | 单词以“ring”开头例如 <yel>ringtone</yel> `\bring` | 单词以“ring”开头例如 <yel>ringtone</yel>
`ring\b ` | 单词以“ring”结尾例如 <yel>spring</yel> `ring\b` | 单词以“ring”结尾例如 <yel>spring</yel>
`\b9\b ` | 匹配单个数字 <yel>9</yel>,而不是 19、91、99 等。 `\b9\b` | 匹配单个数字 <yel>9</yel>,而不是 19、91、99 等。
`\b[a-zA-Z]{6}\b ` | 匹配 6 个字母的单词 `\b[a-zA-Z]{6}\b` | 匹配 6 个字母的单词
`\B ` | 不是字边 `\B` | 不是字边
`\Bring\B ` | 匹配 <yel>springs</yel><yel>wringer</yel> `\Bring\B` | 匹配 <yel>springs</yel><yel>wringer</yel>
`^\d*$ ` | 整个字符串必须是数字 `^\d*$` | 整个字符串必须是数字
`^[a-zA-Z]{4,20}$` | 字符串必须有 4-20 个字母 `^[a-zA-Z]{4,20}$` | 字符串必须有 4-20 个字母
`^[A-Z] ` | 字符串必须以大写字母开头 `^[A-Z]` | 字符串必须以大写字母开头
`[\.!?"')]$ ` | 字符串必须以终端标点结尾 `[\.!?"')]$` | 字符串必须以终端标点结尾
### 修饰 ### 修饰
@ -371,7 +366,7 @@ RegEX 备忘清单
范例 | 说明 范例 | 说明
:-|- :-|-
`(in\|out)put ` | 匹配 <yel>input</yel><yel>output</yel> `(in\|out)put` | 匹配 <yel>input</yel><yel>output</yel>
`\d{5}(-\d{4})?` | 美国邮政编码 _(“+ 4”可选)_ `\d{5}(-\d{4})?` | 美国邮政编码 _(“+ 4”可选)_
如果组后匹配失败,解析器会尝试每个替代方案。 如果组后匹配失败,解析器会尝试每个替代方案。
@ -417,11 +412,10 @@ RegEX 备忘清单
`(?<! )` | 向后看,如果你找不到后面 `(?<! )` | 向后看,如果你找不到后面
`\b\w+?(?=ing\b)` | 匹配 <yel>warbl</yel>ing, <yel>str</yel>ing, <yel>fish</yel>ing, ... `\b\w+?(?=ing\b)` | 匹配 <yel>warbl</yel>ing, <yel>str</yel>ing, <yel>fish</yel>ing, ...
`\b(?!\w+ing\b)\w+\b` | 不以“ing”结尾的单词 `\b(?!\w+ing\b)\w+\b` | 不以“ing”结尾的单词
`(?<=\bpre).*?\b ` | 匹配 pre<yel>tend</yel>、pre<yel>sent</yel>、pre<yel>fix</yel>、... `(?<=\bpre).*?\b` | 匹配 pre<yel>tend</yel>、pre<yel>sent</yel>、pre<yel>fix</yel>、...
`\b\w{3}(?<!pre)\w*?\b` | 不以“pre”开头的词 `\b\w{3}(?<!pre)\w*?\b` | 不以“pre”开头的词
`\b\w+(?<!ing)\b` | 匹配不以“ing”结尾的单词 `\b\w+(?<!ing)\b` | 匹配不以“ing”结尾的单词
### If-then-else ### If-then-else
匹配 `Mr.``Ms.` 如果单词 `her` 稍后在字符串中 匹配 `Mr.``Ms.` 如果单词 `her` 稍后在字符串中
@ -664,7 +658,6 @@ Python 中的正则表达式
import re import re
``` ```
### 实例 ### 实例
<!--rehype:wrap-class=col-span-2 row-span-3--> <!--rehype:wrap-class=col-span-2 row-span-3-->
@ -736,11 +729,8 @@ False
`re.compile` | 编译正则表达式模式供以后使用 `re.compile` | 编译正则表达式模式供以后使用
`re.escape` | 返回所有非字母数字反斜杠的字符串 `re.escape` | 返回所有非字母数字反斜杠的字符串
### Flags 标志 ### Flags 标志
:- | - | - :- | - | -
:- | - | - :- | - | -
`re.I` | `re.IGNORECASE` | 忽略大小写 `re.I` | `re.IGNORECASE` | 忽略大小写
@ -750,8 +740,6 @@ False
`re.U` | `re.UNICODE` | 使 `\w``\b``\d``\s` _unicode 依赖_ `re.U` | `re.UNICODE` | 使 `\w``\b``\d``\s` _unicode 依赖_
`re.X` | `re.VERBOSE` | 可读风格 `re.X` | `re.VERBOSE` | 可读风格
JavaScript 中的正则表达式 JavaScript 中的正则表达式
--------------- ---------------
@ -894,14 +882,12 @@ text.replaceAll(regex, "mangoes");
``` ```
<!--rehype:className=wrap-text--> <!--rehype:className=wrap-text-->
PHP中的正则表达式 PHP中的正则表达式
------------ ------------
### 函数 ### 函数
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
:- | - :- | -
:- | - :- | -
`preg_match()` | 执行正则表达式匹配 `preg_match()` | 执行正则表达式匹配
@ -911,7 +897,6 @@ PHP中的正则表达式
`preg_split()` | 按正则表达式模式拆分字符串 `preg_split()` | 按正则表达式模式拆分字符串
`preg_grep()` | 返回与模式匹配的数组条目 `preg_grep()` | 返回与模式匹配的数组条目
### preg_replace ### preg_replace
```php ```php
@ -923,7 +908,6 @@ echo preg_replace($regex, "QuickRef", $str);
``` ```
<!--rehype:className=wrap-text--> <!--rehype:className=wrap-text-->
### preg_match ### preg_match
```php ```php
@ -933,7 +917,6 @@ $regex = "#quickref#i";
echo preg_match($regex, $str); echo preg_match($regex, $str);
``` ```
### preg_matchall ### preg_matchall
<!--rehype:wrap-class=col-span-2 row-span-2--> <!--rehype:wrap-class=col-span-2 row-span-2-->
@ -952,7 +935,6 @@ if (preg_match_all($regex, $input_str, $matches_out)) {
} }
``` ```
### preg_grep ### preg_grep
```php ```php
@ -962,7 +944,6 @@ $regex = "/Jane/";
echo preg_grep($regex, $arr); echo preg_grep($regex, $arr);
``` ```
### preg_split ### preg_split
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
@ -973,7 +954,6 @@ $regex = "@\s@";
print_r(preg_split($regex, $str)); print_r(preg_split($regex, $str));
``` ```
Java 中的正则表达式 Java 中的正则表达式
------------- -------------
@ -1003,10 +983,8 @@ boolean s3 = Pattern.matches(".s", "XXXX");
System.out.println(s3); // Outputs: false System.out.println(s3); // Outputs: false
``` ```
### 模式字段 ### 模式字段
:- | - :- | -
:- | - :- | -
`CANON_EQ` | 规范等价 `CANON_EQ` | 规范等价
@ -1017,7 +995,6 @@ System.out.println(s3); // Outputs: false
`UNICODE_CASE` | Unicode 感知大小写折叠 `UNICODE_CASE` | Unicode 感知大小写折叠
`UNIX_LINES` | Unix 行模式 `UNIX_LINES` | Unix 行模式
### 方法 ### 方法
#### Pattern #### Pattern
@ -1043,7 +1020,6 @@ System.out.println(s3); // Outputs: false
还有更多方法... 还有更多方法...
### 例子 ### 例子
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
@ -1073,7 +1049,6 @@ while (m.find()) {
System.out.println(matches); System.out.println(matches);
``` ```
MySQL中的正则表达式 MySQL中的正则表达式
------------- -------------
<!--rehype:body-class=cols-2--> <!--rehype:body-class=cols-2-->
@ -1082,15 +1057,14 @@ MySQL中的正则表达式
函数名称 | 说明 函数名称 | 说明
:- | - :- | -
`REGEXP ` | 字符串是否匹配正则表达式 `REGEXP` | 字符串是否匹配正则表达式
`REGEXP_INSTR() ` | 匹配正则表达式的子字符串的起始索引 <br>_注意仅限 MySQL 8.0+_ `REGEXP_INSTR()` | 匹配正则表达式的子字符串的起始索引 <br>_注意仅限 MySQL 8.0+_
`REGEXP_LIKE() ` | 字符串是否匹配正则表达式 <br>_(注意:仅 MySQL 8.0+)_ `REGEXP_LIKE()` | 字符串是否匹配正则表达式 <br>_(注意:仅 MySQL 8.0+)_
`REGEXP_REPLACE()` | 替换匹配正则表达式的子字符串 <br>_注意仅限 MySQL 8.0+_ `REGEXP_REPLACE()` | 替换匹配正则表达式的子字符串 <br>_注意仅限 MySQL 8.0+_
`REGEXP_SUBSTR() ` | 返回匹配正则表达式的子字符串 <br>_(注意:仅 MySQL 8.0+)_ `REGEXP_SUBSTR()` | 返回匹配正则表达式的子字符串 <br>_(注意:仅 MySQL 8.0+)_
### REGEXP ### REGEXP
```sql ```sql
expr REGEXP pat expr REGEXP pat
``` ```
@ -1107,7 +1081,6 @@ mysql> SELECT 'a' REGEXP 'A', 'a' REGEXP BINARY 'A';
1 0 1 0
``` ```
### REGEXP_REPLACE ### REGEXP_REPLACE
``` ```
@ -1123,7 +1096,6 @@ mysql> SELECT REGEXP_REPLACE('abc ghi', '[a-z]+', 'X', 1, 2);
abc X abc X
``` ```
### REGEXP_SUBSTR ### REGEXP_SUBSTR
``` ```
@ -1139,7 +1111,6 @@ mysql> SELECT REGEXP_SUBSTR('abc def ghi', '[a-z]+', 1, 3);
ghi ghi
``` ```
### REGEXP_LIKE ### REGEXP_LIKE
``` ```
@ -1161,7 +1132,6 @@ mysql> SELECT regexp_like('a\nb\nc', '^b$', 'm');
1 1
``` ```
### REGEXP_INSTR ### REGEXP_INSTR
``` ```

View File

@ -133,7 +133,6 @@ Resolutions 备忘清单
| Xiaomi Redmi Note 8 Pro (2019) | 6.53 <sub>inch</sub> | 1080 x 2340 <sub>px</sub> | 393 x 851 <sub>px</sub> | 395 <sub>ppi</sub> | 144 <sub>ppi</sub> | 2.75 <sub>xxhdpi</sub> | Android 9.0 | | Xiaomi Redmi Note 8 Pro (2019) | 6.53 <sub>inch</sub> | 1080 x 2340 <sub>px</sub> | 393 x 851 <sub>px</sub> | 395 <sub>ppi</sub> | 144 <sub>ppi</sub> | 2.75 <sub>xxhdpi</sub> | Android 9.0 |
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 平板 ### 平板
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->
@ -159,7 +158,6 @@ Resolutions 备忘清单
| Google Pixel C (2015) | 10.2 <sub>inch</sub> | 2560x1800 <sub>px</sub> | 1280 x 900 <sub>px</sub> | 308 <sub>ppi</sub> | 154 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | Android 6.0.1 | | Google Pixel C (2015) | 10.2 <sub>inch</sub> | 2560x1800 <sub>px</sub> | 1280 x 900 <sub>px</sub> | 308 <sub>ppi</sub> | 154 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | Android 6.0.1 |
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 笔记本电脑 ### 笔记本电脑
<!--rehype:wrap-class=col-span-3--> <!--rehype:wrap-class=col-span-3-->

View File

@ -446,7 +446,6 @@ defined? PI
### 数据类型 ### 数据类型
<!--rehype:wrap-class=col-span-2 row-span-3--> <!--rehype:wrap-class=col-span-2 row-span-3-->
类型 | 示例 | Class | 文档 类型 | 示例 | Class | 文档
:-- | -- | -- | -- :-- | -- | -- | --
`Integer` | a = 17 | a.class > Integer <br>a.class.superclass > Numeric | [#][2] `Integer` | a = 17 | a.class > Integer <br>a.class.superclass > Numeric | [#][2]
@ -508,7 +507,6 @@ range.to_a
一些有用的方法 一些有用的方法
Method name | Output Method name | Output
:----------- | ----- :----------- | -----
`cover?` | `(1..5).cover?(5)` => `true` `cover?` | `(1..5).cover?(5)` => `true`
@ -518,6 +516,7 @@ Method name | Output
`eql?` | `((0..2).eql?(0..5)` => `false` `eql?` | `((0..2).eql?(0..5)` => `false`
### 在 Range 中使用 step ### 在 Range 中使用 step
```ruby ```ruby
(1..20).step(2) { |number| puts "#{number}"} (1..20).step(2) { |number| puts "#{number}"}
# 输出 # 输出
@ -533,7 +532,6 @@ Method name | Output
# 19 # 19
``` ```
条件结构 条件结构
--- ---
@ -543,6 +541,7 @@ Method name | Output
num = 2 num = 2
puts 'two' if num == 2 puts 'two' if num == 2
``` ```
如果条件为真,则执行代码 如果条件为真,则执行代码
### if elsif else 语句 ### if elsif else 语句
@ -719,7 +718,6 @@ eql? | `s = 'foo'` => `true` <br> `s.eql?('foo')` =>
\+ | `"sammy " + "shark"` => `"sammyshark"` | 返回 self 和给定的其他字符串的连接 \+ | `"sammy " + "shark"` => `"sammyshark"` | 返回 self 和给定的其他字符串的连接
\+ | `"sammy " + "shark"` => `"sammyshark"` | 返回 self 和给定的其他字符串的连接 \+ | `"sammy " + "shark"` => `"sammyshark"` | 返回 self 和给定的其他字符串的连接
方法 方法
--- ---
@ -802,6 +800,7 @@ Mobile = Class.new do
end end
Mobile.ring Mobile.ring
``` ```
```ruby ```ruby
Mobile = Class.new Mobile = Class.new
class << Mobile class << Mobile
@ -888,6 +887,7 @@ puts a
nil.nil? nil.nil?
# true # true
``` ```
您可以拥有自己的布尔方法 您可以拥有自己的布尔方法
```ruby ```ruby
@ -1097,7 +1097,6 @@ give_me_data p
proc 就像一个可以存储在变量中的块 proc 就像一个可以存储在变量中的块
### 任意参数 ### 任意参数
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -1441,7 +1440,6 @@ arr.uniq #=> [2, 5, 6, 556, 8, 9, 0, 123]
``` ```
<!--rehype:className=wrap-text--> <!--rehype:className=wrap-text-->
### 检查数组中是否存在值(`include` ### 检查数组中是否存在值(`include`
```ruby ```ruby
@ -1511,13 +1509,16 @@ sorted_primes = primes.sort
puts "#{sorted_primes}" puts "#{sorted_primes}"
# 输出 => [2, 3, 5, 7] # 输出 => [2, 3, 5, 7]
``` ```
or in-place sort or in-place sort
```ruby ```ruby
primes = [7, 2, 3, 5] primes = [7, 2, 3, 5]
primes.sort! primes.sort!
puts "#{primes}" puts "#{primes}"
# 输出 => [2, 3, 5, 7] # 输出 => [2, 3, 5, 7]
``` ```
```ruby ```ruby
planets = ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] planets = ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"]
planets.sort planets.sort
@ -1629,7 +1630,6 @@ primes.delete(5)
# [7, 2, 3] # [7, 2, 3]
``` ```
### each ### each
<!--rehype:wrap-class=row-span-3--> <!--rehype:wrap-class=row-span-3-->
@ -1754,6 +1754,7 @@ end
``` ```
<!--rehype:className=wrap-text--> <!--rehype:className=wrap-text-->
--- ---
```ruby ```ruby
a = 1 a = 1
star = '*' star = '*'
@ -1858,7 +1859,9 @@ data_sample = [2, 3, 5, 7]
# 17 # 17
# 19 # 19
``` ```
--- ---
```ruby ```ruby
19.step(1, -2) { |number| puts "#{number}"} 19.step(1, -2) { |number| puts "#{number}"}
# 输出 # 输出
@ -1894,6 +1897,7 @@ numbers.inject(:+)
# 输出 # 输出
# 10 # 10
``` ```
使用初始值和符号 使用初始值和符号
```ruby ```ruby
@ -2003,7 +2007,6 @@ p str #=> "sixth fifth fourth third second first "
布尔可枚举方法 布尔可枚举方法
--- ---
### 布尔可枚举方法 ### 布尔可枚举方法
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -2160,7 +2163,9 @@ while count >= 1
# while loop ends here # while loop ends here
end end
``` ```
输出 输出
``` ```
Ruby Cheatsheet Ruby Cheatsheet
Ruby Cheatsheet Ruby Cheatsheet
@ -2178,7 +2183,9 @@ for count in 1..5 do
puts text puts text
end end
``` ```
输出 输出
``` ```
Ruby Cheatsheet Ruby Cheatsheet
Ruby Cheatsheet Ruby Cheatsheet
@ -2201,7 +2208,9 @@ loop do
# ending of ruby do..while loop # ending of ruby do..while loop
end end
``` ```
输出 输出
``` ```
Ruby Cheatsheet Ruby Cheatsheet
``` ```
@ -2218,7 +2227,9 @@ until var == 11 do
# here loop ends # here loop ends
end end
``` ```
输出 输出
``` ```
70 70
80 80
@ -2403,6 +2414,7 @@ true
a.instance_of? Numeric a.instance_of? Numeric
false false
``` ```
如果对象是给定类的实例,而不是子类或超类,则返回 true 如果对象是给定类的实例,而不是子类或超类,则返回 true
### 打印一个类的所有方法名 ### 打印一个类的所有方法名
@ -2412,7 +2424,9 @@ puts (String.methods).sort
# 排除从 Object 类继承的方法 # 排除从 Object 类继承的方法
puts (String.methods - Object.public_instance_methods).sort puts (String.methods - Object.public_instance_methods).sort
``` ```
### 检查一个类是否有特定的方法 ### 检查一个类是否有特定的方法
```ruby ```ruby
String.respond_to?(:prepend) String.respond_to?(:prepend)
true true
@ -2420,16 +2434,12 @@ String.respond_to?(:append)
false false
``` ```
另见 另见
--- ---
- [Ruby 官网](https://www.ruby-lang.org/en/) _(ruby-lang.org)_ - [Ruby 官网](https://www.ruby-lang.org/en/) _(ruby-lang.org)_
- [Ruby Cheatsheet](https://github.com/lifeparticle/Ruby-Cheatsheet) _(github.com)_ - [Ruby Cheatsheet](https://github.com/lifeparticle/Ruby-Cheatsheet) _(github.com)_
[1]: https://ruby-doc.org/core-3.1.2/doc/keywords_rdoc.html
[2]: https://ruby-doc.org/core-3.1.2/Integer.html [2]: https://ruby-doc.org/core-3.1.2/Integer.html
[3]: https://ruby-doc.org/core-3.1.2/Float.html [3]: https://ruby-doc.org/core-3.1.2/Float.html
[4]: https://ruby-doc.org/core-3.1.2/String.html [4]: https://ruby-doc.org/core-3.1.2/String.html
@ -2440,4 +2450,3 @@ false
[9]: https://ruby-doc.org/core-3.1.2/Symbol.html [9]: https://ruby-doc.org/core-3.1.2/Symbol.html
[10]: https://ruby-doc.org/core-3.1.2/Range.html [10]: https://ruby-doc.org/core-3.1.2/Range.html
[11]: https://ruby-doc.org/core-3.1.2/NilClass.html [11]: https://ruby-doc.org/core-3.1.2/NilClass.html
[12]: https://ruby-doc.org/core-3.1.2/Exception.html

View File

@ -13,6 +13,7 @@ fn main() {
println!("Hello, World!"); println!("Hello, World!");
} }
``` ```
#### 编译运行 #### 编译运行
```shell ```shell
@ -226,6 +227,7 @@ println!("社区的名称是 {community_name},它有 {no_of_members} 个成员
└─────┴─────┴─────┴─────┴─────┴─────┘ └─────┴─────┴─────┴─────┴─────┴─────┘
0 1 2 3 4 5 0 1 2 3 4 5
``` ```
---- ----
```rust ```rust
@ -243,6 +245,7 @@ i0 | 1 | 2 | 3 | 4 | 5 | 6 |
i1 | 6 | 5 | 4 | 3 | 2 | 1 | i1 | 6 | 5 | 4 | 3 | 2 | 1 |
└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
``` ```
---- ----
```rust ```rust
@ -355,7 +358,7 @@ Rust 运算符
`e <= f` | `e` 小于或等于 `f` `e <= f` | `e` 小于或等于 `f`
`e >= f` | `e` 大于或等于 `f` `e >= f` | `e` 大于或等于 `f`
--------- ----
```rust ```rust
let (e, f) = (1, 100); let (e, f) = (1, 100);
@ -377,7 +380,7 @@ let not_equal_to = e != f; // => true
`a % b` | 通过与 `b` 相除得到 `a` 的余数 `a % b` | 通过与 `b` 相除得到 `a` 的余数
`a * b` | `a``b` 相乘 `a * b` | `a``b` 相乘
------ ----
```rust ```rust
let (a, b) = (4, 5); let (a, b) = (4, 5);
@ -399,7 +402,7 @@ let modulus: i32 = a % b; // => 4
`g << h` | 二进制左移 `g << h` | 二进制左移
`g >> h` | 二进制右移 `g >> h` | 二进制右移
----- ----
```rust ```rust
let (g, h) = (0x1, 0x2); let (g, h) = (0x1, 0x2);
@ -418,7 +421,7 @@ let left_shift = h << 4; // => 32
`c || d` | 要么是真的_(OR)_ `c || d` | 要么是真的_(OR)_
`!c` | `c` 为假 _(NOT)_ `!c` | `c` 为假 _(NOT)_
------ ----
```rust ```rust
let (c, d) = (true, false); let (c, d) = (true, false);
@ -498,7 +501,9 @@ if let["Apple", _] = arr2{
println!("也适用于 str 数组"); println!("也适用于 str 数组");
} }
``` ```
---- ----
```rust ```rust
let tuple_1 = ("India", 7, 90, 90.432); let tuple_1 = ("India", 7, 90, 90.432);
if let(_, 7, 9, 78.99) = tuple_1{ if let(_, 7, 9, 78.99) = tuple_1{
@ -744,7 +749,9 @@ let a_int = 90; // int
// int 到 float // int 到 float
let mut type_cast = (a_int as f64); let mut type_cast = (a_int as f64);
``` ```
------
----
```rust ```rust
let orginal: char = 'I'; let orginal: char = 'I';
// char 到 int => 73 // char 到 int => 73
@ -760,7 +767,9 @@ let mut foo = 4;
let mut borrowed_foo = &foo; let mut borrowed_foo = &foo;
println!("{borrowed_foo}"); println!("{borrowed_foo}");
``` ```
------
----
```rust ```rust
let mut bar = 3; let mut bar = 3;
let mut mutable_borrowed_bar = &mut bar; let mut mutable_borrowed_bar = &mut bar;
@ -791,7 +800,6 @@ println!("{a_number}");
这将产生错误,因为变量 `a_number` 的范围在大括号处结束 这将产生错误,因为变量 `a_number` 的范围在大括号处结束
另见 另见
-------- --------

View File

@ -156,7 +156,6 @@ h1 {
Sass 混合(Mixins) Sass 混合(Mixins)
------ ------
### 参数 ### 参数
```scss ```scss
@ -264,7 +263,7 @@ green($color)
blue($color) blue($color)
``` ```
--- ----
:- | :- :- | :-
:- | :- :- | :-

View File

@ -30,7 +30,6 @@ $ screen -ls
$ screen -r <name/pid> $ screen -r <name/pid>
``` ```
### 选项 ### 选项
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
@ -45,7 +44,6 @@ $ screen -r <name/pid>
`-X` | screen -X -S debug kill | 终止正在运行的会话 `-X` | screen -X -S debug kill | 终止正在运行的会话
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
### 进入 ### 进入
Command | Description Command | Description
@ -108,7 +106,6 @@ Command | Description
`Ctrl-A` `H` | 在屏幕会话中启用日志记录 `Ctrl-A` `H` | 在屏幕会话中启用日志记录
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 分屏 ### 分屏
Command | Description Command | Description
@ -121,7 +118,6 @@ Command | Description
`Ctrl-A` `Q` | 删除除当前区域之外的所有区域 `Ctrl-A` `Q` | 删除除当前区域之外的所有区域
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 滚动 ### 滚动
Command | Description Command | Description

View File

@ -109,7 +109,6 @@ $ sed 's/old/new/[flags]' [input-file]
| `I` | 搜索时忽略大小写 | | `I` | 搜索时忽略大小写 |
| `e` | 在命令行中替换并执行 | | `e` | 在命令行中替换并执行 |
### 循环命令 ### 循环命令
| Command | Description | | Command | Description |

View File

@ -75,9 +75,9 @@ Semver 备忘清单
| `1.2 - 2.3.0` | 是 `1.2.0 - 2.3.0` | | `1.2 - 2.3.0` | 是 `1.2.0 - 2.3.0` |
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
当右侧为部分(例如,`2.3`)时,假定缺失的部分为`x`(例如,` 2.3.x`)。 当右侧为部分(例如,`2.3`)时,假定缺失的部分为`x`(例如,`2.3.x`)。
如果左边是部分的(例如,`1.2`),则假定缺少的部分为`0`(例如,` 1.2.0`)。 如果左边是部分的(例如,`1.2`),则假定缺少的部分为`0`(例如,`1.2.0`)。
### 有效的语义版本 ### 有效的语义版本
<!--rehype:wrap-class=row-span-4--> <!--rehype:wrap-class=row-span-4-->
@ -142,7 +142,6 @@ Semver 备忘清单
1.1.2-prerelease+meta 1.1.2-prerelease+meta
``` ```
另见 另见
---- ----

View File

@ -22,7 +22,6 @@ Sketch 备忘清单
| `t` | (Text) 文本 | | `t` | (Text) 文本 |
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 类型 ### 类型
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -131,7 +130,6 @@ Sketch 备忘清单
| `Fn + ↓` | 选择下面的页面 | | `Fn + ↓` | 选择下面的页面 |
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
另见 另见
---- ----

View File

@ -99,7 +99,6 @@ $ scp user@server:/dir/* .
`~/.ssh/known_hosts` | 登录主机 `~/.ssh/known_hosts` | 登录主机
`~/.ssh/authorized_keys` | 授权登录密钥 `~/.ssh/authorized_keys` | 授权登录密钥
### SCP 选项 ### SCP 选项
选项 | 说明 选项 | 说明
@ -111,7 +110,6 @@ scp `-P` 8080 | 使用特定端口
scp `-B` | 批处理模式_防止密码_ scp `-B` | 批处理模式_防止密码_
scp `-p` | 保留时间和模式 scp `-p` | 保留时间和模式
### 配置示例 ### 配置示例
```toml ```toml
@ -148,7 +146,6 @@ $ ssh -J user@proxy_host1:port1,user@proxy_host2:port2 user@remote_host3
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
### ssh-copy-id ### ssh-copy-id
```shell ```shell
@ -229,7 +226,6 @@ $ ssh-keygen -p -f ~/.ssh/id_rsa
- dsa - dsa
- ecdsa - ecdsa
### known_hosts ### known_hosts
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->

View File

@ -3,7 +3,6 @@ styled-components 备忘清单
此快速参考备忘单提供了使用 CSS in JS 工具的各种方法。 此快速参考备忘单提供了使用 CSS in JS 工具的各种方法。
入门 入门
---- ----
@ -29,6 +28,7 @@ import styled from 'styled-components';
``` ```
创建一个 Title 组件 创建一个 Title 组件
```jsx ```jsx
// 该组件将呈现具有样式的 <h1> 标签 // 该组件将呈现具有样式的 <h1> 标签
const Title = styled.h1` const Title = styled.h1`
@ -236,7 +236,6 @@ const Demo = () => (
); );
``` ```
### 样式对象 ### 样式对象
```jsx {2,5} ```jsx {2,5}

View File

@ -84,6 +84,7 @@ h5 {
} }
``` ```
<!-- markdownlint-disable MD051 -->
另见:下面[Mixins](#混合-Mixins) 另见:下面[Mixins](#混合-Mixins)
### 变量 Variables ### 变量 Variables
@ -388,6 +389,7 @@ for i in 1..3
.text-{i} .text-{i}
font-size: lookup('font-size-' + i) font-size: lookup('font-size-' + i)
``` ```
### 定义检查 ### 定义检查
```stylus {1} ```stylus {1}

View File

@ -79,9 +79,9 @@ Sublime Text 备忘清单
快捷键 | 说明 快捷键 | 说明
:- | - :- | -
`⌘ P` | 去任何地方 `⌘ P` | 去任何地方
`⌘ G` | 转到行号 `⌘ G` | 转到行号
`⌘ R` | 转到符号 `⌘ R` | 转到符号
`⌘ P, :` | 转到行号(`:`之后输入数字) `⌘ P, :` | 转到行号(`:`之后输入数字)
`⌘ P, #` | 转到并列出字符串模糊匹配(`#`之后输入字符) `⌘ P, #` | 转到并列出字符串模糊匹配(`#`之后输入字符)
`⌘ P, @` | 转到并列出符号(`@`之后开始输入符号名称) `⌘ P, @` | 转到并列出符号(`@`之后开始输入符号名称)

View File

@ -34,11 +34,11 @@ var price: Double = 8.99
### 算术运算符 ### 算术运算符
<!--rehype:wrap-class=row-span-3--> <!--rehype:wrap-class=row-span-3-->
- `+` 添加 - `+` 添加
- `-` 减法 - `-` 减法
- `*` 乘法 - `*` 乘法
- `/` 分配 - `/` 分配
- `%` 余数 - `%` 余数
<!--rehype:className=cols-5 style-none--> <!--rehype:className=cols-5 style-none-->
---- ----
@ -444,7 +444,7 @@ switch num {
// 打印: 7 奇数 // 打印: 7 奇数
``` ```
### 逻辑运算符 ### 逻辑运算符
```swift ```swift
!true // false !true // false
@ -480,6 +480,7 @@ false || false // false
```swift ```swift
false || true && false // false false || true && false // false
``` ```
`true && false` 首先计算返回 `false` 然后,表达式,`false` || `false` 评估并返回最终结果 `false` `true && false` 首先计算返回 `false` 然后,表达式,`false` || `false` 评估并返回最终结果 `false`
### 控制执行顺序 ### 控制执行顺序
@ -1431,9 +1432,9 @@ enum Dessert {
let customerOrder: Dessert = .cake(flavor: "红色天鹅绒") let customerOrder: Dessert = .cake(flavor: "红色天鹅绒")
switch customerOrder { switch customerOrder {
case let .cake(flavor): case let .cake(flavor):
print("你点了一个 \(flavor) 蛋糕") print("你点了一个 \(flavor) 蛋糕")
case .brownie: case .brownie:
print("你点了一块巧克力蛋糕") print("你点了一块巧克力蛋糕")
} }
// 打印: "你点了一个红色天鹅绒蛋糕" // 打印: "你点了一个红色天鹅绒蛋糕"
``` ```
@ -1521,7 +1522,7 @@ enum ShirtSize: String {
case medium = "M" case medium = "M"
case large = "L" case large = "L"
case extraLarge = "XL" case extraLarge = "XL"
var description: String { var description: String {
return "这件衬衫尺码是 \(self.rawValue)" return "这件衬衫尺码是 \(self.rawValue)"
} }
} }

View File

@ -53,7 +53,7 @@ struct AlbumDetail: View {
- [Picker](#picker-选择控件) _(UISegmentedControl)_ - [Picker](#picker-选择控件) _(UISegmentedControl)_
- [Stepper](#stepper-执行语义递增和递减操作的控件) _(UIStepper)_ - [Stepper](#stepper-执行语义递增和递减操作的控件) _(UIStepper)_
- [DatePicker](#datepicker-日期控件) _(UIDatePicker)_ - [DatePicker](#datepicker-日期控件) _(UIDatePicker)_
- [Text](#text-文本) _(NSAttributedString)无等效项)_ - [Text](#text) _(NSAttributedString)无等效项)_
- [Map](#map-地图界面的视图) _(MapKit)_ - [Map](#map-地图界面的视图) _(MapKit)_
- [ProgressView](#progressview-进度视图) _(UIProgressView)_ - [ProgressView](#progressview-进度视图) _(UIProgressView)_
- [Shape](#shape) / [Rectangle](#shape) / [Circle](#shape) - [Shape](#shape) / [Rectangle](#shape) / [Circle](#shape)
@ -230,7 +230,6 @@ Map(coordinateRegion: $region,
文档 - [Map](https://developer.apple.com/documentation/mapkit/map) 文档 - [Map](https://developer.apple.com/documentation/mapkit/map)
Layout(布局) Layout(布局)
---- ----
@ -620,7 +619,6 @@ DatePicker("Maximum Date", selection: $selectedDate,
文档 - [DatePicker](https://developer.apple.com/documentation/swiftui/datepicker) 文档 - [DatePicker](https://developer.apple.com/documentation/swiftui/datepicker)
### Slider 滑动输入条 ### Slider 滑动输入条
用于从值的有界线性范围中选择一个值的控件。 用于从值的有界线性范围中选择一个值的控件。
@ -673,6 +671,7 @@ NavigationView {
} }
} }
``` ```
您可以使用 `.pickerStyle(WheelPickerStyle())` 覆盖样式。 您可以使用 `.pickerStyle(WheelPickerStyle())` 覆盖样式。
```swift ```swift
@ -1200,7 +1199,6 @@ struct SheetDetail: Identifiable {
文档 - [ActionSheet](https://developer.apple.com/documentation/swiftui/actionsheet) 文档 - [ActionSheet](https://developer.apple.com/documentation/swiftui/actionsheet)
另见 另见
--- ---

View File

@ -44,7 +44,6 @@ int3 = -21
integerRange = 64 integerRange = 64
``` ```
### 浮点数 ### 浮点数
```toml ```toml
@ -80,7 +79,7 @@ str2 = "You can \"quote\" me."
str3 = "Name\tJos\u00E9\nLoc\tSF." str3 = "Name\tJos\u00E9\nLoc\tSF."
``` ```
See: [Strings](#toml-strings) See: [Strings](#字符串)
### Table ### Table
@ -165,9 +164,9 @@ bar = 2
```toml ```toml
[table1] [table1]
foo = "bar" foo = "bar"
[table1.nested_table] [table1.nested_table]
baz = "bat" baz = "bat"
``` ```
### 类数组 ### 类数组
@ -186,16 +185,16 @@ text = "Love it!"
```json ```json
{ {
"comments" : [ "comments" : [
{ {
"author" : "Nate", "author" : "Nate",
"text" : "Great Article!" "text" : "Great Article!"
}, },
{ {
"author" : "Anonymous", "author" : "Anonymous",
"text" : "Love It!" "text" : "Love It!"
} }
] ]
} }
``` ```
@ -224,17 +223,18 @@ type = "pug"
[foo.bar.baz] [foo.bar.baz]
bat = "hi" bat = "hi"
``` ```
#### ↓ 等效的 JSON #### ↓ 等效的 JSON
```json ```json
{ {
"foo" : { "foo" : {
"bar" : { "bar" : {
"baz" : { "baz" : {
"bat" : "hi" "bat" : "hi"
} }
} }
} }
} }
``` ```
@ -263,6 +263,5 @@ animal = { type.name = "pug" }
- [Learn X in Y minutes](https://learnxinyminutes.com/docs/toml/) _(learnxinyminutes.com)_ - [Learn X in Y minutes](https://learnxinyminutes.com/docs/toml/) _(learnxinyminutes.com)_
- [Better TOML VSCode 插件](https://marketplace.visualstudio.com/items?itemName=bungcip.better-toml) _(visualstudio.com)_ - [Better TOML VSCode 插件](https://marketplace.visualstudio.com/items?itemName=bungcip.better-toml) _(visualstudio.com)_
- [INI 格式配置文件备忘清单](./ini.md) _(jaywcjlove.github.io)_ - [INI 格式配置文件备忘清单](./ini.md) _(jaywcjlove.github.io)_
- [YAML 格式配置文件备忘清单](./yaml.md) _(jaywcjlove.github.io)_ - [YAML 格式配置文件备忘清单](./yaml.md) _(jaywcjlove.github.io)_

View File

@ -240,7 +240,6 @@ type Data = typeof data
通过 typeof 运算符重用来自现有 JavaScript 运行时值的类型。 通过 typeof 运算符重用来自现有 JavaScript 运行时值的类型。
### 从函数返回类型 ### 从函数返回类型
```ts ```ts
@ -1077,11 +1076,9 @@ console.log(fiveToHex());
从 Type 中移除 this 参数。 如果 Type 没有显式声明此参数,则结果只是 Type。 否则,从 Type 创建一个不带此参数的新函数类型。 泛型被删除,只有最后一个重载签名被传播到新的函数类型中。 从 Type 中移除 this 参数。 如果 Type 没有显式声明此参数,则结果只是 Type。 否则,从 Type 创建一个不带此参数的新函数类型。 泛型被删除,只有最后一个重载签名被传播到新的函数类型中。
JSX JSX
---- ----
### JSX 介绍 ### JSX 介绍
JSX 规范是对 ECMAScript 的类似 XML 的语法扩展。 JSX 规范是对 ECMAScript 的类似 XML 的语法扩展。
@ -1233,7 +1230,6 @@ function NotAValidFactoryFunction() {
默认情况下,`JSX.ElementClass` 是 {},但可以对其进行扩展,以将 `JSX` 的使用限制为仅限于符合适当接口的类型。 默认情况下,`JSX.ElementClass` 是 {},但可以对其进行扩展,以将 `JSX` 的使用限制为仅限于符合适当接口的类型。
### 类组件 ### 类组件
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->

View File

@ -276,7 +276,6 @@ Vim 文本对象
### 用法 ### 用法
<!--rehype:style=background:#d7a100;--> <!--rehype:style=background:#d7a100;-->
快捷方式 | 说明 快捷方式 | 说明
:- | - :- | -
`v` | &nbsp; &nbsp; &nbsp; &nbsp; <pur>i</pur> _/_ <pur>a</pur> | <yel>p</yel> `v` | &nbsp; &nbsp; &nbsp; &nbsp; <pur>i</pur> _/_ <pur>a</pur> | <yel>p</yel>
@ -435,6 +434,7 @@ Vim 搜索和替换
```vim ```vim
:%s/{pattern}/{str}/[flags] :%s/{pattern}/{str}/[flags]
``` ```
--- ---
:- | - :- | -
@ -460,7 +460,7 @@ Vim 搜索和替换
`,3` | 接下来的 `3` `,3` | 接下来的 `3`
`-3,` | 转发 `3` `-3,` | 转发 `3`
### 全局命令 ### 全局命令
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
```vim ```vim
@ -516,7 +516,6 @@ Vim 搜索和替换
### 例子 ### 例子
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
```shell ```shell
:s/a\|b/xxx\0xxx/g # 将 "a b" 修改为 "xxxaxxx xxxbxxx" :s/a\|b/xxx\0xxx/g # 将 "a b" 修改为 "xxxaxxx xxxbxxx"
:s/test/\U& file/ # 将 "test" 修改为 "TEST FILE" :s/test/\U& file/ # 将 "test" 修改为 "TEST FILE"

View File

@ -61,11 +61,10 @@ VSCode 备忘清单
| `F8` | 转到下一个错误 | | `F8` | 转到下一个错误 |
| `Shift` `F8` | 转到上一个错误 | | `Shift` `F8` | 转到上一个错误 |
| `Ctrl` `Shift` `Tab` | 浏览编辑组历史 | | `Ctrl` `Shift` `Tab` | 浏览编辑组历史 |
| `Alt` ` ←` _/_ `→` | 后退/前进 | | `Alt` `←` _/_ `→` | 后退/前进 |
| `Ctrl` `M` | 切换 Tab 移动焦点 | | `Ctrl` `M` | 切换 Tab 移动焦点 |
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 搜索和替换 ### 搜索和替换
| - | - | | - | - |
@ -115,7 +114,6 @@ VSCode 备忘清单
| `Ctrl` `K` `M` | 更改文件语言 | | `Ctrl` `K` `M` | 更改文件语言 |
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 编辑管理 ### 编辑管理
| - | - | | - | - |
@ -123,7 +121,7 @@ VSCode 备忘清单
| `Ctrl` `F4` `Ctrl` `W` | 关闭编辑器 | | `Ctrl` `F4` `Ctrl` `W` | 关闭编辑器 |
| `Ctrl` `K` `F` | 关闭文件夹 | | `Ctrl` `K` `F` | 关闭文件夹 |
| `Ctrl` `\` | 拆分编辑器 | | `Ctrl` `\` | 拆分编辑器 |
| `Ctrl` ` 1` _/_ `2` _/_ `3` | 专注于第一、第二或第三编辑组 | | `Ctrl` `1` _/_ `2` _/_ `3` | 专注于第一、第二或第三编辑组 |
| `Ctrl` `K` `Ctrl` `←` _/_ `→` | 专注于上一个/下一个编辑组 | | `Ctrl` `K` `Ctrl` `←` _/_ `→` | 专注于上一个/下一个编辑组 |
| `Ctrl` `Shift` `PgUp` _/_ `PgDn` | 向左/向右移动编辑器 | | `Ctrl` `Shift` `PgUp` _/_ `PgDn` | 向左/向右移动编辑器 |
| `Ctrl` `K` `←` _/_ `→` | 移动活动编辑器组 | | `Ctrl` `K` `←` _/_ `→` | 移动活动编辑器组 |
@ -170,7 +168,6 @@ VSCode 备忘清单
| `Ctrl` `K` `Z` | Zen 模式Esc Esc 退出) | | `Ctrl` `K` `Z` | Zen 模式Esc Esc 退出) |
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 调试 ### 调试
| - | - | | - | - |

View File

@ -3,7 +3,6 @@ Vue 3 备忘清单
渐进式 JavaScript 框架 [Vue 3](https://cn.vuejs.org/) 备忘清单的快速参考列表,包含常用 API 和示例。 渐进式 JavaScript 框架 [Vue 3](https://cn.vuejs.org/) 备忘清单的快速参考列表,包含常用 API 和示例。
入门 入门
--- ---
@ -209,7 +208,6 @@ data() {
</span> </span>
``` ```
### 指令 Directives ### 指令 Directives
```html ```html

View File

@ -550,7 +550,6 @@ data: {
</ul> </ul>
``` ```
```js ```js
var example1 = new Vue({ var example1 = new Vue({
el: '#example-1', el: '#example-1',
@ -1195,6 +1194,7 @@ vm.selected.number // => 123
<!--rehype:wrap-class=row-span-3--> <!--rehype:wrap-class=row-span-3-->
- 将 `HTML`/`CSS`/`JS` 三部分存放到一个 `Hello.vue` 文件中 - 将 `HTML`/`CSS`/`JS` 三部分存放到一个 `Hello.vue` 文件中
```html ```html
<template> <template>
<p>{{ title }} World!</p> <p>{{ title }} World!</p>
@ -1222,7 +1222,9 @@ vm.selected.number // => 123
} }
</style> </style>
``` ```
- 使用 `Hello.vue` 组件 - 使用 `Hello.vue` 组件
```html ```html
<script> <script>
import Vue from "vue"; import Vue from "vue";
@ -1681,7 +1683,7 @@ Vue.component('alert-box', {
`leave-active-class` | [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#自定义过渡的类名) `leave-active-class` | [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#自定义过渡的类名)
`leave-to-class` _(2.1.8+)_ | [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#自定义过渡的类名) `leave-to-class` _(2.1.8+)_ | [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#自定义过渡的类名)
---- ---
```html ```html
<transition <transition
@ -2026,7 +2028,6 @@ Vue 2 API 参考
`v-on:click.passive` _(2.3.0)_ [#](https://v2.cn.vuejs.org/v2/api/#v-on) | 以 { passive: true } 模式添加侦听器 `v-on:click.passive` _(2.3.0)_ [#](https://v2.cn.vuejs.org/v2/api/#v-on) | 以 { passive: true } 模式添加侦听器
<!--rehype:className=style-list--> <!--rehype:className=style-list-->
### v-on (鼠标)修饰符 ### v-on (鼠标)修饰符
:- | :- :- | :-
@ -2052,7 +2053,7 @@ Vue 2 API 参考
:- | :- :- | :-
`v-on:keyup.enter` | [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符) `v-on:keyup.enter` | [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符)
`v-on:keyup.tab` | [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符) `v-on:keyup.tab` | [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符)
`v-on:keyup.delete ` | 捕获“删除”和“退格”键 [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符) `v-on:keyup.delete` | 捕获“删除”和“退格”键 [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符)
`v-on:keyup.esc` | [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符) `v-on:keyup.esc` | [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符)
`v-on:keyup.space` | [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符) `v-on:keyup.space` | [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符)
`v-on:keyup.up` | [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符) `v-on:keyup.up` | [#](https://v2.cn.vuejs.org/v2/guide/events.html#按键修饰符)

View File

@ -25,7 +25,6 @@ Xcode
`Cmd + {` | 下一个选项卡 `Cmd + {` | 下一个选项卡
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 导航 ### 导航
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -55,7 +54,6 @@ Xcode
`Cmd + K` | 清除控制台 `Cmd + K` | 清除控制台
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 导航器(左侧面板) ### 导航器(左侧面板)
快捷键 | 描述 快捷键 | 描述
@ -67,7 +65,6 @@ Xcode
`double click` | 在新窗口中打开 `double click` | 在新窗口中打开
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 编辑 ### 编辑
快捷键 | 描述 快捷键 | 描述
@ -83,8 +80,6 @@ Xcode
`Cmd + Option + ]` | 下移线 `Cmd + Option + ]` | 下移线
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 实用程序(右面板) ### 实用程序(右面板)
快捷键 | 描述 快捷键 | 描述
@ -93,7 +88,6 @@ Xcode
`Cmd + Option + 1-9` | 转到选项卡 `Cmd + Option + 1-9` | 转到选项卡
<!--rehype:className=shortcuts--> <!--rehype:className=shortcuts-->
### 调试和运行 ### 调试和运行
快捷键 | 描述 快捷键 | 描述

View File

@ -118,10 +118,9 @@ $x('//a[text()="XPath"]')[0].click()
### 运算符 ### 运算符
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
运算符 | 说明 | 示例
运算符 | 说明 | 示例
:- | - | - :- | - | -
`\|` | 计算两个节点集 | `//book \| //cd` `\|` | 计算两个节点集 | `//book \| //cd`
`+` | 添加 | `6 + 4` `+` | 添加 | `6 + 4`
`-` | 减法 | `6 - 4` `-` | 减法 | `6 - 4`
`*` | 乘法 | `6 * 4` `*` | 乘法 | `6 * 4`
@ -137,8 +136,6 @@ $x('//a[text()="XPath"]')[0].click()
`mod` | 模数(除法余数) | `5` mod `2` `mod` | 模数(除法余数) | `5` mod `2`
<!--rehype:className=show-header--> <!--rehype:className=show-header-->
XPath 表达式 XPath 表达式
----------- -----------
@ -149,7 +146,6 @@ XPath 表达式
| `//` | `ul` | `/` | `a[@id='link']` | | `//` | `ul` | `/` | `a[@id='link']` |
| Axis | Step | Axis | Step | | Axis | Step | Axis | Step |
### 前缀 ### 前缀
| 前缀 | 例子 | 意思是 | | 前缀 | 例子 | 意思是 |
@ -202,6 +198,7 @@ XPath Predicates(谓词)
//ul[count(li) > 2] //ul[count(li) > 2]
//ul[count(li[@class='hide']) > 0] //ul[count(li[@class='hide']) > 0]
``` ```
```bash ```bash
# 返回具有 `<li>` 子级的 `<ul>` # 返回具有 `<li>` 子级的 `<ul>`
//ul[li] //ul[li]
@ -251,6 +248,7 @@ text() # //button[text()="Submit"]
lang(str) lang(str)
namespace-uri() namespace-uri()
``` ```
```bash ```bash
count() # //table[count(tr)=1] count() # //table[count(tr)=1]
position() # //ol/li[position()=2] position() # //ol/li[position()=2]
@ -429,5 +427,5 @@ count(//*) # 计算所有元素
另见 另见
-------- --------
* [Devhints](https://devhints.io/xpath) _(devhints.io)_ - [Devhints](https://devhints.io/xpath) _(devhints.io)_
* [Xpath test bed](http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm) _(whitebeam.org)_ - [Xpath test bed](http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm) _(whitebeam.org)_

View File

@ -18,7 +18,6 @@ YAML 备忘清单
- Ansible playbook 是 YAML 文件 - Ansible playbook 是 YAML 文件
<!--rehype:className=style-round--> <!--rehype:className=style-round-->
### 标量类型 ### 标量类型
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -350,7 +349,6 @@ set2: !!set {'one', "two"}
集合表示为一个映射,其中每个键都与一个空值相关联 集合表示为一个映射,其中每个键都与一个空值相关联
### 有序映射 ### 有序映射
```yaml ```yaml
@ -450,7 +448,6 @@ YAML 参考
| `#` | 一次性评论指示器 | | `#` | 一次性评论指示器 |
| <code>\`@</code> | 两者都保留供将来使用 | | <code>\`@</code> | 两者都保留供将来使用 |
### 核心类型(默认自动标签) ### 核心类型(默认自动标签)
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -474,11 +471,12 @@ YAML 参考
- `\\` (\\) - `\\` (\\)
- `\"` (") - `\"` (")
- `\ ` ( ) - `\` ( )
- `\<TAB>` (TAB) - `\<TAB>` (TAB)
<!--rehype:className=cols-3 style-none--> <!--rehype:className=cols-3 style-none-->
#### C #### C
- `\0` (NUL) - `\0` (NUL)
- `\a` (BEL) - `\a` (BEL)
- `\b` (BS) - `\b` (BS)

View File

@ -394,7 +394,7 @@ yum list available --disablerepo=epel
yum install --downloadonly vsftpd yum install --downloadonly vsftpd
``` ```
--- ----
:- | - :- | -
:- | - :- | -

View File

@ -11,7 +11,7 @@
"build": "node scripts/build.mjs", "build": "node scripts/build.mjs",
"start": "node scripts/watch.mjs", "start": "node scripts/watch.mjs",
"prettier": "prettier --write '**/*.{mjs,css,json,prettierrc,lintstagedrc}'", "prettier": "prettier --write '**/*.{mjs,css,json,prettierrc,lintstagedrc}'",
"markdownlint": "markdownlint --fix ./docs" "markdownlint": "npx markdownlint-cli --fix ./docs/*.md"
}, },
"repository": { "repository": {
"type": "git", "type": "git",