This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by https://www.gitignore.io/api/node,bower,osx,linux,windows,dropbox,sass,less,grunt,sublimetext,code | |
### Node ### | |
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
# Runtime data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ========================================================== | |
# NPM | |
# ========================================================== | |
npm set registry https://r.npm.taobao.org # 注册模块镜像 | |
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像 | |
## 以下选择添加 | |
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像 | |
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/cdoco/common-regex | |
'1231231.4314'.replace(/\B(?=(\d{3})+(?!\d))/g, ',') | |
会切割小数点后 | |
'1231231.4314'.replace(/(?<!\.\d*)\B(?=(\d{3})+(?!\d))/g, ",") | |
px 转成 vw | |
" margin: 42px 15px 15px 15px;".replace(/(\s)(?=\d*px)/g, ' \(').replace(/px/g, 'vw\/3.75\)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Centos7使用SSH,禁用密码登录方法: | |
1、 | |
# 若没安装openssh,则yum install openssh-server | |
# 开启sshd, sudo systemctl enable sshd | |
# sudo systemctl start sshd 或者 sudo service sshd start | |
# 开启防火墙的22端口 | |
# sudo firewall-cmd --zone=public --add-port=22/tcp --permanent | |
# sudo service firewalld restart | |
2、 | |
# 编辑/etc/ssh/sshd_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
babel处理es系列向后兼容,当前版本7 | |
配置文件为.babelrc | |
有插件系统,可以兼容最新协议草案,比如 | |
"plugins": ["@babel/plugin-proposal-class-properties"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esprima : 从JavaScript源代码形成AST | |
estraverse:遍历树的节点并修改 | |
escodegen : 把修改完的AST再次转化为源代码 | |
recast: 重铸JS | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 克隆源码 | |
cd /usr/local | |
git clone https://github.com/inconshreveable/ngrok.git | |
2. 引入环境变量 | |
export GOPATH=/usr/local/ngrok/ #目录位置 | |
export NGROK_DOMAIN="ngrok.yourset.com" #你的ngrok服务二级域名 | |
3. 根据你的域名生成证书 | |
openssl genrsa -out rootCA.key 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.sudo rm -rf /usr/local/go | |
sudo rm -rf /usr/bin/go | |
2.wget https://dl.google.com/go/go1.10.4.linux-amd64.tar.gz | |
sudo tar -xzf go1.10.4.linux-amd64.tar.gz -C /usr/local | |
sudo ln -s /usr/local/go/bin/ /usr/bin/ | |
3.mkdir -p $HOME/go-workspace/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
我们在安装Python3(>=3.3)时,Python的安装包实际上在系统中安装了一个启动器py.exe,默认放置在文件夹C:\Windows\下面 | |
py -2 hello.py | |
py -3 hello.py | |
py.exe这个启动器允许你在代码中加入说明 | |
#! python2 | |
#! python3 | |
使用 | |
py hello.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const merge = (target, source) => { | |
const keys = Object.keys(target); | |
keys.forEach(k => { | |
if (source.hasOwnProperty(k)) { | |
if (Object.prototype.toString.call(source[k]) === '[object Object]') { | |
merge(target[k], source[k]); | |
} else { | |
target[k] = source[k]; |
NewerOlder