1. 只有函数有 prototype 属性。默认情况下,func.ptototype = {constructor: func} ,即 func.ptototype.constructor == func
2. 任何对象都有 __proto__ 属性,指向自己的 [[Prototype]] ,即原型链的上一层
3. 例如,var c = new func() ,则 c.__proto__ === func.ptototype
4. 如果 var c = 1 ,约等于 var c = Number(1) ,因此 c.__proto__ === Number.prototype
5. 可以看到 x.__proto__ 永远都不会是一个函数,但是永远都会是某个 func.prototype
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
certificate verify failed: unable to get local issuer certificate | |
sudo /Applications/Python\ 3.8/Install\ Certificates.command |
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
echo "rdr pass proto tcp from any to any port {9111} -> 127.0.0.1 port 5555" | sudo pfctl -Ef - | |
sudo pfctl -s nat | |
编辑 | |
sudo vim /etc/pf.anchors/custom | |
清理: |
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
设置VPN服务器 https://jonsview.com/how-to-setup-os-x-10-9-as-a-l2tp-vpn-server-without-apples-server-app | |
设置自动开机 sudo pmset autorestart 1 |
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
adb shell pm list packages | |
adb shell pm clear com.package.app | |
adb uninstall com.package.app | |
adb install -t debug.apk |
- 如果判断一个元素是否在DOM中可见?
return (el.offsetParent === null)
见 https://stackoverflow.com/questions/19669786/check-if-element-is-visible-in-dom
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
[global] | |
index-url=https://pypi.tuna.tsinghua.edu.cn/simple | |
trusted-host=pypi.tuna.tsinghua.edu.cn | |
disable-pip-version-check=true | |
timeout=30 |
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
cd "$(brew --repo)" | |
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git | |
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" | |
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git | |
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc | |
source ~/.zshrc | |
npm config set registry http://registry.npm.taobao.org/ |
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
def json_structure(j): | |
""" | |
JSON有三种结构:字面值(int, bool, str), dict, list | |
为简化处理,将list通过转换视为dict结构,key为序号。 | |
["a", 1] -> {"0": "a", "1": 1} | |
这个函数返回json的结构信息,"值"会被丢弃。 | |
{"a": 1, "b": ["n", false]} | |
-> |
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
REQ: GET /api/v1/object/{number}/property | |
REQ: POST /api/v1/object/{number}/action | |
{"xx": "xx"} | |
RES: { | |
"code": 0/1/-1, | |
"msg": "", | |
"resp": { | |
} |
NewerOlder