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
# 安装keychain ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" && brew install keychain | |
eval `keychain --eval id_rsa` | |
# 服务器简称 | |
alias ssh='ssh -A -o ConnectTimeout=3 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' | |
alias gw1="ssh -A [email protected]" | |
alias gw2="ssh -A [email protected]" | |
alias qagw1="ssh -A [email protected]" | |
alias qagw2="ssh -A [email protected]" | |
alias tencent="ssh -A [email protected]" |
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.密码长度为[6-16]位,可以包含数字、字母、特殊符号 | |
* 2.当密码含有一种类型(数字、字母、特殊符号),且长度小于8时,强度为弱;长度大于8时强度为中; | |
* 3.当密码含有一种类型(数字、字母、特殊符号),且长度小于8时,强度为弱;长度大于8时强度为中; | |
*/ | |
function verifyPassword(val){ | |
val = val.trim(); |
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
// 校验密码包含数字和字母,且长度在6到30个字符 | |
/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,30}$/ | |
// 手机号码加密 | |
'18883339779'.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3') | |
// 匹配中文,字母,数字,或者下划线 | |
[a-zA-Z0-9_-/u4e00-/u9fa5]+ |
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
<script> | |
// 是否加入调试js | |
if (window.location.search.indexOf('debug=1') > -1) { | |
let script1 = document.createElement('script'); | |
let script2 = document.createElement('script'); | |
script1.src = '//s.thsi.cn/js/m/kh/page-creator/js/vconsole.min.js'; | |
script2.innerHTML = "var vconsole = new VConsole();"; | |
document.head.appendChild(script1); | |
script1.onload = () => { | |
console.log(`已经打开调试`); |
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
# 查找文件并批量重命名 | |
find . -name "*Editor.js" | xargs rm -f | |
find . -name "index.js" | xargs rm -f | |
find . -name "index.js" | xargs rm -f | |
find . -name "*Preview.js" -exec mv {} index.js \; | |
# 首行添加一段文字 | |
sed -i '1i/* eslint-disable */' aaa.txt | |
# 杀死所有node进程 |
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
var fs = require('fs'); | |
var stats = fs.statSync("c:\\dog.jpg"); | |
console.log('is file ? ' + stats.isFile()); | |
var stats = fs.statSync("c:\\demo"); | |
console.log('is directory ? ' + stats.isDirectory()); |
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
.overflow { | |
/*隐藏滚动条,当IE下溢出,仍然可以滚动*/ | |
-ms-overflow-style: none; | |
/*火狐下隐藏滚动条*/ | |
overflow-y: auto; | |
overflow-y: -moz-scrollbars-none; | |
overflow-x: hidden; | |
&::-webkit-scrollbar { | |
width: 0px; | |
} |
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
const headerNums = new Array("139","138","137","136","135","134","159","158","157","150","151","152","188","187","182","183","184","178","130","131","132","156","155","186","185","176","133","153","189","180","181","177"); | |
const headerNum = headerNums[parseInt(Math.random() * 10 ,10)] | |
const bodyNum = Math.random().toString().replace('0.', '').slice(0, 8) | |
console.log(headerNum + bodyNum) |
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
<div class="coordinate_out"> | |
<div id="coordinate">内部</div> | |
</div> |