From 4cb5c8b4de6913a6020fe695bcb341be0a0a9750 Mon Sep 17 00:00:00 2001 From: RainSun Date: Sat, 18 Jan 2020 15:48:20 +0800 Subject: [PATCH] update --- Miscellaneous/flask.md | 4 +++- Miscellaneous/javascript2.md | 32 ++++++++++++++++++++++++++++++++ Miscellaneous/nginx.conf | 24 ++++++++++++++++++++++++ Miscellaneous/test.js | 9 ++++++++- 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 Miscellaneous/javascript2.md diff --git a/Miscellaneous/flask.md b/Miscellaneous/flask.md index b04b9d0..ba2cf96 100644 --- a/Miscellaneous/flask.md +++ b/Miscellaneous/flask.md @@ -44,6 +44,7 @@ `export FLASK_APP=yiban.py` `export FLASK_APP=qrcodeLi.py` +`export FLASK_APP=cust.py` `export FLASK_ENV=development` @@ -70,7 +71,7 @@ timeout = 120 # accesslog = './logs/acess.log' # errorlog = './logs/error.log' # 自动重启 -autostart = ture +autostart = True ``` 启动gunicorn @@ -78,6 +79,7 @@ autostart = ture `gunicorn qrcodeLi:app -c gunicornLi.conf` `gunicorn qrcodeMe:app -c gunicornMe.conf` `gunicorn yiban:app -c gunicorn.conf` +`gunicorn cust:app -c gunicorn.conf` 查询gunicorn diff --git a/Miscellaneous/javascript2.md b/Miscellaneous/javascript2.md new file mode 100644 index 0000000..effcfdc --- /dev/null +++ b/Miscellaneous/javascript2.md @@ -0,0 +1,32 @@ +# javascript 学习总结 + +## 基础 +* 输入`prompt(...)` +* 比较 + * 如果两边任意一边出现 `true` 或者 `false` 使用 === + * 如果两边任意一边可能是特定值`0,"", []` 使用 === + * 剩下的所有情况,使用 == + * 对于引用类型来说,比较仅仅是比较其引用是否是同一个,另外在和字符串比较时,数组会自动转成字符串 + ```js + var a = [1,2,3] + var b = [1,2,3] + var c = "1,2,3" + console.log(a == b) // false + console.log(a == c) // true + console.log(b == c) // true + ``` + * switch语句 + ```js + switch(a) { + case 2: + case 10: + // 2 或者 10 执行 + break; + default: + // 条件都不满足默认执行 + } + ``` + +## ES6 +* let 尽量将变量声明放在代码块开始,避免在(Temproal Dead Zone, TDZ)临时死亡区使用而报错 + * 尽量使用for...let,在每次循环中都会声明一个新的变量,生成了一个闭包。避免for里边的函数在调用的时候引用不到正确的变量。 \ No newline at end of file diff --git a/Miscellaneous/nginx.conf b/Miscellaneous/nginx.conf index a50c467..743fad3 100644 --- a/Miscellaneous/nginx.conf +++ b/Miscellaneous/nginx.conf @@ -182,6 +182,30 @@ server { } } +server { + listen 80; + server_name cust.powerrain.cn; + # add_header Strict-Transport-Security "max-age=31536000"; + # location / { + # root /data/yiban/yiban; + # index index.html index.htm; + # try_files $uri $uri/ /index.html; + # } + + # location /api/photo/show/ { + # alias /data/yiban/backend/upload/; + # } + + location /api { + proxy_pass http://127.0.0.1:5003; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /data/wwwroot; + } +} + server { listen 80; server_name powerrain.cn; diff --git a/Miscellaneous/test.js b/Miscellaneous/test.js index 5b9950b..6fa5733 100644 --- a/Miscellaneous/test.js +++ b/Miscellaneous/test.js @@ -98,4 +98,11 @@ function Foo(who) { var b1 = new Bar('b1') var b2 = new Bar('b2') b1.speak() - b2.speak() \ No newline at end of file + b2.speak() + + var a = [1,2,3] + var b = [1,2,3] + var c = "1,2,3" + console.log(a == b) + console.log(a == c) + console.log(b == c) \ No newline at end of file