diff --git a/docs/bash.html b/docs/bash.html index ab20d489..52233f5b 100644 --- a/docs/bash.html +++ b/docs/bash.html @@ -1,6 +1,6 @@ -
这是开始使用 linux bash shell 脚本的快速参考备忘单。
#!/bin/bash VAR="world" @@ -58,9 +60,9 @@ NAME = "John" # => Error (关于空间)
# 这是一个内联 Bash 注释。 -
: ' +# 这是一个内联 Bash 注释。 + +: ' 这是一个 非常整洁的评论 在 bash @@ -1130,6 +1132,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -1143,6 +1146,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/c.html b/docs/c.html index b9104e54..d631005d 100644 --- a/docs/c.html +++ b/docs/c.html @@ -1,6 +1,6 @@ - - - + + + C 备忘清单 & c cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ C 备忘清单 提供基本语法和方法的 C 快速参考备忘单。 -入门 + + +入门hello.c变量常量 Constants注释打印文本控制空格数字符串 Strings条件判断三元运算符SwitchWhile 循环Do/While 循环For 循环跳出循环 Break/ContinueWhile Break 示例While continue 示例数组 Arrays枚举 Enum枚举示例应用用户输入用户输入字符串内存地址创建指针指针变量取消引用运算符算术运算符赋值运算符比较运算符逻辑运算符运算符示例位运算符数据类型 Data Types基本数据类型数据类型基本格式说明符基本格式说明符数据格式示例预处理器预处理器指令预定义宏预定义宏示例宏延续运算符(\)字符串常量化运算符(#)标记粘贴运算符(##)defined() 运算符参数化的宏函数函数声明和定义调用函数函数参数多个参数返回值递归示例数学函数Structures 结构创建结构结构中的字符串访问结构成员复制结构修改值文件处理文件处理函数打开模式参数打开文件:fopen()写入文件:fprintf()读取文件:fscanf()写入文件:fputc()读取文件:fgetc()写入文件:fputs()读取文件:fgets()fseek()rewind()ftell()杂项Docker 运行环境另见入门 hello.c #include <stdio.h> @@ -1192,7 +1194,7 @@ }; int main() { - struct myStructure s1; + struct myStructure s1; return 0; } @@ -1205,7 +1207,7 @@ int main() { struct myStructure s1; - strcpy(s1.myString, "Some text"); + strcpy(s1.myString, "Some text"); // 打印值 printf("我字符串: %s", s1.myString); return 0; @@ -1224,12 +1226,12 @@ // 创建一个名为 s1 的 myStructure 结构变量 struct myStructure s1; // 为 s1 的成员赋值 - s1.myNum = 13; - s1.myLetter = 'B'; + s1.myNum = 13; + s1.myLetter = 'B'; // 创建一个名为 s2 的 myStructure 结构变量 // 并为其赋值 - struct myStructure s2 = {13, 'B'}; + struct myStructure s2 = {13, 'B'}; // 打印值 printf("My number: %d\n", s1.myNum); printf("My letter: %c\n", s1.myLetter); @@ -1252,7 +1254,7 @@ }; struct myStructure s2; -s2 = s1; +s2 = s1; 示例中,将 s1 的值复制到 s2 修改值 @@ -1261,8 +1263,8 @@ 13, 'B' }; // 修改值 -s1.myNum = 30; -s1.myLetter = 'C'; +s1.myNum = 30; +s1.myLetter = 'C'; // 打印值 printf("%d %c %s", s1.myNum, @@ -1390,7 +1392,7 @@ void main( ) { FILE *fp; char ch; - fp = fopen("file_handle.c", "r"); + fp = fopen("file_handle.c", "r"); while (1) { ch = fgetc(fp); @@ -1409,7 +1411,7 @@ FILE *fp; fp = fopen("file.txt", "w"); // 打开文件 // 将数据写入文件 - fprintf(fp, "fprintf 的 Hello 文件..\n"); + fprintf(fp, "fprintf 的 Hello 文件..\n"); fclose(fp); // 关闭文件 } @@ -1419,7 +1421,7 @@ FILE *fp; char buff[255]; // 创建char数组存储文件数据 fp = fopen("file.txt", "r"); - while(fscanf(fp, "%s", buff)!=EOF) { + while(fscanf(fp, "%s", buff)!=EOF) { printf("%s ", buff); } fclose(fp); @@ -1431,7 +1433,7 @@ main(){ FILE *fp; fp = fopen("file1.txt", "w"); // 打开文件 - fputc('a',fp); // 将单个字符写入文件 + fputc('a',fp); // 将单个字符写入文件 fclose(fp); // 关闭文件 } @@ -1443,7 +1445,7 @@ char c; clrscr(); fp=fopen("myfile.txt", "r"); - while((c=fgetc(fp))!=EOF){ + while((c=fgetc(fp))!=EOF){ printf("%c", c); } fclose(fp); @@ -1458,7 +1460,7 @@ FILE *fp; clrscr(); fp = fopen("myfile2.txt","w"); - fputs("hello c programming",fp); + fputs("hello c programming",fp); fclose(fp); getch(); } @@ -1473,7 +1475,7 @@ clrscr(); fp=fopen("myfile2.txt", "r"); - printf("%s", fgets(text, 200, fp)); + printf("%s", fgets(text, 200, fp)); fclose(fp); getch(); } @@ -1486,7 +1488,7 @@ fputs("This is Book", fp); // 将文件指针设置到给定位置 - fseek(fp, 7, SEEK_SET); + fseek(fp, 7, SEEK_SET); fputs("Kenny Wong", fp); fclose(fp); } @@ -1503,7 +1505,7 @@ while((c=fgetc(fp)) != EOF){ printf("%c", c); } - rewind(fp); // 将文件指针移动到文件的开头 + rewind(fp); // 将文件指针移动到文件的开头 while((c=fgetc(fp)) != EOF){ printf("%c", c); } @@ -1524,7 +1526,7 @@ fp = fopen("file.txt", "r"); fseek(fp, 0, SEEK_END); - length = ftell(fp); // 返回当前位置 + length = ftell(fp); // 返回当前位置 fclose(fp); printf("文件大小: %d bytes", length); @@ -1567,6 +1569,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -1580,6 +1583,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/chmod.html b/docs/chmod.html index 844bf6db..54209685 100644 --- a/docs/chmod.html +++ b/docs/chmod.html @@ -1,6 +1,6 @@ - - - + + + Chmod 备忘清单 & chmod cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -36,7 +36,9 @@ } Chmod 备忘清单 这份快速参考备忘单提供了文件权限的简要概述,以及 chmod 命令的操作 -入门 + + +入门语法示例递归更改文件和目录Chmod 生成器通用权限解释 的权限分析权限模式Objects权限文件类型Chmod 示例操作符chmod 600chmod 664chmod 777符号模式删除权限可执行文件chmod 754Chmod 实践SSH 权限网络权限批量更改另见入门 语法 $ chmod [options] <permissions> <file> @@ -51,10 +53,10 @@ chmod 命令代表“更改模式” Chmod 生成器 - -权限: - - +<div> +权限:<input type="text" id="num" placeholder="777" maxlength="3" style="padding: 0.3rem 0.3rem;" /> <input type="text" id="let" placeholder="rwxrwxrwx" maxlength="9" style="padding: 0.3rem 0.3rem;" /> +</div> + @@ -412,233 +414,234 @@ 使用 chmod 修改文件权限 (linode.com) - - - +<!-- Chmod 生成器 JS 代码 --> +<script type="text/javascript"> + const reg_num = /^[0-7]{3}$/; // 一些正则表达式来检查 num 输入 + const reg_let = /^([r\-]{1}[w\-]{1}[x\-]{1}){3}$/; // 一些正则表达式来检查文本输入 + function checkBoxHandle() { + change_occured(true, false, false); + // get rid of bad input classes + document.getElementById('num').classList.remove('bad-input'); + document.getElementById('let').classList.remove('bad-input'); + } + window.addEventListener("DOMContentLoaded", function () { + // loop over all the check boxes + for (let i = 1; i < 10; i++) { + let checkBox = document.getElementById(`${i}`); + checkBox.addEventListener('change', function () { + change_occured(true, false, false); + + // get rid of bad input classes + document.getElementById('num').classList.remove('bad-input'); + + document.getElementById('let').classList.remove('bad-input'); + }); + } + // the octal input + let num_input = document.getElementById('num'); + let num_fn = function () { + // check for bad input + if (!reg_num.test(this.value)) { + this.classList.add('bad-input'); + } else { + this.classList.remove('bad-input'); + change_occured(false, true, false); + } + }; + num_input.addEventListener('change', num_fn); + num_input.addEventListener('keyup', num_fn); + // the let input + let let_input = document.getElementById('let'); + let let_fn = function () { + // check for bad input + if (!reg_let.test(this.value)) { + this.classList.add('bad-input'); + } else { + this.classList.remove('bad-input'); + change_occured(false, false, true); + } + }; + let_input.addEventListener('change',let_fn); + let_input.addEventListener('keyup',let_fn); + }); + /* SETUP + r-4-1 r-4-4 r-4-7 + w-2-2 w-2-5 w-2-8 + x-1-3 x-1-6 x-1-9 + */ + // define a function that runs when a change occures + function change_occured(caller_was_check, caller_was_num, caller_was_let) { + let num1 = 0, num2 = 0, num3 = 0; // these are the three numbers for the octal + let perm_string = ''; // holds the permision string ex. rw-x--r-- + if (caller_was_check) { + // loop over all the check boxes and get the permisions + for (let i = 1; i < 10; i++) { + let checkBox = document.getElementById(`${i}`); + if (checkBox.checked) { // if checked + let current_perm = check_to_octal_and_text(i); + perm_string += `${current_perm.perm_let}`; + if (i <= 3) { + num1 += current_perm.perm_num; + } else if (i <= 6) { + num2 += current_perm.perm_num; + } else { + num3 += current_perm.perm_num; + } + } else { // if not checked + perm_string += '-'; + } + } + // set the permision input text + document.getElementById('let').value = perm_string; + document.getElementById('num').value = `${num1}${num2}${num3}`; + } else if (caller_was_num) { + // get the individual numbers + let num_input_val = document.getElementById('num').value; + num1 = num_input_val.substring(0, 1); + num2 = num_input_val.substring(1, 2); + num3 = num_input_val.substring(2, 3); + // set the checkboxes and get the perm string + perm_string += octal_to_check_and_txt(num1, 0); //Owner + perm_string += octal_to_check_and_txt(num2, 1); //Owner + perm_string += octal_to_check_and_txt(num3, 2); //Owner + // set the permision input text + document.getElementById('let').value = perm_string; + } else if (caller_was_let) { + // get the text input + let perm_text = document.getElementById('let').value; + num1 = text_to_check_and_octal(perm_text.substring(0, 3), 0) + num2 = text_to_check_and_octal(perm_text.substring(3, 6), 3) + num3 = text_to_check_and_octal(perm_text.substring(6, 9), 6) + // set the octal value + document.getElementById('num').value = `${num1}${num2}${num3}`; + } + } + // define a function to converts the checkbox # to the respective permissions + // returns perm_num, perm_let + function check_to_octal_and_text(check_num) { + let perm_num = 0; + let perm_let = '-'; + switch (check_num) { + case 1: + case 4: + case 7: + perm_num = 4; + perm_let = 'r'; + break; + case 2: + case 5: + case 8: + perm_num = 2; + perm_let = 'w'; + break; + case 3: + case 6: + case 9: + perm_num = 1; + perm_let = 'x'; + break; + default: + perm_num = 0; + perm_let = '-'; + } + // return values + return { + perm_num, + perm_let + }; + } + /** + Takes a number 1-7 and which class it is in: + 0 = owner + 1 = Group + 2 = Public + Returns: perm text (ex. "rwx") and sets the appropriate checkboxes + */ + function octal_to_check_and_txt(octal_num, class_num) { + let perm_text = ''; + let offset = class_num * 3; + switch (octal_num) { + case '1': + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = '--x'; + break; + case '2': + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = '-w-'; + break; + case '3': + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = '-wx'; + break; + case '4': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = 'r--'; + break; + case '5': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = 'r-x'; + break; + case '6': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = 'rw-'; + break; + case '7': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = 'rwx'; + break; + default: + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = '---'; + } + return perm_text; + } + /** + Takes 3 letters (r, w, x, - ex. 'rw-') and an offset (0,3,6) + Returns the octal num and sets the appropriate checkboxes + */ + function text_to_check_and_octal(letters, offset) { + let perm_num = 0; // the octal number to return + // add up the oct num and set the check boxes + for (let i = 0; i < 3; i++) { + current_let = letters.substring(i, i + 1); + if (current_let == 'r') { + document.getElementById(`${i + 1 + offset}`).checked = true; + perm_num += 4; + } else if (current_let == 'w') { + document.getElementById(`${i + 1 + offset}`).checked = true; + perm_num += 2; + } else if (current_let == 'x') { + document.getElementById(`${i + 1 + offset}`).checked = true; + perm_num += 1; + } else { + document.getElementById(`${i + 1 + offset}`).checked = false; + } + } + return perm_num; + } +</script> + - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/colors-named.html b/docs/colors-named.html index 75b69829..9a5acca0 100644 --- a/docs/colors-named.html +++ b/docs/colors-named.html @@ -1,6 +1,6 @@ - - - + + + Colors Named 备忘清单 & colors-named cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Colors Named 备忘清单 CSS 定义了一大组命名颜色,以便可以更轻松地编写和阅读常用颜色,这里列出了它的颜色名称/Hex rgb/十进制 rgb 数据 -Named Colors + + +Named Colors颜色列表HSL 颜色示例0° Reds30° Reds-Yellows (=Oranges)60° Yellows90° Yellow-Greens120° Greens150° Green-Cyans180° Cyans210° Cyan-Blues240° blues270° Blue-Magentas300° Magentas330° Magenta-Reds另见Named Colors 颜色列表 @@ -947,7 +949,7 @@ 0° Reds - + @@ -1064,7 +1066,7 @@ 30° Reds-Yellows (=Oranges) - + @@ -1181,7 +1183,7 @@ 60° Yellows - + @@ -1298,7 +1300,7 @@ 90° Yellow-Greens - + @@ -1415,7 +1417,7 @@ 120° Greens - + @@ -1532,7 +1534,7 @@ 150° Green-Cyans - + @@ -1649,7 +1651,7 @@ 180° Cyans - + @@ -1766,7 +1768,7 @@ 210° Cyan-Blues - + @@ -1883,7 +1885,7 @@ 240° blues - + @@ -2000,7 +2002,7 @@ 270° Blue-Magentas - + @@ -2117,7 +2119,7 @@ 300° Magentas - + @@ -2234,7 +2236,7 @@ 330° Magenta-Reds - + @@ -2358,6 +2360,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -2371,6 +2374,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/cron.html b/docs/cron.html index 4bbb2a1b..55ab6d45 100644 --- a/docs/cron.html +++ b/docs/cron.html @@ -1,6 +1,6 @@ - - - + + + Cron 备忘清单 & cron cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Cron 备忘清单 Cron 最适合安排重复性任务。 可以使用关联的 at 实用程序来完成一次性任务的调度。 -Crontab 格式 + + +Crontab 格式格式示例特殊字符串Crontab 命令特殊字符Also seeCrontab 格式 格式 Min Hour Day Mon Weekday @@ -90,7 +92,7 @@ -字段范围特殊字符分钟 Minute0 - 59, - * /小时 Hour0 - 23, - * /月份中的某天1 - 31, - * ? / L W月 Month1 - 12, - * /星期几0 - 6, - * ? / L # +字段范围特殊字符分钟 Minute0 - 59, - * /小时 Hour0 - 23, - * /月份中的某天1 - 31, - * ? / L W月 Month1 - 12, - * /星期几0 - 6, - * ? / L # 示例 @@ -193,7 +195,7 @@ -特殊字符串意义@reboot运行一次,在系统启动时 (非标准)@yearly每年运行一次,“0 0 1 1 *” (非标准)@annually(与@yearly 相同)(非标准)@monthly每月运行一次,“0 0 1 * *” (非标准)@weekly每周运行一次,“0 0 * * 0” (非标准)@daily每天运行一次,“0 0 * * *” (非标准)@midnight(与@daily 相同)(非标准)@hourly每小时运行一次,“0 * * * *” (非标准) +特殊字符串意义@reboot运行一次,在系统启动时 (非标准)@yearly每年运行一次,“0 0 1 1 *” (非标准)@annually(与@yearly 相同)(非标准)@monthly每月运行一次,“0 0 1 * *” (非标准)@weekly每周运行一次,“0 0 * * 0” (非标准)@daily每天运行一次,“0 0 * * *” (非标准)@midnight(与@daily 相同)(非标准)@hourly每小时运行一次,“0 * * * *” (非标准) Crontab 命令 @@ -277,6 +279,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -290,6 +293,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/css.html b/docs/css.html index f6bd58e5..a38fe3cd 100644 --- a/docs/css.html +++ b/docs/css.html @@ -1,6 +1,6 @@ - - - + + + CSS 备忘清单 & css cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,12 +39,14 @@ CSS 备忘清单 这是一份关于 CSS 优点的快速参考备忘单,列出了选择器语法、属性、单位和其他有用的信息 -入门 + + +入门介绍外部样式表内部样式表内联样式添加 class 类!important选择器文本颜色背景字体定位动画注释Flex 布局Grid 布局变量和计数器CSS 选择器示例组选择器链选择器属性选择器第一个子选择器无子选择器基础组合器属性选择器用户操作伪类伪类输入伪类结构伪类CSS 字体属性速记示例大小写@font-faceCSS 颜色命名颜色十六进制颜色rgb() 颜色HSL 颜色其它全局值CSS 背景属性速记示例CSS 盒子模型最大值/最小值边距/补白Box-sizing能见度Auto 关键字溢出(Overflow)CSS 动画速记属性示例Javascript 事件CSS Flexbox简单实例容器子元素justify-contentflex-wrapflex-directionalign-itemsalign-contentorderflex-growCSS Flexbox 技巧垂直中心垂直中心 (2)重新排序移动布局Table-like 像表格Vertical 垂直的左和右CSS Grid 网格布局网格模板列fr 相对单位Grid Gap 网格间隙CSS 网格行实例CSS 块级网格CSS 内联级别网格CSS 网格行间隙CSS 网格区域minmax() 函数grid-row-start & grid-row-end实例对齐项目CSS 网格模板区域Justify Self对齐项目CSS 动态内容变量计数器使用计数器Css 3 技巧滚动条平滑忽略用作间距的换行符 <br />使用 :empty 隐藏空 HTML 元素CSS 重置使用图像作为光标文本溢出显示省略号将文本截断到特定的行数计算函数粘性定位元素使用带有空链接的属性选择器使用 :root 表示灵活类型另见入门 介绍 CSS 功能丰富,不仅仅是布局页面 外部样式表 -<link +<link href="./path/to/stylesheet/style.css" rel="stylesheet" type="text/css" @@ -59,7 +61,7 @@ </style> 内联样式 -<h2 style="text-align: center;"> +<h2 style="text-align: center;"> 居中文本 </h2> <p style="color: blue; font-size: 18px;"> @@ -819,28 +821,28 @@ 容器 .container { - display: flex; - display: inline-flex; + display: flex; + display: inline-flex; - flex-direction: row; /* ltr - 行(左向右) ▶ */ - flex-direction: row-reverse; /* rtl - 行(右向左) ◀ */ - flex-direction: column; /* top-bottom ▼ */ - flex-direction: column-reverse; /* bottom-top ▲ */ + flex-direction: row; /* ltr - 行(左向右) ▶ */ + flex-direction: row-reverse; /* rtl - 行(右向左) ◀ */ + flex-direction: column; /* top-bottom ▼ */ + flex-direction: column-reverse; /* bottom-top ▲ */ - flex-wrap: nowrap; /* 摆放到一行 */ - flex-wrap: wrap; /* 被打断到多个行中 */ + flex-wrap: nowrap; /* 摆放到一行 */ + flex-wrap: wrap; /* 被打断到多个行中 */ - align-items: flex-start; /* 垂直对齐 - 顶部 */ - align-items: flex-end; /* 垂直对齐 - 底部 */ - align-items: center; /* 垂直对齐 - 中间 */ - align-items: stretch; /* 所有人都一样的高度 (默认) */ + align-items: flex-start; /* 垂直对齐 - 顶部 */ + align-items: flex-end; /* 垂直对齐 - 底部 */ + align-items: center; /* 垂直对齐 - 中间 */ + align-items: stretch; /* 所有人都一样的高度 (默认) */ - justify-content: flex-start; /* [◀◀◀ ] */ - justify-content: center; /* [ ■■■ ] */ - justify-content: flex-end; /* [ ▶▶▶] */ - justify-content: space-between; /* [◀ ■ ▶] */ - justify-content: space-around; /* [ ■ ■ ■ ] */ - justify-content: space-evenly; /* [ ■ ■ ■ ] */ + justify-content: flex-start; /* [◀◀◀ ] */ + justify-content: center; /* [ ■■■ ] */ + justify-content: flex-end; /* [ ▶▶▶] */ + justify-content: space-between; /* [◀ ■ ▶] */ + justify-content: space-around; /* [ ■ ■ ■ ] */ + justify-content: space-evenly; /* [ ■ ■ ■ ] */ } 子元素 @@ -960,7 +962,7 @@ ╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯ align-content -align-content: flex-start | flex-end | center | space-between | space-around | stretch; +align-content: flex-start | flex-end | center | space-between | space-around | stretch; @@ -1143,7 +1145,7 @@ minmax() 函数 -.grid { +.grid { display: grid; grid-template-columns: 100px minmax(100px, 500px) 100px; } @@ -1273,7 +1275,7 @@ 有助于在不同的浏览器之间强制样式一致性,并为样式元素提供干净的盒子 使用图像作为光标 -div { +div { cursor: url('path-to-image.png'), url('path-to-fallback-image.png'), auto; /* 表情符号作为光标 */ cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>🚀</text></svg>"), auto; @@ -1344,6 +1346,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -1357,6 +1360,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/curl.html b/docs/curl.html index f4ab58dc..23feabe7 100644 --- a/docs/curl.html +++ b/docs/curl.html @@ -1,6 +1,6 @@ - - - + + + Curl 备忘清单 & curl cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ Curl 备忘清单 此 Curl 备忘清单包含命令和一些常见的 Curl 技巧示例。 -入门 + + +入门介绍Options请求数据头信息 HeadersSSL安装示例CURL GET/HEAD多文件上传为 curl 响应美化 json 输出CURL POSTCURL 脚本安装 rvmCURL 高级检查网站响应时间使用 Curl 检查远程资源是否可用正在下载文件下载文件,保存文件而不更改其名称继续部分下载从多个域下载文件下载一系列文件入门 介绍 Curl 是一种在服务器之间传输数据的工具,支持协议,包括 HTTP/FTP/IMAP/LDAP/POP3/SCP/SFTP/SMB/SMTP 等 @@ -61,7 +63,7 @@ -I # --head: 仅标头 请求 --X POST # --request +-X POST # --request -L # 如果页面重定向,请点击链接 -F # --form: multipart/form-data 的 HTTP POST 数据 @@ -150,7 +152,7 @@ 为 curl 响应美化 json 输出 -$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool +$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool CURL POST @@ -221,14 +223,14 @@ 检查网站响应时间 -curl -s -w \ +curl -s -w \ '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' \ -o /dev/null https://www.google.com 使用 Curl 检查远程资源是否可用 -curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz +curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz 正在下载文件 @@ -249,17 +251,17 @@ 继续部分下载 -curl --remote-name --continue-at - "https://example.com/linux-distro.iso" +curl --remote-name --continue-at - "https://example.com/linux-distro.iso" 从多个域下载文件 -curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html" +curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html" 下载一系列文件 -curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp" +curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp" 下载一系列文件(输出foo_file1.webp、foo_file2.webp…bar_file1_webp等) @@ -267,6 +269,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -280,6 +283,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/docker.html b/docs/docker.html index 0cc02c81..3bdc2b50 100644 --- a/docs/docker.html +++ b/docs/docker.html @@ -1,6 +1,6 @@ - - - + + + Docker 备忘清单 & docker cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Docker 备忘清单 这是 Docker 的快速参考备忘单。 你可以在这里找到最常见的 Docker 命令。 -入门 + + +入门入门一般命令Docker 容器启动和停止说明创建容器实例操控Docker 镜像操控构建镜像Docker 网络操作创建网络各种各样的Docker Hub镜像仓库命令批量清除卷 volumeDocker ComposeDocker ServicesDocker StackDocker Machine另见入门 入门 在后台创建和运行容器 @@ -615,6 +617,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -628,6 +631,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/dockerfile.html b/docs/dockerfile.html index 22581575..a65e0c70 100644 --- a/docs/dockerfile.html +++ b/docs/dockerfile.html @@ -1,6 +1,6 @@ - - - + + + Dockerfile 备忘清单 & dockerfile cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Dockerfile 备忘清单 这是 Dockerfile 的快速参考备忘单。包含用户可以在命令行上调用以组装镜像的所有命令。 -参考 + + +参考继承继承变量 ENV初始化Onbuild在严格的 shell 中运行命令命令 CMD入口点 ENTRYPOINT元数据 LABELARG.dockerignore 文件主要命令服务静态网站的最小 Docker 镜像也可以看看参考 继承 默认 Dockerfile 位于上下文的根目录中。 @@ -49,7 +51,7 @@ 使用 -f 指向文件系统中任何位置的 Dockerfile。 继承 -FROM [--platform=<platform>] <image> [AS <name>] +FROM [--platform=<platform>] <image> [AS <name>] 示例 @@ -76,13 +78,13 @@ VOLUME ["/data"] # 安装点规范 -ADD file.xyz /file.xyz +ADD file.xyz /file.xyz # 复制 COPY --chown=user:group host_file.xyz /path/container_file.xyz Onbuild -ONBUILD RUN bundle install +ONBUILD RUN bundle install # 与另一个文件一起使用时 ONBUILD ADD . /app/src @@ -91,7 +93,7 @@ 指令将触发指令添加到镜像中,以便稍后执行,此时镜像用作另一个构建的基础。 在严格的 shell 中运行命令 -ENV my_var +ENV my_var SHELL ["/bin/bash", "-euo", "pipefail", "-c"] # 使用严格模式: RUN false # ails 像使用 && 一样构建 @@ -129,7 +131,7 @@ CMD ["bundle", "exec", "rails", "server"] 入口点 ENTRYPOINT -ENTRYPOINT ["executable", "param1", "param2"] +ENTRYPOINT ["executable", "param1", "param2"] ENTRYPOINT command param1 param2 @@ -140,7 +142,7 @@ 元数据 LABEL LABEL version="1.0" -LABEL "com.example.vendor"="ACME Incorporated" +LABEL "com.example.vendor"="ACME Incorporated" LABEL com.example.label-with-value="foo" LABEL version="1.0" @@ -272,6 +274,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -285,6 +288,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/electron.html b/docs/electron.html index 7d961542..7a740b59 100644 --- a/docs/electron.html +++ b/docs/electron.html @@ -1,6 +1,6 @@ - - - + + + Electron 备忘清单 & electron cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -41,7 +41,9 @@ Electron 备忘清单 此快速参考备忘单提供了 Electron v21 API 说明和使用示例。 -入门 + + +入门快速开始创建你的应用程序关闭所有窗口时退出应用创建无边框窗口自定义标题栏样式控制红绿灯 (macOS)通过预加载脚本从渲染器访问 Node.js将的 process.versions 对象暴露给渲染器启用拼写检查器app事件绑定方法使用示例方法启动时激活主实例窗口的示例事件属性BrowserWindow参数实例事件实例方法静态方法实例属性另见入门 快速开始 Electron 是一个使用 JavaScript、HTML 和 CSS 构建桌面应用程序的框架 @@ -2003,6 +2005,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -2016,6 +2019,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/emmet.html b/docs/emmet.html index 898f7275..96eb3243 100644 --- a/docs/emmet.html +++ b/docs/emmet.html @@ -1,6 +1,6 @@ - - - + + + Emmet 备忘清单 & emmet cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ Emmet 备忘清单 Emmet 是一个用于提升 HTML 和 CSS 代码编写的 Web 开发人员工具包,它允许您使用著名的 CSS 选择器以光速编写大型 HTML 代码块。 -
# 这是一个内联 Bash 注释。 + +: ' 这是一个 非常整洁的评论 在 bash @@ -1130,6 +1132,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -1143,6 +1146,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/c.html b/docs/c.html index b9104e54..d631005d 100644 --- a/docs/c.html +++ b/docs/c.html @@ -1,6 +1,6 @@ - - - + + + C 备忘清单 & c cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ C 备忘清单 提供基本语法和方法的 C 快速参考备忘单。 -入门 + + +入门hello.c变量常量 Constants注释打印文本控制空格数字符串 Strings条件判断三元运算符SwitchWhile 循环Do/While 循环For 循环跳出循环 Break/ContinueWhile Break 示例While continue 示例数组 Arrays枚举 Enum枚举示例应用用户输入用户输入字符串内存地址创建指针指针变量取消引用运算符算术运算符赋值运算符比较运算符逻辑运算符运算符示例位运算符数据类型 Data Types基本数据类型数据类型基本格式说明符基本格式说明符数据格式示例预处理器预处理器指令预定义宏预定义宏示例宏延续运算符(\)字符串常量化运算符(#)标记粘贴运算符(##)defined() 运算符参数化的宏函数函数声明和定义调用函数函数参数多个参数返回值递归示例数学函数Structures 结构创建结构结构中的字符串访问结构成员复制结构修改值文件处理文件处理函数打开模式参数打开文件:fopen()写入文件:fprintf()读取文件:fscanf()写入文件:fputc()读取文件:fgetc()写入文件:fputs()读取文件:fgets()fseek()rewind()ftell()杂项Docker 运行环境另见入门 hello.c #include <stdio.h> @@ -1192,7 +1194,7 @@ }; int main() { - struct myStructure s1; + struct myStructure s1; return 0; } @@ -1205,7 +1207,7 @@ int main() { struct myStructure s1; - strcpy(s1.myString, "Some text"); + strcpy(s1.myString, "Some text"); // 打印值 printf("我字符串: %s", s1.myString); return 0; @@ -1224,12 +1226,12 @@ // 创建一个名为 s1 的 myStructure 结构变量 struct myStructure s1; // 为 s1 的成员赋值 - s1.myNum = 13; - s1.myLetter = 'B'; + s1.myNum = 13; + s1.myLetter = 'B'; // 创建一个名为 s2 的 myStructure 结构变量 // 并为其赋值 - struct myStructure s2 = {13, 'B'}; + struct myStructure s2 = {13, 'B'}; // 打印值 printf("My number: %d\n", s1.myNum); printf("My letter: %c\n", s1.myLetter); @@ -1252,7 +1254,7 @@ }; struct myStructure s2; -s2 = s1; +s2 = s1; 示例中,将 s1 的值复制到 s2 修改值 @@ -1261,8 +1263,8 @@ 13, 'B' }; // 修改值 -s1.myNum = 30; -s1.myLetter = 'C'; +s1.myNum = 30; +s1.myLetter = 'C'; // 打印值 printf("%d %c %s", s1.myNum, @@ -1390,7 +1392,7 @@ void main( ) { FILE *fp; char ch; - fp = fopen("file_handle.c", "r"); + fp = fopen("file_handle.c", "r"); while (1) { ch = fgetc(fp); @@ -1409,7 +1411,7 @@ FILE *fp; fp = fopen("file.txt", "w"); // 打开文件 // 将数据写入文件 - fprintf(fp, "fprintf 的 Hello 文件..\n"); + fprintf(fp, "fprintf 的 Hello 文件..\n"); fclose(fp); // 关闭文件 } @@ -1419,7 +1421,7 @@ FILE *fp; char buff[255]; // 创建char数组存储文件数据 fp = fopen("file.txt", "r"); - while(fscanf(fp, "%s", buff)!=EOF) { + while(fscanf(fp, "%s", buff)!=EOF) { printf("%s ", buff); } fclose(fp); @@ -1431,7 +1433,7 @@ main(){ FILE *fp; fp = fopen("file1.txt", "w"); // 打开文件 - fputc('a',fp); // 将单个字符写入文件 + fputc('a',fp); // 将单个字符写入文件 fclose(fp); // 关闭文件 } @@ -1443,7 +1445,7 @@ char c; clrscr(); fp=fopen("myfile.txt", "r"); - while((c=fgetc(fp))!=EOF){ + while((c=fgetc(fp))!=EOF){ printf("%c", c); } fclose(fp); @@ -1458,7 +1460,7 @@ FILE *fp; clrscr(); fp = fopen("myfile2.txt","w"); - fputs("hello c programming",fp); + fputs("hello c programming",fp); fclose(fp); getch(); } @@ -1473,7 +1475,7 @@ clrscr(); fp=fopen("myfile2.txt", "r"); - printf("%s", fgets(text, 200, fp)); + printf("%s", fgets(text, 200, fp)); fclose(fp); getch(); } @@ -1486,7 +1488,7 @@ fputs("This is Book", fp); // 将文件指针设置到给定位置 - fseek(fp, 7, SEEK_SET); + fseek(fp, 7, SEEK_SET); fputs("Kenny Wong", fp); fclose(fp); } @@ -1503,7 +1505,7 @@ while((c=fgetc(fp)) != EOF){ printf("%c", c); } - rewind(fp); // 将文件指针移动到文件的开头 + rewind(fp); // 将文件指针移动到文件的开头 while((c=fgetc(fp)) != EOF){ printf("%c", c); } @@ -1524,7 +1526,7 @@ fp = fopen("file.txt", "r"); fseek(fp, 0, SEEK_END); - length = ftell(fp); // 返回当前位置 + length = ftell(fp); // 返回当前位置 fclose(fp); printf("文件大小: %d bytes", length); @@ -1567,6 +1569,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -1580,6 +1583,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/chmod.html b/docs/chmod.html index 844bf6db..54209685 100644 --- a/docs/chmod.html +++ b/docs/chmod.html @@ -1,6 +1,6 @@ - - - + + + Chmod 备忘清单 & chmod cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -36,7 +36,9 @@ } Chmod 备忘清单 这份快速参考备忘单提供了文件权限的简要概述,以及 chmod 命令的操作 -入门 + + +入门语法示例递归更改文件和目录Chmod 生成器通用权限解释 的权限分析权限模式Objects权限文件类型Chmod 示例操作符chmod 600chmod 664chmod 777符号模式删除权限可执行文件chmod 754Chmod 实践SSH 权限网络权限批量更改另见入门 语法 $ chmod [options] <permissions> <file> @@ -51,10 +53,10 @@ chmod 命令代表“更改模式” Chmod 生成器 - -权限: - - +<div> +权限:<input type="text" id="num" placeholder="777" maxlength="3" style="padding: 0.3rem 0.3rem;" /> <input type="text" id="let" placeholder="rwxrwxrwx" maxlength="9" style="padding: 0.3rem 0.3rem;" /> +</div> + @@ -412,233 +414,234 @@ 使用 chmod 修改文件权限 (linode.com) - - - +<!-- Chmod 生成器 JS 代码 --> +<script type="text/javascript"> + const reg_num = /^[0-7]{3}$/; // 一些正则表达式来检查 num 输入 + const reg_let = /^([r\-]{1}[w\-]{1}[x\-]{1}){3}$/; // 一些正则表达式来检查文本输入 + function checkBoxHandle() { + change_occured(true, false, false); + // get rid of bad input classes + document.getElementById('num').classList.remove('bad-input'); + document.getElementById('let').classList.remove('bad-input'); + } + window.addEventListener("DOMContentLoaded", function () { + // loop over all the check boxes + for (let i = 1; i < 10; i++) { + let checkBox = document.getElementById(`${i}`); + checkBox.addEventListener('change', function () { + change_occured(true, false, false); + + // get rid of bad input classes + document.getElementById('num').classList.remove('bad-input'); + + document.getElementById('let').classList.remove('bad-input'); + }); + } + // the octal input + let num_input = document.getElementById('num'); + let num_fn = function () { + // check for bad input + if (!reg_num.test(this.value)) { + this.classList.add('bad-input'); + } else { + this.classList.remove('bad-input'); + change_occured(false, true, false); + } + }; + num_input.addEventListener('change', num_fn); + num_input.addEventListener('keyup', num_fn); + // the let input + let let_input = document.getElementById('let'); + let let_fn = function () { + // check for bad input + if (!reg_let.test(this.value)) { + this.classList.add('bad-input'); + } else { + this.classList.remove('bad-input'); + change_occured(false, false, true); + } + }; + let_input.addEventListener('change',let_fn); + let_input.addEventListener('keyup',let_fn); + }); + /* SETUP + r-4-1 r-4-4 r-4-7 + w-2-2 w-2-5 w-2-8 + x-1-3 x-1-6 x-1-9 + */ + // define a function that runs when a change occures + function change_occured(caller_was_check, caller_was_num, caller_was_let) { + let num1 = 0, num2 = 0, num3 = 0; // these are the three numbers for the octal + let perm_string = ''; // holds the permision string ex. rw-x--r-- + if (caller_was_check) { + // loop over all the check boxes and get the permisions + for (let i = 1; i < 10; i++) { + let checkBox = document.getElementById(`${i}`); + if (checkBox.checked) { // if checked + let current_perm = check_to_octal_and_text(i); + perm_string += `${current_perm.perm_let}`; + if (i <= 3) { + num1 += current_perm.perm_num; + } else if (i <= 6) { + num2 += current_perm.perm_num; + } else { + num3 += current_perm.perm_num; + } + } else { // if not checked + perm_string += '-'; + } + } + // set the permision input text + document.getElementById('let').value = perm_string; + document.getElementById('num').value = `${num1}${num2}${num3}`; + } else if (caller_was_num) { + // get the individual numbers + let num_input_val = document.getElementById('num').value; + num1 = num_input_val.substring(0, 1); + num2 = num_input_val.substring(1, 2); + num3 = num_input_val.substring(2, 3); + // set the checkboxes and get the perm string + perm_string += octal_to_check_and_txt(num1, 0); //Owner + perm_string += octal_to_check_and_txt(num2, 1); //Owner + perm_string += octal_to_check_and_txt(num3, 2); //Owner + // set the permision input text + document.getElementById('let').value = perm_string; + } else if (caller_was_let) { + // get the text input + let perm_text = document.getElementById('let').value; + num1 = text_to_check_and_octal(perm_text.substring(0, 3), 0) + num2 = text_to_check_and_octal(perm_text.substring(3, 6), 3) + num3 = text_to_check_and_octal(perm_text.substring(6, 9), 6) + // set the octal value + document.getElementById('num').value = `${num1}${num2}${num3}`; + } + } + // define a function to converts the checkbox # to the respective permissions + // returns perm_num, perm_let + function check_to_octal_and_text(check_num) { + let perm_num = 0; + let perm_let = '-'; + switch (check_num) { + case 1: + case 4: + case 7: + perm_num = 4; + perm_let = 'r'; + break; + case 2: + case 5: + case 8: + perm_num = 2; + perm_let = 'w'; + break; + case 3: + case 6: + case 9: + perm_num = 1; + perm_let = 'x'; + break; + default: + perm_num = 0; + perm_let = '-'; + } + // return values + return { + perm_num, + perm_let + }; + } + /** + Takes a number 1-7 and which class it is in: + 0 = owner + 1 = Group + 2 = Public + Returns: perm text (ex. "rwx") and sets the appropriate checkboxes + */ + function octal_to_check_and_txt(octal_num, class_num) { + let perm_text = ''; + let offset = class_num * 3; + switch (octal_num) { + case '1': + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = '--x'; + break; + case '2': + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = '-w-'; + break; + case '3': + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = '-wx'; + break; + case '4': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = 'r--'; + break; + case '5': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = 'r-x'; + break; + case '6': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = 'rw-'; + break; + case '7': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = 'rwx'; + break; + default: + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = '---'; + } + return perm_text; + } + /** + Takes 3 letters (r, w, x, - ex. 'rw-') and an offset (0,3,6) + Returns the octal num and sets the appropriate checkboxes + */ + function text_to_check_and_octal(letters, offset) { + let perm_num = 0; // the octal number to return + // add up the oct num and set the check boxes + for (let i = 0; i < 3; i++) { + current_let = letters.substring(i, i + 1); + if (current_let == 'r') { + document.getElementById(`${i + 1 + offset}`).checked = true; + perm_num += 4; + } else if (current_let == 'w') { + document.getElementById(`${i + 1 + offset}`).checked = true; + perm_num += 2; + } else if (current_let == 'x') { + document.getElementById(`${i + 1 + offset}`).checked = true; + perm_num += 1; + } else { + document.getElementById(`${i + 1 + offset}`).checked = false; + } + } + return perm_num; + } +</script> + - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/colors-named.html b/docs/colors-named.html index 75b69829..9a5acca0 100644 --- a/docs/colors-named.html +++ b/docs/colors-named.html @@ -1,6 +1,6 @@ - - - + + + Colors Named 备忘清单 & colors-named cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Colors Named 备忘清单 CSS 定义了一大组命名颜色,以便可以更轻松地编写和阅读常用颜色,这里列出了它的颜色名称/Hex rgb/十进制 rgb 数据 -Named Colors + + +Named Colors颜色列表HSL 颜色示例0° Reds30° Reds-Yellows (=Oranges)60° Yellows90° Yellow-Greens120° Greens150° Green-Cyans180° Cyans210° Cyan-Blues240° blues270° Blue-Magentas300° Magentas330° Magenta-Reds另见Named Colors 颜色列表 @@ -947,7 +949,7 @@ 0° Reds - + @@ -1064,7 +1066,7 @@ 30° Reds-Yellows (=Oranges) - + @@ -1181,7 +1183,7 @@ 60° Yellows - + @@ -1298,7 +1300,7 @@ 90° Yellow-Greens - + @@ -1415,7 +1417,7 @@ 120° Greens - + @@ -1532,7 +1534,7 @@ 150° Green-Cyans - + @@ -1649,7 +1651,7 @@ 180° Cyans - + @@ -1766,7 +1768,7 @@ 210° Cyan-Blues - + @@ -1883,7 +1885,7 @@ 240° blues - + @@ -2000,7 +2002,7 @@ 270° Blue-Magentas - + @@ -2117,7 +2119,7 @@ 300° Magentas - + @@ -2234,7 +2236,7 @@ 330° Magenta-Reds - + @@ -2358,6 +2360,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -2371,6 +2374,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/cron.html b/docs/cron.html index 4bbb2a1b..55ab6d45 100644 --- a/docs/cron.html +++ b/docs/cron.html @@ -1,6 +1,6 @@ - - - + + + Cron 备忘清单 & cron cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Cron 备忘清单 Cron 最适合安排重复性任务。 可以使用关联的 at 实用程序来完成一次性任务的调度。 -Crontab 格式 + + +Crontab 格式格式示例特殊字符串Crontab 命令特殊字符Also seeCrontab 格式 格式 Min Hour Day Mon Weekday @@ -90,7 +92,7 @@ -字段范围特殊字符分钟 Minute0 - 59, - * /小时 Hour0 - 23, - * /月份中的某天1 - 31, - * ? / L W月 Month1 - 12, - * /星期几0 - 6, - * ? / L # +字段范围特殊字符分钟 Minute0 - 59, - * /小时 Hour0 - 23, - * /月份中的某天1 - 31, - * ? / L W月 Month1 - 12, - * /星期几0 - 6, - * ? / L # 示例 @@ -193,7 +195,7 @@ -特殊字符串意义@reboot运行一次,在系统启动时 (非标准)@yearly每年运行一次,“0 0 1 1 *” (非标准)@annually(与@yearly 相同)(非标准)@monthly每月运行一次,“0 0 1 * *” (非标准)@weekly每周运行一次,“0 0 * * 0” (非标准)@daily每天运行一次,“0 0 * * *” (非标准)@midnight(与@daily 相同)(非标准)@hourly每小时运行一次,“0 * * * *” (非标准) +特殊字符串意义@reboot运行一次,在系统启动时 (非标准)@yearly每年运行一次,“0 0 1 1 *” (非标准)@annually(与@yearly 相同)(非标准)@monthly每月运行一次,“0 0 1 * *” (非标准)@weekly每周运行一次,“0 0 * * 0” (非标准)@daily每天运行一次,“0 0 * * *” (非标准)@midnight(与@daily 相同)(非标准)@hourly每小时运行一次,“0 * * * *” (非标准) Crontab 命令 @@ -277,6 +279,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -290,6 +293,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/css.html b/docs/css.html index f6bd58e5..a38fe3cd 100644 --- a/docs/css.html +++ b/docs/css.html @@ -1,6 +1,6 @@ - - - + + + CSS 备忘清单 & css cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,12 +39,14 @@ CSS 备忘清单 这是一份关于 CSS 优点的快速参考备忘单,列出了选择器语法、属性、单位和其他有用的信息 -入门 + + +入门介绍外部样式表内部样式表内联样式添加 class 类!important选择器文本颜色背景字体定位动画注释Flex 布局Grid 布局变量和计数器CSS 选择器示例组选择器链选择器属性选择器第一个子选择器无子选择器基础组合器属性选择器用户操作伪类伪类输入伪类结构伪类CSS 字体属性速记示例大小写@font-faceCSS 颜色命名颜色十六进制颜色rgb() 颜色HSL 颜色其它全局值CSS 背景属性速记示例CSS 盒子模型最大值/最小值边距/补白Box-sizing能见度Auto 关键字溢出(Overflow)CSS 动画速记属性示例Javascript 事件CSS Flexbox简单实例容器子元素justify-contentflex-wrapflex-directionalign-itemsalign-contentorderflex-growCSS Flexbox 技巧垂直中心垂直中心 (2)重新排序移动布局Table-like 像表格Vertical 垂直的左和右CSS Grid 网格布局网格模板列fr 相对单位Grid Gap 网格间隙CSS 网格行实例CSS 块级网格CSS 内联级别网格CSS 网格行间隙CSS 网格区域minmax() 函数grid-row-start & grid-row-end实例对齐项目CSS 网格模板区域Justify Self对齐项目CSS 动态内容变量计数器使用计数器Css 3 技巧滚动条平滑忽略用作间距的换行符 <br />使用 :empty 隐藏空 HTML 元素CSS 重置使用图像作为光标文本溢出显示省略号将文本截断到特定的行数计算函数粘性定位元素使用带有空链接的属性选择器使用 :root 表示灵活类型另见入门 介绍 CSS 功能丰富,不仅仅是布局页面 外部样式表 -<link +<link href="./path/to/stylesheet/style.css" rel="stylesheet" type="text/css" @@ -59,7 +61,7 @@ </style> 内联样式 -<h2 style="text-align: center;"> +<h2 style="text-align: center;"> 居中文本 </h2> <p style="color: blue; font-size: 18px;"> @@ -819,28 +821,28 @@ 容器 .container { - display: flex; - display: inline-flex; + display: flex; + display: inline-flex; - flex-direction: row; /* ltr - 行(左向右) ▶ */ - flex-direction: row-reverse; /* rtl - 行(右向左) ◀ */ - flex-direction: column; /* top-bottom ▼ */ - flex-direction: column-reverse; /* bottom-top ▲ */ + flex-direction: row; /* ltr - 行(左向右) ▶ */ + flex-direction: row-reverse; /* rtl - 行(右向左) ◀ */ + flex-direction: column; /* top-bottom ▼ */ + flex-direction: column-reverse; /* bottom-top ▲ */ - flex-wrap: nowrap; /* 摆放到一行 */ - flex-wrap: wrap; /* 被打断到多个行中 */ + flex-wrap: nowrap; /* 摆放到一行 */ + flex-wrap: wrap; /* 被打断到多个行中 */ - align-items: flex-start; /* 垂直对齐 - 顶部 */ - align-items: flex-end; /* 垂直对齐 - 底部 */ - align-items: center; /* 垂直对齐 - 中间 */ - align-items: stretch; /* 所有人都一样的高度 (默认) */ + align-items: flex-start; /* 垂直对齐 - 顶部 */ + align-items: flex-end; /* 垂直对齐 - 底部 */ + align-items: center; /* 垂直对齐 - 中间 */ + align-items: stretch; /* 所有人都一样的高度 (默认) */ - justify-content: flex-start; /* [◀◀◀ ] */ - justify-content: center; /* [ ■■■ ] */ - justify-content: flex-end; /* [ ▶▶▶] */ - justify-content: space-between; /* [◀ ■ ▶] */ - justify-content: space-around; /* [ ■ ■ ■ ] */ - justify-content: space-evenly; /* [ ■ ■ ■ ] */ + justify-content: flex-start; /* [◀◀◀ ] */ + justify-content: center; /* [ ■■■ ] */ + justify-content: flex-end; /* [ ▶▶▶] */ + justify-content: space-between; /* [◀ ■ ▶] */ + justify-content: space-around; /* [ ■ ■ ■ ] */ + justify-content: space-evenly; /* [ ■ ■ ■ ] */ } 子元素 @@ -960,7 +962,7 @@ ╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯ align-content -align-content: flex-start | flex-end | center | space-between | space-around | stretch; +align-content: flex-start | flex-end | center | space-between | space-around | stretch; @@ -1143,7 +1145,7 @@ minmax() 函数 -.grid { +.grid { display: grid; grid-template-columns: 100px minmax(100px, 500px) 100px; } @@ -1273,7 +1275,7 @@ 有助于在不同的浏览器之间强制样式一致性,并为样式元素提供干净的盒子 使用图像作为光标 -div { +div { cursor: url('path-to-image.png'), url('path-to-fallback-image.png'), auto; /* 表情符号作为光标 */ cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>🚀</text></svg>"), auto; @@ -1344,6 +1346,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -1357,6 +1360,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/curl.html b/docs/curl.html index f4ab58dc..23feabe7 100644 --- a/docs/curl.html +++ b/docs/curl.html @@ -1,6 +1,6 @@ - - - + + + Curl 备忘清单 & curl cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ Curl 备忘清单 此 Curl 备忘清单包含命令和一些常见的 Curl 技巧示例。 -入门 + + +入门介绍Options请求数据头信息 HeadersSSL安装示例CURL GET/HEAD多文件上传为 curl 响应美化 json 输出CURL POSTCURL 脚本安装 rvmCURL 高级检查网站响应时间使用 Curl 检查远程资源是否可用正在下载文件下载文件,保存文件而不更改其名称继续部分下载从多个域下载文件下载一系列文件入门 介绍 Curl 是一种在服务器之间传输数据的工具,支持协议,包括 HTTP/FTP/IMAP/LDAP/POP3/SCP/SFTP/SMB/SMTP 等 @@ -61,7 +63,7 @@ -I # --head: 仅标头 请求 --X POST # --request +-X POST # --request -L # 如果页面重定向,请点击链接 -F # --form: multipart/form-data 的 HTTP POST 数据 @@ -150,7 +152,7 @@ 为 curl 响应美化 json 输出 -$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool +$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool CURL POST @@ -221,14 +223,14 @@ 检查网站响应时间 -curl -s -w \ +curl -s -w \ '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' \ -o /dev/null https://www.google.com 使用 Curl 检查远程资源是否可用 -curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz +curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz 正在下载文件 @@ -249,17 +251,17 @@ 继续部分下载 -curl --remote-name --continue-at - "https://example.com/linux-distro.iso" +curl --remote-name --continue-at - "https://example.com/linux-distro.iso" 从多个域下载文件 -curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html" +curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html" 下载一系列文件 -curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp" +curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp" 下载一系列文件(输出foo_file1.webp、foo_file2.webp…bar_file1_webp等) @@ -267,6 +269,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -280,6 +283,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/docker.html b/docs/docker.html index 0cc02c81..3bdc2b50 100644 --- a/docs/docker.html +++ b/docs/docker.html @@ -1,6 +1,6 @@ - - - + + + Docker 备忘清单 & docker cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Docker 备忘清单 这是 Docker 的快速参考备忘单。 你可以在这里找到最常见的 Docker 命令。 -入门 + + +入门入门一般命令Docker 容器启动和停止说明创建容器实例操控Docker 镜像操控构建镜像Docker 网络操作创建网络各种各样的Docker Hub镜像仓库命令批量清除卷 volumeDocker ComposeDocker ServicesDocker StackDocker Machine另见入门 入门 在后台创建和运行容器 @@ -615,6 +617,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -628,6 +631,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/dockerfile.html b/docs/dockerfile.html index 22581575..a65e0c70 100644 --- a/docs/dockerfile.html +++ b/docs/dockerfile.html @@ -1,6 +1,6 @@ - - - + + + Dockerfile 备忘清单 & dockerfile cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Dockerfile 备忘清单 这是 Dockerfile 的快速参考备忘单。包含用户可以在命令行上调用以组装镜像的所有命令。 -参考 + + +参考继承继承变量 ENV初始化Onbuild在严格的 shell 中运行命令命令 CMD入口点 ENTRYPOINT元数据 LABELARG.dockerignore 文件主要命令服务静态网站的最小 Docker 镜像也可以看看参考 继承 默认 Dockerfile 位于上下文的根目录中。 @@ -49,7 +51,7 @@ 使用 -f 指向文件系统中任何位置的 Dockerfile。 继承 -FROM [--platform=<platform>] <image> [AS <name>] +FROM [--platform=<platform>] <image> [AS <name>] 示例 @@ -76,13 +78,13 @@ VOLUME ["/data"] # 安装点规范 -ADD file.xyz /file.xyz +ADD file.xyz /file.xyz # 复制 COPY --chown=user:group host_file.xyz /path/container_file.xyz Onbuild -ONBUILD RUN bundle install +ONBUILD RUN bundle install # 与另一个文件一起使用时 ONBUILD ADD . /app/src @@ -91,7 +93,7 @@ 指令将触发指令添加到镜像中,以便稍后执行,此时镜像用作另一个构建的基础。 在严格的 shell 中运行命令 -ENV my_var +ENV my_var SHELL ["/bin/bash", "-euo", "pipefail", "-c"] # 使用严格模式: RUN false # ails 像使用 && 一样构建 @@ -129,7 +131,7 @@ CMD ["bundle", "exec", "rails", "server"] 入口点 ENTRYPOINT -ENTRYPOINT ["executable", "param1", "param2"] +ENTRYPOINT ["executable", "param1", "param2"] ENTRYPOINT command param1 param2 @@ -140,7 +142,7 @@ 元数据 LABEL LABEL version="1.0" -LABEL "com.example.vendor"="ACME Incorporated" +LABEL "com.example.vendor"="ACME Incorporated" LABEL com.example.label-with-value="foo" LABEL version="1.0" @@ -272,6 +274,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -285,6 +288,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/electron.html b/docs/electron.html index 7d961542..7a740b59 100644 --- a/docs/electron.html +++ b/docs/electron.html @@ -1,6 +1,6 @@ - - - + + + Electron 备忘清单 & electron cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -41,7 +41,9 @@ Electron 备忘清单 此快速参考备忘单提供了 Electron v21 API 说明和使用示例。 -入门 + + +入门快速开始创建你的应用程序关闭所有窗口时退出应用创建无边框窗口自定义标题栏样式控制红绿灯 (macOS)通过预加载脚本从渲染器访问 Node.js将的 process.versions 对象暴露给渲染器启用拼写检查器app事件绑定方法使用示例方法启动时激活主实例窗口的示例事件属性BrowserWindow参数实例事件实例方法静态方法实例属性另见入门 快速开始 Electron 是一个使用 JavaScript、HTML 和 CSS 构建桌面应用程序的框架 @@ -2003,6 +2005,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -2016,6 +2019,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/emmet.html b/docs/emmet.html index 898f7275..96eb3243 100644 --- a/docs/emmet.html +++ b/docs/emmet.html @@ -1,6 +1,6 @@ - - - + + + Emmet 备忘清单 & emmet cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ Emmet 备忘清单 Emmet 是一个用于提升 HTML 和 CSS 代码编写的 Web 开发人员工具包,它允许您使用著名的 CSS 选择器以光速编写大型 HTML 代码块。 -
提供基本语法和方法的 C 快速参考备忘单。
#include <stdio.h> @@ -1192,7 +1194,7 @@ }; int main() { - struct myStructure s1; + struct myStructure s1; return 0; }
示例中,将 s1 的值复制到 s2
s1
s2
这份快速参考备忘单提供了文件权限的简要概述,以及 chmod 命令的操作
$ chmod [options] <permissions> <file>
chmod 命令代表“更改模式”
chmod
-权限: - -
<div> +权限:<input type="text" id="num" placeholder="777" maxlength="3" style="padding: 0.3rem 0.3rem;" /> <input type="text" id="let" placeholder="rwxrwxrwx" maxlength="9" style="padding: 0.3rem 0.3rem;" /> +</div> +
- -
<!-- Chmod 生成器 JS 代码 --> +<script type="text/javascript"> + const reg_num = /^[0-7]{3}$/; // 一些正则表达式来检查 num 输入 + const reg_let = /^([r\-]{1}[w\-]{1}[x\-]{1}){3}$/; // 一些正则表达式来检查文本输入 + function checkBoxHandle() { + change_occured(true, false, false); + // get rid of bad input classes + document.getElementById('num').classList.remove('bad-input'); + document.getElementById('let').classList.remove('bad-input'); + } + window.addEventListener("DOMContentLoaded", function () { + // loop over all the check boxes + for (let i = 1; i < 10; i++) { + let checkBox = document.getElementById(`${i}`); + checkBox.addEventListener('change', function () { + change_occured(true, false, false); + + // get rid of bad input classes + document.getElementById('num').classList.remove('bad-input'); + + document.getElementById('let').classList.remove('bad-input'); + }); + } + // the octal input + let num_input = document.getElementById('num'); + let num_fn = function () { + // check for bad input + if (!reg_num.test(this.value)) { + this.classList.add('bad-input'); + } else { + this.classList.remove('bad-input'); + change_occured(false, true, false); + } + }; + num_input.addEventListener('change', num_fn); + num_input.addEventListener('keyup', num_fn); + // the let input + let let_input = document.getElementById('let'); + let let_fn = function () { + // check for bad input + if (!reg_let.test(this.value)) { + this.classList.add('bad-input'); + } else { + this.classList.remove('bad-input'); + change_occured(false, false, true); + } + }; + let_input.addEventListener('change',let_fn); + let_input.addEventListener('keyup',let_fn); + }); + /* SETUP + r-4-1 r-4-4 r-4-7 + w-2-2 w-2-5 w-2-8 + x-1-3 x-1-6 x-1-9 + */ + // define a function that runs when a change occures + function change_occured(caller_was_check, caller_was_num, caller_was_let) { + let num1 = 0, num2 = 0, num3 = 0; // these are the three numbers for the octal + let perm_string = ''; // holds the permision string ex. rw-x--r-- + if (caller_was_check) { + // loop over all the check boxes and get the permisions + for (let i = 1; i < 10; i++) { + let checkBox = document.getElementById(`${i}`); + if (checkBox.checked) { // if checked + let current_perm = check_to_octal_and_text(i); + perm_string += `${current_perm.perm_let}`; + if (i <= 3) { + num1 += current_perm.perm_num; + } else if (i <= 6) { + num2 += current_perm.perm_num; + } else { + num3 += current_perm.perm_num; + } + } else { // if not checked + perm_string += '-'; + } + } + // set the permision input text + document.getElementById('let').value = perm_string; + document.getElementById('num').value = `${num1}${num2}${num3}`; + } else if (caller_was_num) { + // get the individual numbers + let num_input_val = document.getElementById('num').value; + num1 = num_input_val.substring(0, 1); + num2 = num_input_val.substring(1, 2); + num3 = num_input_val.substring(2, 3); + // set the checkboxes and get the perm string + perm_string += octal_to_check_and_txt(num1, 0); //Owner + perm_string += octal_to_check_and_txt(num2, 1); //Owner + perm_string += octal_to_check_and_txt(num3, 2); //Owner + // set the permision input text + document.getElementById('let').value = perm_string; + } else if (caller_was_let) { + // get the text input + let perm_text = document.getElementById('let').value; + num1 = text_to_check_and_octal(perm_text.substring(0, 3), 0) + num2 = text_to_check_and_octal(perm_text.substring(3, 6), 3) + num3 = text_to_check_and_octal(perm_text.substring(6, 9), 6) + // set the octal value + document.getElementById('num').value = `${num1}${num2}${num3}`; + } + } + // define a function to converts the checkbox # to the respective permissions + // returns perm_num, perm_let + function check_to_octal_and_text(check_num) { + let perm_num = 0; + let perm_let = '-'; + switch (check_num) { + case 1: + case 4: + case 7: + perm_num = 4; + perm_let = 'r'; + break; + case 2: + case 5: + case 8: + perm_num = 2; + perm_let = 'w'; + break; + case 3: + case 6: + case 9: + perm_num = 1; + perm_let = 'x'; + break; + default: + perm_num = 0; + perm_let = '-'; + } + // return values + return { + perm_num, + perm_let + }; + } + /** + Takes a number 1-7 and which class it is in: + 0 = owner + 1 = Group + 2 = Public + Returns: perm text (ex. "rwx") and sets the appropriate checkboxes + */ + function octal_to_check_and_txt(octal_num, class_num) { + let perm_text = ''; + let offset = class_num * 3; + switch (octal_num) { + case '1': + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = '--x'; + break; + case '2': + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = '-w-'; + break; + case '3': + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = '-wx'; + break; + case '4': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = 'r--'; + break; + case '5': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = 'r-x'; + break; + case '6': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = 'rw-'; + break; + case '7': + document.getElementById(`${1 + offset}`).checked = true; + document.getElementById(`${2 + offset}`).checked = true; + document.getElementById(`${3 + offset}`).checked = true; + perm_text = 'rwx'; + break; + default: + document.getElementById(`${1 + offset}`).checked = false; + document.getElementById(`${2 + offset}`).checked = false; + document.getElementById(`${3 + offset}`).checked = false; + perm_text = '---'; + } + return perm_text; + } + /** + Takes 3 letters (r, w, x, - ex. 'rw-') and an offset (0,3,6) + Returns the octal num and sets the appropriate checkboxes + */ + function text_to_check_and_octal(letters, offset) { + let perm_num = 0; // the octal number to return + // add up the oct num and set the check boxes + for (let i = 0; i < 3; i++) { + current_let = letters.substring(i, i + 1); + if (current_let == 'r') { + document.getElementById(`${i + 1 + offset}`).checked = true; + perm_num += 4; + } else if (current_let == 'w') { + document.getElementById(`${i + 1 + offset}`).checked = true; + perm_num += 2; + } else if (current_let == 'x') { + document.getElementById(`${i + 1 + offset}`).checked = true; + perm_num += 1; + } else { + document.getElementById(`${i + 1 + offset}`).checked = false; + } + } + return perm_num; + } +</script> +
CSS 定义了一大组命名颜色,以便可以更轻松地编写和阅读常用颜色,这里列出了它的颜色名称/Hex rgb/十进制 rgb 数据
Cron 最适合安排重复性任务。 可以使用关联的 at 实用程序来完成一次性任务的调度。
Min Hour Day Mon Weekday @@ -90,7 +92,7 @@ -字段范围特殊字符分钟 Minute0 - 59, - * /小时 Hour0 - 23, - * /月份中的某天1 - 31, - * ? / L W月 Month1 - 12, - * /星期几0 - 6, - * ? / L # +字段范围特殊字符分钟 Minute0 - 59, - * /小时 Hour0 - 23, - * /月份中的某天1 - 31, - * ? / L W月 Month1 - 12, - * /星期几0 - 6, - * ? / L #
这是一份关于 CSS 优点的快速参考备忘单,列出了选择器语法、属性、单位和其他有用的信息
CSS 功能丰富,不仅仅是布局页面
<link +<link href="./path/to/stylesheet/style.css" rel="stylesheet" type="text/css" @@ -59,7 +61,7 @@ </style>
<link href="./path/to/stylesheet/style.css" rel="stylesheet" type="text/css" @@ -59,7 +61,7 @@
<h2 style="text-align: center;"> +<h2 style="text-align: center;"> 居中文本 </h2> <p style="color: blue; font-size: 18px;"> @@ -819,28 +821,28 @@
<h2 style="text-align: center;"> 居中文本 </h2> <p style="color: blue; font-size: 18px;"> @@ -819,28 +821,28 @@
.container { - display: flex; - display: inline-flex; + display: flex; + display: inline-flex; - flex-direction: row; /* ltr - 行(左向右) ▶ */ - flex-direction: row-reverse; /* rtl - 行(右向左) ◀ */ - flex-direction: column; /* top-bottom ▼ */ - flex-direction: column-reverse; /* bottom-top ▲ */ + flex-direction: row; /* ltr - 行(左向右) ▶ */ + flex-direction: row-reverse; /* rtl - 行(右向左) ◀ */ + flex-direction: column; /* top-bottom ▼ */ + flex-direction: column-reverse; /* bottom-top ▲ */ - flex-wrap: nowrap; /* 摆放到一行 */ - flex-wrap: wrap; /* 被打断到多个行中 */ + flex-wrap: nowrap; /* 摆放到一行 */ + flex-wrap: wrap; /* 被打断到多个行中 */ - align-items: flex-start; /* 垂直对齐 - 顶部 */ - align-items: flex-end; /* 垂直对齐 - 底部 */ - align-items: center; /* 垂直对齐 - 中间 */ - align-items: stretch; /* 所有人都一样的高度 (默认) */ + align-items: flex-start; /* 垂直对齐 - 顶部 */ + align-items: flex-end; /* 垂直对齐 - 底部 */ + align-items: center; /* 垂直对齐 - 中间 */ + align-items: stretch; /* 所有人都一样的高度 (默认) */ - justify-content: flex-start; /* [◀◀◀ ] */ - justify-content: center; /* [ ■■■ ] */ - justify-content: flex-end; /* [ ▶▶▶] */ - justify-content: space-between; /* [◀ ■ ▶] */ - justify-content: space-around; /* [ ■ ■ ■ ] */ - justify-content: space-evenly; /* [ ■ ■ ■ ] */ + justify-content: flex-start; /* [◀◀◀ ] */ + justify-content: center; /* [ ■■■ ] */ + justify-content: flex-end; /* [ ▶▶▶] */ + justify-content: space-between; /* [◀ ■ ▶] */ + justify-content: space-around; /* [ ■ ■ ■ ] */ + justify-content: space-evenly; /* [ ■ ■ ■ ] */ }
align-content: flex-start | flex-end | center | space-between | space-around | stretch; +align-content: flex-start | flex-end | center | space-between | space-around | stretch; @@ -1143,7 +1145,7 @@
align-content: flex-start | flex-end | center | space-between | space-around | stretch;
.grid { +.grid { display: grid; grid-template-columns: 100px minmax(100px, 500px) 100px; } @@ -1273,7 +1275,7 @@ 有助于在不同的浏览器之间强制样式一致性,并为样式元素提供干净的盒子
.grid { display: grid; grid-template-columns: 100px minmax(100px, 500px) 100px; } @@ -1273,7 +1275,7 @@
有助于在不同的浏览器之间强制样式一致性,并为样式元素提供干净的盒子
div { +div { cursor: url('path-to-image.png'), url('path-to-fallback-image.png'), auto; /* 表情符号作为光标 */ cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>🚀</text></svg>"), auto; @@ -1344,6 +1346,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -1357,6 +1360,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/curl.html b/docs/curl.html index f4ab58dc..23feabe7 100644 --- a/docs/curl.html +++ b/docs/curl.html @@ -1,6 +1,6 @@ - - - + + + Curl 备忘清单 & curl cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ Curl 备忘清单 此 Curl 备忘清单包含命令和一些常见的 Curl 技巧示例。 -入门 + + +入门介绍Options请求数据头信息 HeadersSSL安装示例CURL GET/HEAD多文件上传为 curl 响应美化 json 输出CURL POSTCURL 脚本安装 rvmCURL 高级检查网站响应时间使用 Curl 检查远程资源是否可用正在下载文件下载文件,保存文件而不更改其名称继续部分下载从多个域下载文件下载一系列文件入门 介绍 Curl 是一种在服务器之间传输数据的工具,支持协议,包括 HTTP/FTP/IMAP/LDAP/POP3/SCP/SFTP/SMB/SMTP 等 @@ -61,7 +63,7 @@ -I # --head: 仅标头 请求 --X POST # --request +-X POST # --request -L # 如果页面重定向,请点击链接 -F # --form: multipart/form-data 的 HTTP POST 数据 @@ -150,7 +152,7 @@ 为 curl 响应美化 json 输出 -$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool +$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool CURL POST @@ -221,14 +223,14 @@ 检查网站响应时间 -curl -s -w \ +curl -s -w \ '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' \ -o /dev/null https://www.google.com 使用 Curl 检查远程资源是否可用 -curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz +curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz 正在下载文件 @@ -249,17 +251,17 @@ 继续部分下载 -curl --remote-name --continue-at - "https://example.com/linux-distro.iso" +curl --remote-name --continue-at - "https://example.com/linux-distro.iso" 从多个域下载文件 -curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html" +curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html" 下载一系列文件 -curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp" +curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp" 下载一系列文件(输出foo_file1.webp、foo_file2.webp…bar_file1_webp等) @@ -267,6 +269,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -280,6 +283,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/docker.html b/docs/docker.html index 0cc02c81..3bdc2b50 100644 --- a/docs/docker.html +++ b/docs/docker.html @@ -1,6 +1,6 @@ - - - + + + Docker 备忘清单 & docker cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Docker 备忘清单 这是 Docker 的快速参考备忘单。 你可以在这里找到最常见的 Docker 命令。 -入门 + + +入门入门一般命令Docker 容器启动和停止说明创建容器实例操控Docker 镜像操控构建镜像Docker 网络操作创建网络各种各样的Docker Hub镜像仓库命令批量清除卷 volumeDocker ComposeDocker ServicesDocker StackDocker Machine另见入门 入门 在后台创建和运行容器 @@ -615,6 +617,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -628,6 +631,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/dockerfile.html b/docs/dockerfile.html index 22581575..a65e0c70 100644 --- a/docs/dockerfile.html +++ b/docs/dockerfile.html @@ -1,6 +1,6 @@ - - - + + + Dockerfile 备忘清单 & dockerfile cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Dockerfile 备忘清单 这是 Dockerfile 的快速参考备忘单。包含用户可以在命令行上调用以组装镜像的所有命令。 -参考 + + +参考继承继承变量 ENV初始化Onbuild在严格的 shell 中运行命令命令 CMD入口点 ENTRYPOINT元数据 LABELARG.dockerignore 文件主要命令服务静态网站的最小 Docker 镜像也可以看看参考 继承 默认 Dockerfile 位于上下文的根目录中。 @@ -49,7 +51,7 @@ 使用 -f 指向文件系统中任何位置的 Dockerfile。 继承 -FROM [--platform=<platform>] <image> [AS <name>] +FROM [--platform=<platform>] <image> [AS <name>] 示例 @@ -76,13 +78,13 @@ VOLUME ["/data"] # 安装点规范 -ADD file.xyz /file.xyz +ADD file.xyz /file.xyz # 复制 COPY --chown=user:group host_file.xyz /path/container_file.xyz Onbuild -ONBUILD RUN bundle install +ONBUILD RUN bundle install # 与另一个文件一起使用时 ONBUILD ADD . /app/src @@ -91,7 +93,7 @@ 指令将触发指令添加到镜像中,以便稍后执行,此时镜像用作另一个构建的基础。 在严格的 shell 中运行命令 -ENV my_var +ENV my_var SHELL ["/bin/bash", "-euo", "pipefail", "-c"] # 使用严格模式: RUN false # ails 像使用 && 一样构建 @@ -129,7 +131,7 @@ CMD ["bundle", "exec", "rails", "server"] 入口点 ENTRYPOINT -ENTRYPOINT ["executable", "param1", "param2"] +ENTRYPOINT ["executable", "param1", "param2"] ENTRYPOINT command param1 param2 @@ -140,7 +142,7 @@ 元数据 LABEL LABEL version="1.0" -LABEL "com.example.vendor"="ACME Incorporated" +LABEL "com.example.vendor"="ACME Incorporated" LABEL com.example.label-with-value="foo" LABEL version="1.0" @@ -272,6 +274,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -285,6 +288,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/electron.html b/docs/electron.html index 7d961542..7a740b59 100644 --- a/docs/electron.html +++ b/docs/electron.html @@ -1,6 +1,6 @@ - - - + + + Electron 备忘清单 & electron cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -41,7 +41,9 @@ Electron 备忘清单 此快速参考备忘单提供了 Electron v21 API 说明和使用示例。 -入门 + + +入门快速开始创建你的应用程序关闭所有窗口时退出应用创建无边框窗口自定义标题栏样式控制红绿灯 (macOS)通过预加载脚本从渲染器访问 Node.js将的 process.versions 对象暴露给渲染器启用拼写检查器app事件绑定方法使用示例方法启动时激活主实例窗口的示例事件属性BrowserWindow参数实例事件实例方法静态方法实例属性另见入门 快速开始 Electron 是一个使用 JavaScript、HTML 和 CSS 构建桌面应用程序的框架 @@ -2003,6 +2005,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -2016,6 +2019,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/emmet.html b/docs/emmet.html index 898f7275..96eb3243 100644 --- a/docs/emmet.html +++ b/docs/emmet.html @@ -1,6 +1,6 @@ - - - + + + Emmet 备忘清单 & emmet cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ Emmet 备忘清单 Emmet 是一个用于提升 HTML 和 CSS 代码编写的 Web 开发人员工具包,它允许您使用著名的 CSS 选择器以光速编写大型 HTML 代码块。 -
div { cursor: url('path-to-image.png'), url('path-to-fallback-image.png'), auto; /* 表情符号作为光标 */ cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>🚀</text></svg>"), auto; @@ -1344,6 +1346,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -1357,6 +1360,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/curl.html b/docs/curl.html index f4ab58dc..23feabe7 100644 --- a/docs/curl.html +++ b/docs/curl.html @@ -1,6 +1,6 @@ - - - + + + Curl 备忘清单 & curl cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ Curl 备忘清单 此 Curl 备忘清单包含命令和一些常见的 Curl 技巧示例。 -入门 + + +入门介绍Options请求数据头信息 HeadersSSL安装示例CURL GET/HEAD多文件上传为 curl 响应美化 json 输出CURL POSTCURL 脚本安装 rvmCURL 高级检查网站响应时间使用 Curl 检查远程资源是否可用正在下载文件下载文件,保存文件而不更改其名称继续部分下载从多个域下载文件下载一系列文件入门 介绍 Curl 是一种在服务器之间传输数据的工具,支持协议,包括 HTTP/FTP/IMAP/LDAP/POP3/SCP/SFTP/SMB/SMTP 等 @@ -61,7 +63,7 @@ -I # --head: 仅标头 请求 --X POST # --request +-X POST # --request -L # 如果页面重定向,请点击链接 -F # --form: multipart/form-data 的 HTTP POST 数据 @@ -150,7 +152,7 @@ 为 curl 响应美化 json 输出 -$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool +$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool CURL POST @@ -221,14 +223,14 @@ 检查网站响应时间 -curl -s -w \ +curl -s -w \ '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' \ -o /dev/null https://www.google.com 使用 Curl 检查远程资源是否可用 -curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz +curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz 正在下载文件 @@ -249,17 +251,17 @@ 继续部分下载 -curl --remote-name --continue-at - "https://example.com/linux-distro.iso" +curl --remote-name --continue-at - "https://example.com/linux-distro.iso" 从多个域下载文件 -curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html" +curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html" 下载一系列文件 -curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp" +curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp" 下载一系列文件(输出foo_file1.webp、foo_file2.webp…bar_file1_webp等) @@ -267,6 +269,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -280,6 +283,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/docker.html b/docs/docker.html index 0cc02c81..3bdc2b50 100644 --- a/docs/docker.html +++ b/docs/docker.html @@ -1,6 +1,6 @@ - - - + + + Docker 备忘清单 & docker cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Docker 备忘清单 这是 Docker 的快速参考备忘单。 你可以在这里找到最常见的 Docker 命令。 -入门 + + +入门入门一般命令Docker 容器启动和停止说明创建容器实例操控Docker 镜像操控构建镜像Docker 网络操作创建网络各种各样的Docker Hub镜像仓库命令批量清除卷 volumeDocker ComposeDocker ServicesDocker StackDocker Machine另见入门 入门 在后台创建和运行容器 @@ -615,6 +617,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -628,6 +631,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/dockerfile.html b/docs/dockerfile.html index 22581575..a65e0c70 100644 --- a/docs/dockerfile.html +++ b/docs/dockerfile.html @@ -1,6 +1,6 @@ - - - + + + Dockerfile 备忘清单 & dockerfile cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Dockerfile 备忘清单 这是 Dockerfile 的快速参考备忘单。包含用户可以在命令行上调用以组装镜像的所有命令。 -参考 + + +参考继承继承变量 ENV初始化Onbuild在严格的 shell 中运行命令命令 CMD入口点 ENTRYPOINT元数据 LABELARG.dockerignore 文件主要命令服务静态网站的最小 Docker 镜像也可以看看参考 继承 默认 Dockerfile 位于上下文的根目录中。 @@ -49,7 +51,7 @@ 使用 -f 指向文件系统中任何位置的 Dockerfile。 继承 -FROM [--platform=<platform>] <image> [AS <name>] +FROM [--platform=<platform>] <image> [AS <name>] 示例 @@ -76,13 +78,13 @@ VOLUME ["/data"] # 安装点规范 -ADD file.xyz /file.xyz +ADD file.xyz /file.xyz # 复制 COPY --chown=user:group host_file.xyz /path/container_file.xyz Onbuild -ONBUILD RUN bundle install +ONBUILD RUN bundle install # 与另一个文件一起使用时 ONBUILD ADD . /app/src @@ -91,7 +93,7 @@ 指令将触发指令添加到镜像中,以便稍后执行,此时镜像用作另一个构建的基础。 在严格的 shell 中运行命令 -ENV my_var +ENV my_var SHELL ["/bin/bash", "-euo", "pipefail", "-c"] # 使用严格模式: RUN false # ails 像使用 && 一样构建 @@ -129,7 +131,7 @@ CMD ["bundle", "exec", "rails", "server"] 入口点 ENTRYPOINT -ENTRYPOINT ["executable", "param1", "param2"] +ENTRYPOINT ["executable", "param1", "param2"] ENTRYPOINT command param1 param2 @@ -140,7 +142,7 @@ 元数据 LABEL LABEL version="1.0" -LABEL "com.example.vendor"="ACME Incorporated" +LABEL "com.example.vendor"="ACME Incorporated" LABEL com.example.label-with-value="foo" LABEL version="1.0" @@ -272,6 +274,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -285,6 +288,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/electron.html b/docs/electron.html index 7d961542..7a740b59 100644 --- a/docs/electron.html +++ b/docs/electron.html @@ -1,6 +1,6 @@ - - - + + + Electron 备忘清单 & electron cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -41,7 +41,9 @@ Electron 备忘清单 此快速参考备忘单提供了 Electron v21 API 说明和使用示例。 -入门 + + +入门快速开始创建你的应用程序关闭所有窗口时退出应用创建无边框窗口自定义标题栏样式控制红绿灯 (macOS)通过预加载脚本从渲染器访问 Node.js将的 process.versions 对象暴露给渲染器启用拼写检查器app事件绑定方法使用示例方法启动时激活主实例窗口的示例事件属性BrowserWindow参数实例事件实例方法静态方法实例属性另见入门 快速开始 Electron 是一个使用 JavaScript、HTML 和 CSS 构建桌面应用程序的框架 @@ -2003,6 +2005,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -2016,6 +2019,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/emmet.html b/docs/emmet.html index 898f7275..96eb3243 100644 --- a/docs/emmet.html +++ b/docs/emmet.html @@ -1,6 +1,6 @@ - - - + + + Emmet 备忘清单 & emmet cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ Emmet 备忘清单 Emmet 是一个用于提升 HTML 和 CSS 代码编写的 Web 开发人员工具包,它允许您使用著名的 CSS 选择器以光速编写大型 HTML 代码块。 -
此 Curl 备忘清单包含命令和一些常见的 Curl 技巧示例。
Curl 是一种在服务器之间传输数据的工具,支持协议,包括 HTTP/FTP/IMAP/LDAP/POP3/SCP/SFTP/SMB/SMTP 等
-X POST # --request +-X POST # --request -L # 如果页面重定向,请点击链接 -F # --form: multipart/form-data 的 HTTP POST 数据 @@ -150,7 +152,7 @@
-X POST # --request -L # 如果页面重定向,请点击链接 -F # --form: multipart/form-data 的 HTTP POST 数据
$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool +$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool
$ curl -XGET http://${elasticsearch_ip}:9200/_cluster/nodes | python -m json.tool
curl -s -w \ +curl -s -w \ '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' \ -o /dev/null https://www.google.com
curl -s -w \ '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' \ -o /dev/null https://www.google.com
curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz +curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz
curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz
curl --remote-name --continue-at - "https://example.com/linux-distro.iso" +curl --remote-name --continue-at - "https://example.com/linux-distro.iso"
curl --remote-name --continue-at - "https://example.com/linux-distro.iso"
curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html" +curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html"
curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html"
curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp" +curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp" 下载一系列文件(输出foo_file1.webp、foo_file2.webp…bar_file1_webp等) @@ -267,6 +269,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -280,6 +283,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/docker.html b/docs/docker.html index 0cc02c81..3bdc2b50 100644 --- a/docs/docker.html +++ b/docs/docker.html @@ -1,6 +1,6 @@ - - - + + + Docker 备忘清单 & docker cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Docker 备忘清单 这是 Docker 的快速参考备忘单。 你可以在这里找到最常见的 Docker 命令。 -入门 + + +入门入门一般命令Docker 容器启动和停止说明创建容器实例操控Docker 镜像操控构建镜像Docker 网络操作创建网络各种各样的Docker Hub镜像仓库命令批量清除卷 volumeDocker ComposeDocker ServicesDocker StackDocker Machine另见入门 入门 在后台创建和运行容器 @@ -615,6 +617,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -628,6 +631,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/dockerfile.html b/docs/dockerfile.html index 22581575..a65e0c70 100644 --- a/docs/dockerfile.html +++ b/docs/dockerfile.html @@ -1,6 +1,6 @@ - - - + + + Dockerfile 备忘清单 & dockerfile cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -39,7 +39,9 @@ Dockerfile 备忘清单 这是 Dockerfile 的快速参考备忘单。包含用户可以在命令行上调用以组装镜像的所有命令。 -参考 + + +参考继承继承变量 ENV初始化Onbuild在严格的 shell 中运行命令命令 CMD入口点 ENTRYPOINT元数据 LABELARG.dockerignore 文件主要命令服务静态网站的最小 Docker 镜像也可以看看参考 继承 默认 Dockerfile 位于上下文的根目录中。 @@ -49,7 +51,7 @@ 使用 -f 指向文件系统中任何位置的 Dockerfile。 继承 -FROM [--platform=<platform>] <image> [AS <name>] +FROM [--platform=<platform>] <image> [AS <name>] 示例 @@ -76,13 +78,13 @@ VOLUME ["/data"] # 安装点规范 -ADD file.xyz /file.xyz +ADD file.xyz /file.xyz # 复制 COPY --chown=user:group host_file.xyz /path/container_file.xyz Onbuild -ONBUILD RUN bundle install +ONBUILD RUN bundle install # 与另一个文件一起使用时 ONBUILD ADD . /app/src @@ -91,7 +93,7 @@ 指令将触发指令添加到镜像中,以便稍后执行,此时镜像用作另一个构建的基础。 在严格的 shell 中运行命令 -ENV my_var +ENV my_var SHELL ["/bin/bash", "-euo", "pipefail", "-c"] # 使用严格模式: RUN false # ails 像使用 && 一样构建 @@ -129,7 +131,7 @@ CMD ["bundle", "exec", "rails", "server"] 入口点 ENTRYPOINT -ENTRYPOINT ["executable", "param1", "param2"] +ENTRYPOINT ["executable", "param1", "param2"] ENTRYPOINT command param1 param2 @@ -140,7 +142,7 @@ 元数据 LABEL LABEL version="1.0" -LABEL "com.example.vendor"="ACME Incorporated" +LABEL "com.example.vendor"="ACME Incorporated" LABEL com.example.label-with-value="foo" LABEL version="1.0" @@ -272,6 +274,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -285,6 +288,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/electron.html b/docs/electron.html index 7d961542..7a740b59 100644 --- a/docs/electron.html +++ b/docs/electron.html @@ -1,6 +1,6 @@ - - - + + + Electron 备忘清单 & electron cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -41,7 +41,9 @@ Electron 备忘清单 此快速参考备忘单提供了 Electron v21 API 说明和使用示例。 -入门 + + +入门快速开始创建你的应用程序关闭所有窗口时退出应用创建无边框窗口自定义标题栏样式控制红绿灯 (macOS)通过预加载脚本从渲染器访问 Node.js将的 process.versions 对象暴露给渲染器启用拼写检查器app事件绑定方法使用示例方法启动时激活主实例窗口的示例事件属性BrowserWindow参数实例事件实例方法静态方法实例属性另见入门 快速开始 Electron 是一个使用 JavaScript、HTML 和 CSS 构建桌面应用程序的框架 @@ -2003,6 +2005,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -2016,6 +2019,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/emmet.html b/docs/emmet.html index 898f7275..96eb3243 100644 --- a/docs/emmet.html +++ b/docs/emmet.html @@ -1,6 +1,6 @@ - - - + + + Emmet 备忘清单 & emmet cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ Emmet 备忘清单 Emmet 是一个用于提升 HTML 和 CSS 代码编写的 Web 开发人员工具包,它允许您使用著名的 CSS 选择器以光速编写大型 HTML 代码块。 -
curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp"
下载一系列文件(输出foo_file1.webp、foo_file2.webp…bar_file1_webp等)
foo_file1.webp
foo_file2.webp…bar_file1_webp
这是 Docker 的快速参考备忘单。 你可以在这里找到最常见的 Docker 命令。
在后台创建和运行容器
这是 Dockerfile 的快速参考备忘单。包含用户可以在命令行上调用以组装镜像的所有命令。
默认 Dockerfile 位于上下文的根目录中。
Dockerfile
使用 -f 指向文件系统中任何位置的 Dockerfile。
-f
FROM [--platform=<platform>] <image> [AS <name>] +FROM [--platform=<platform>] <image> [AS <name>] 示例 @@ -76,13 +78,13 @@ VOLUME ["/data"] # 安装点规范 -ADD file.xyz /file.xyz +ADD file.xyz /file.xyz # 复制 COPY --chown=user:group host_file.xyz /path/container_file.xyz
FROM [--platform=<platform>] <image> [AS <name>]
示例
VOLUME ["/data"] # 安装点规范
ADD file.xyz /file.xyz +ADD file.xyz /file.xyz # 复制 COPY --chown=user:group host_file.xyz /path/container_file.xyz
ADD file.xyz /file.xyz # 复制 COPY --chown=user:group host_file.xyz /path/container_file.xyz
ONBUILD RUN bundle install +ONBUILD RUN bundle install # 与另一个文件一起使用时 ONBUILD ADD . /app/src @@ -91,7 +93,7 @@ 指令将触发指令添加到镜像中,以便稍后执行,此时镜像用作另一个构建的基础。
ONBUILD RUN bundle install # 与另一个文件一起使用时 ONBUILD ADD . /app/src @@ -91,7 +93,7 @@ 指令将触发指令添加到镜像中,以便稍后执行,此时镜像用作另一个构建的基础。
指令将触发指令添加到镜像中,以便稍后执行,此时镜像用作另一个构建的基础。
ENV my_var +ENV my_var SHELL ["/bin/bash", "-euo", "pipefail", "-c"] # 使用严格模式: RUN false # ails 像使用 && 一样构建 @@ -129,7 +131,7 @@ CMD ["bundle", "exec", "rails", "server"]
ENV my_var SHELL ["/bin/bash", "-euo", "pipefail", "-c"] # 使用严格模式: RUN false # ails 像使用 && 一样构建 @@ -129,7 +131,7 @@ CMD ["bundle", "exec", "rails", "server"]
ENTRYPOINT ["executable", "param1", "param2"] +ENTRYPOINT ["executable", "param1", "param2"] ENTRYPOINT command param1 param2 @@ -140,7 +142,7 @@
ENTRYPOINT ["executable", "param1", "param2"] ENTRYPOINT command param1 param2
LABEL version="1.0"
LABEL "com.example.vendor"="ACME Incorporated" +LABEL "com.example.vendor"="ACME Incorporated" LABEL com.example.label-with-value="foo" LABEL version="1.0" @@ -272,6 +274,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -285,6 +288,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/electron.html b/docs/electron.html index 7d961542..7a740b59 100644 --- a/docs/electron.html +++ b/docs/electron.html @@ -1,6 +1,6 @@ - - - + + + Electron 备忘清单 & electron cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -41,7 +41,9 @@ Electron 备忘清单 此快速参考备忘单提供了 Electron v21 API 说明和使用示例。 -入门 + + +入门快速开始创建你的应用程序关闭所有窗口时退出应用创建无边框窗口自定义标题栏样式控制红绿灯 (macOS)通过预加载脚本从渲染器访问 Node.js将的 process.versions 对象暴露给渲染器启用拼写检查器app事件绑定方法使用示例方法启动时激活主实例窗口的示例事件属性BrowserWindow参数实例事件实例方法静态方法实例属性另见入门 快速开始 Electron 是一个使用 JavaScript、HTML 和 CSS 构建桌面应用程序的框架 @@ -2003,6 +2005,7 @@ if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { window.onhashchange = function () { anchorPoint() + updateAnchor() }; } function anchorPoint() { @@ -2016,6 +2019,25 @@ function anchorPoint() { } } anchorPoint(); - - \ No newline at end of file +function updateAnchor(element) { + const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); + anchorContainer.forEach((tocanchor) => { + tocanchor.classList.remove('is-active-link'); + }); + const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); + console.log('anchor', anchor) + if (anchor) { + anchor.classList.add('is-active-link'); + } +} +// toc 定位 +updateAnchor() +const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); +anchor.forEach((item) => { + item.addEventListener('click', (e) => { + updateAnchor() + }) +}) + + diff --git a/docs/emmet.html b/docs/emmet.html index 898f7275..96eb3243 100644 --- a/docs/emmet.html +++ b/docs/emmet.html @@ -1,6 +1,6 @@ - - - + + + Emmet 备忘清单 & emmet cheatsheet & Quick Reference @@ -9,8 +9,8 @@ - - + + @@ -38,7 +38,9 @@ Emmet 备忘清单 Emmet 是一个用于提升 HTML 和 CSS 代码编写的 Web 开发人员工具包,它允许您使用著名的 CSS 选择器以光速编写大型 HTML 代码块。 -
LABEL "com.example.vendor"="ACME Incorporated" LABEL com.example.label-with-value="foo" LABEL version="1.0"
此快速参考备忘单提供了 Electron v21 API 说明和使用示例。
Electron 是一个使用 JavaScript、HTML 和 CSS 构建桌面应用程序的框架
Emmet 是一个用于提升 HTML 和 CSS 代码编写的 Web 开发人员工具包,它允许您使用著名的 CSS 选择器以光速编写大型 HTML 代码块。