哈尔滨人, 写代码, 打篮球.
any86 / notes Goto Github PK
View Code? Open in Web Editor NEW:rocket: 笔记
Home Page: https://github.com/any86/Notes/issues
:rocket: 笔记
Home Page: https://github.com/any86/Notes/issues
mkdir -p /root/nginx/www /root/nginx/logs /root/nginx/conf
docker run -d -p 80:80 --name nginx-web -v /root/nginx/www:/usr/share/nginx/html -v /root/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /root/nginx/logs:/var/log/nginx nginx
参考: https://developer.mozilla.org/zh-CN/docs/Web/API/XMLHttpRequest/abort
简单的说, 对上传xhr对象使用abort方法.
currentTarget表示绑定事件的元素
target表示触发事件的元素, 其可能是绑定元素的子节点或者父节点, 根据冒泡还是捕获方向不同而不同.
循环的关键就是前后各放复制一些的节点, 当切换到复制的节点上的时候, 当touchstrat触发, 那么无动画的切换到真实的一张上, 比如从尾部的一张(克隆的第一张), touchstart后, 无动画切换到真实的第一张
起因是npm list那句报错, 无脑的不用npm用yarn喽:
vsce package --yarn
这里我们用到了svg
data:image/svg+xml;utf8,<svg fill="${placeholderBackgroundColor}" width="1" height="1" version="1.1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" /></svg>
我们只需要传入placeholderBackgroundColor
就可以得到任意颜色placeholder~
node.firstChild !== null
node.childNodes.length > 0
node.hasChildNodes()
// 是否支持touch事件
export const SUPPORT_TOUCH = ('ontouchstart' in window);
// jest.config.js
module.exports = {
...
globals: {
ontouchstart: null
}
};
一定主要要安装中文版, 不然安装“推荐插件“会失败, 因为英文版插件需要翻墙才能下载。
docker pull docker.io/jenkins/jenkins
docker run -d -p 8081:8080 -p 50000:50000 -v jenkins:/var/jenkins_home -v /etc/localtime:/etc/localtime --name myjenkins docker.io/jenkins/jenkins
docker exec myjenkins tail /var/jenkins_home/secrets/initialAdminPassword
因为用了scope, 那么子组件是没法集成父组件的样式的, 但是最近发现,
如果你希望 scoped 样式中的一个选择器能够作用得“更深”,例如影响子组件,你可以使用 >>> 操作符:
<style scoped>
.a >>> .b { /* ... */ }
</style>
// 切换成默认安装标签
npm dist-tag add [email protected] latest
// 切换成next标签
npm dist-tag add [email protected] next
转载: http://www.feelcss.com/touchevent.html
touches
: 当前屏幕上所有触摸点的集合列表
targetTouches
: 绑定事件的那个结点上的触摸点的集合列表
changedTouches
: 触发事件时改变的触摸点的集合
举例来说,比如div1, div2只有div2绑定了touchstart事件,
第一次放下一个手指在div2上,触发了touchstart事件,这个时候,三个集合的内容是一样的
,都包含这个手指的touch,
然后,再放下两个手指一个在div1上
,一个在div2上,这个时候又会触发事件,但changedTouches里面只包含第二个第三个手指的信息,因为第一个没有发生变化,而targetTouches包含的是在第一个手指和第三个在div2上的手指集合,touches包含屏幕上所有手指的信息,也就是三个手指。
现在哪个公司招聘上不写着有github开源经历的加分, 如果你还不能自己独立完成一个开源项目, 但是还想凑个热闹慢慢学习, 你可以从帮助别人找代码或者文档的bug开始.
如果你发现了一个项目的bug, 你该如何改正并提交给作者呢? pr就是这样一个功能.
1.fork目标项目
2.clone项目到本地
3.修改代码然后commit
4.pull request
fork就是在自己仓库生成一个目标项目的镜像.
git clone https://github.com/any86/any-touch.git
这里是指克隆"fork到自己仓库的项目"的代码到本地.
比如我们修改README.md文件
git add README.md
git commit -m "docs: 修改标题"
git push
如果修改的文件比较多, git add README.md
替换成git add .
, 这样会把所有修改的文件移动到暂存区.
好了, 现在我们的线上仓库已经是最新的了, 接下来把我们的代码pull(推)到目标项目.
很简单的一个功能介绍, 感谢大家阅读, 如果需要做 pr 练习可以用我的 github 练习. 欢迎 pr.
git config core.ignorecase false
git rm -r --cached .
git add .
git commit -m 'fix: 修复git大小写不敏感造成的文件未上传'
git push
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe"
version: 2
jobs:
build:
branches:
only:
- master
或者
version: 2
jobs:
build:
branches:
ignore:
- xxx
- xxx
或者
提交信息中包含"[ci skip]"
5>>1 // 1
// 等同于
Math.floor(5/2)
5 >> 2 // Math.floor(5 / (2*2))
5 >> 3 // Math.floor(5 / (2*2*2))
C:\Users\Ning\pip\pip.ini
[global]
trusted-host = mirrors.aliyun.com
index-url = https://mirrors.aliyun.com/pypi/simple
const NodeRSA = require("node-rsa")
const key = new NodeRSA({b: 2048});
const publicDer = key.exportKey('pkcs1-public-pem'); //公钥
const privateDer = key.exportKey('pkcs1-private-pem');//私钥
console.log(publicDer,privateDer)
先介绍下的3个路径的含义.
根目录
当前目录
上级目录
path.resolve可以理解为cd命令., 那么官网的例子就好理解了:
path.resolve('/foo/bar', './baz');
// 返回: '/foo/bar/baz'
path.resolve('/foo/bar', '/tmp/file/');
// 返回: '/tmp/file'
path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif');
// 如果当前工作目录是 /home/myself/node,
// 则返回 '/home/myself/node/wwwroot/static_files/gif/image.gif'
2.打开https://fastly.net.ipaddress.com/github.global.ssl.fastly.net#ipinfo
3.打开https://github.com.ipaddress.com/assets-cdn.github.com
4.打开电脑的hosts文件,把下列的东东写在最后,然后保存即可
140.82.113.4 github.com
199.232.69.194 github.global.ssl.fastly.net
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
按照vue作者的说法$destroy中并没有做事件解绑, 而是等待系统回收内存, 所以$destroy因该只是做了解除数据绑定.
vuejs/vue#5187
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
service docker start
docker run -d --name myjenkins -p 8081:8080 -p 50000:50000 -v /var/jenkins_home docker.io/jenkins/jenkins
docker exec myjenkins tail /var/jenkins_home/secrets/initialAdminPassword
npm install -g yo generator-code
yo code
github.global.ssl.fastly.net
C:\Windows\System32\drivers\etc\hosts
ipconfig /flushdns
在开发中修改第三方组件样式是很常见,但由于 scoped 属性的样式隔离,可能需要去除 scoped 或是另起一个 style 。这些做法都会带来副作用(组件样式污染、不够优雅),样式穿透在css预处理器中使用才生效。
我们可以使用 >>> 或 /deep/ 解决这一问题:
<style scoped>
外层 >>> .el-checkbox {
display: block;
font-size: 26px;
.el-checkbox__label {
font-size: 16px;
}
}
</style>
<style scoped>
/deep/ .el-checkbox {
display: block;
font-size: 26px;
.el-checkbox__label {
font-size: 16px;
}
}
</style>
对于sass-loader版本比较高的可以使用::v-deep
<style scoped>
::v-deep .el-checkbox {
display: block;
font-size: 26px;
.el-checkbox__label {
font-size: 16px;
}
}
</style>
yarn add 5a.css@latest --registry=https://registry.npmjs.org/
class A{
n: number
}
const num: A['n'] // number
state:比较常用,各种状态都可以用它,但是它更着重于一种心理状态或者物理状态。
Status:用在人的身上一般是其身份和地位,作“状态,情形”讲时,多指政治和商业。
state倾向于condition,是一种延续性的状态。status常用于描述一个过程中的某阶段(phase),类似于C语言中枚举型变量某一个固定的值,这个值属于一个已知的集合。
比如淘宝买家问卖家“我的网购现在是什么状况?”
这个问题的背景是讲话双方都清楚,交易状态有“买家选购”“买家已付款”“卖家已发货”“买家已签收”或者有“买家已
投诉”等等状态。这些状态描述一件事情发展过程中的不同阶段。而且,这些阶段的先后顺序也是双方默许的。
所以在这里可以问“What's the status of my purchase?”,此处用state不太贴切,如果硬用上去从语感上可能听着别扭。
说物态变化用state再恰当不过。如果说一个物质的四种状态,可以说“solid state”,但如果你说“solid status”,第
一,这两个词的组合不像是描述物态,更像是在说“确定的状况(solid产生歧义‘确定的/确凿的’)”;第二,这个说法即
使不被误解,也需要事先约定一组物态变化顺序,比如把这个物质从固态开始加热然后电离,可能先后经历固态、液态、气态、等离子态这四个阶段。类似先定义枚举,然后引用的方式。
扩展:
ajax中readyState,statusText,onreadystatechange,window.status怎么一会state一会是status都晕乎了
state所指的状态,一般都是有限的、可列举的,status则是不可确定的。
比如
readyState -- 就那么四五种值
statusText -- 描述性的文字,可以任意
onreadystatechange -- 那么四五种值之间发生变化
window.status -- 描述性的文字,可以任意
来个形象的比方,你体重多少公斤,属于status,但说你体重属于偏瘦、正常还是偏胖,那就是state.
因为数据库中的表必须有数据才显示.
function lengthOfLIS (nums) {
const { length } = nums;
const dp = new Array(length);
dp.fill(1);
for (let i = 1; i < length; i++) {
for (let j = 0; j < i; j++) {
if (nums[j] < nums[i]) {
dp[i] = Math.max(dp[i], dp[j] + 1);
}
}
}
return dp;
}
VUE_APP_UPLOAD_URL = 'http://127.0.0.1:3000/upload2'
进入项目后, 执行如下命令
git init
git remote add origin 目标git地址
git pull origin master --allow-unrelated-histories
git checkout --orphan new-brance
查了半天很多都说运行,下面2条命令
npm cache verify
npm cache clean --force
但是... 这里提示可能登录, 一试还真是没登录, 只是以前没登录会提示没登录, 现在提示4048, node版本10
如果是从npm引入的包, 比如import $ from 'jquery'
, 三者无区别, 但是如果你想处理自己引入的文件, 如: import $ from '../AnyTouch'
, 你会发现3者的不同:
"external"返回的id就是'../AnyTouch', 但是"paths/globals"返回的确是绝对地址
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.