输入
$ tree
输出
.
├── dist
├── index.css
├── index.html
├── index.js
└── node_modules
2 directories, 3 files
假设目录下存在index.html, index.css, index.js, node_modules 等文件或目录。
利用 find 命令找出当前目录下不包含node_moduels的文件或文件夹
输入
$ find . -maxdepth 1 -not -name node_moduels
输出
./dist
./index.css
./index.html
./index.js
利用 find 命令将目录下非node_modules的文件或目录复制到dist目录。
$ find . -maxdepth1 -not -name node_modules -not -name dist|xargs -J % cp -r % dist
查看结果
$ ls dist
输出
index.css index.html index.js
...用 gulp 自动编译 pug 时,有时 pug 有语法错误就会编译不通过,gulp 的进程就会中断,导致需要重新运行 gulp,这是因为 gulpfile.js 文件中缺少了对错误的处理。
var gulp = require('gulp'),
pug = require('gulp-pug');
var files = {
pug: 'pug/*.pug',
markup: ['pug/*.pug', 'pug/**/*.html'],
styles: 'scss/*.scss',
scripts: 'js/*.js'
}
gulp.task('pug', function(){
return gulp.src(files.pug)
.pipe(pug({
pretty: true
}).on('error', function(e){
console.log('pug went wrong.');
console.log(e.message);
th
...一款好的编辑器当然要有好的特性,什么替换、跳转、多光标已是标配,想要再增加些已是困难。然而 VS CODE 还有一些不为人知的快捷键,有了他们,再也不用担心赶不上 VIM 了。
VIM 和 VS CODE 都有跳转到某行,在 VS CODE中,快捷键是 Ctrl + G,然后输入行, 列。然后跳转后想要回到之前的位置,该怎么办呢?也许可以同样用 Ctrl + G,不过前提是你得记得跳转前的行列才行呀。
于是快捷键 Alt + ← 诞生了。
VIM 由于有三种模式,编辑引号、括号之间的内容的命令是有的。在 VS CODE 中,假设你的光标在引号之间,按下快捷键 Shift + Alt + →,就可以选择引号之间的文本。免去按下 Shift 加方向键的烦恼。
哈哈哈,其实也没啥。
Ctrl + F2 选中所有相同的单词
Ctrl + Shift + L 选中所有相同的选区
Ctrl + U 撤销最后一次添加的多光标
Shift + Alt + ↓ 快捷复制一行
参考 https://code
...在 webkit 内核的浏览器中使用线性渐变色。
-webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #fd7139), color-stop(0.5, #f04603), color-stop(1, #fd7139) );
表示线性的,以坐标(0 0)为起点,坐标(0 100%)为终点,在0.5中间位置使用颜色#f04603,在0开始位置和1末尾位置使用颜色#fd7139的渐变色。即从水平中间向上下渐变的渐变色。
用 CSS 渐变色做的动作按钮
.bonusAction{
background: -webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #fd7139), color-stop(0.5, #f04603), color-stop(1, #fd7139) );
border: none;
text-align: center;
color: #fcc0a8;
font-size: 1rem;
display: inline-
...