Live Note

Remain optimistic

Mix-ins

Abstract subclasses or mix-ins are templates for classes. An ECMAScript class can only have a single superclass, so multiple inheritance from tooling classes, for example, is not possible. The functionality must be provided by the superclass.

eg:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const calculatorMixin = (Base) =>
class extends Base {
calc() {
// do something
}
}

const randomizerMixin = (Base) =>
class extends Base {
remdomize() {
// do something
}
}

class Foo {}
class Bar extends calculatorMixin(randomizerMixin(Foo)) {}
const bar = new Bar()
console.log(bar.calc)
console.log(bar.remdomize) // also a function.

电影

  • ☑ 沐浴之王:老套路。看完了感觉很无聊。
  • ☑ Dead to 2020:英剧喜剧片。有点意思,照例黑老美。
  • ☑ 十诫:老电影,十分艺术。
  • ☑ Megan Leavey:军人与军犬之间的故事,但是我还是觉得一旦走上了这条路,就很难回归正常生活了。
  • ☐ 邪不压正
  • ☑ 急先锋:很难想象是 2020 年的电影,给我的感觉比不上神话。
  • ☑ Azizler(易舍难分):拿到了好的题材,拍了一部烂片。
  • ☑ Mosul(血战摩苏尔):钢枪很热血,剧情挺狗血。
  • ☑ Greenland(末日逃生):强行拖剧情,很多地方逻辑不通。特效还可以。
  • ☑ 赵子龙:垃圾片。
  • ☑ 送你一朵小红花
  • ☑ 盗梦空间

纪录片

  • ☑ Alien Worlds:根据现有的环境对其他星球进行模拟,幻想存在的物种。最后一集很震撼,随着进化只剩下神经系统,不需要肉体。靠葡萄糖维持生命,高度发达的机器人。

直接使用 su 权限移除镜像的 quarantine 标志

1
sudo xattr -rd com.apple.quarantine /Applications/<application-name>

转眼间就是新的一年了。

2020 年,庚子年。发生了许多事情。

  • 新冠
  • 澳洲大火
  • 美股熔断
  • ···

在这一年里我也毕业了,入职了,成为了一个打工人士。有了收入之后之前想买的东西都基本买齐了,之前想做的事还在稳步进行中。
虽然很多人说 2020 是未来十年中最好的一年,但是在我这还是有可圈可点的地方。大环境的改变,正是抓住机遇的时候。

Read more »

config clash.service

file path: /etc/systemd/system

1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description=Clash service
After=network.target

[Service]
Type=simple
User=edward
ExecStart=/usr/bin/clash -d /home/edward/.config/clash >> /home/edward/.config/clash/clash.log
Restart=on-failure
RestartPreventExitStatus=23

[Install]
WantedBy=multi-user.target
  • start: systemctl start clash
  • stop: systemctl stop clash
  • enable(start when system start): systemctl enable clash
  • disable: systemctl disable clash
  • status: systemctl status clash

最近在做的事

  • 去中心化 APP
  • 閱讀”我的簡史”

上月任務

  • Testing: 需求過多,完成一半
  • 結構優化: Done.
  • TS: 擱置
  • shell: 擱置

這個月的目標

  • 線性代數
  • Webpack
  • 去中心化 APP

最近的事

  • BTC 接近 20000
  • 去道院參觀
  • 補習數學

之前使用的是 trojan, 奈何找不到好的管理程序, 現使用 clash

clash 的 config 使用的是 yaml 文件, 所以比較好寫.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
port: 7890
socks-port: 7891
mixed-port: 7892 # 混合端口
allow-lan: true # 允許局域網連接
log-level: info
external-controller: 127.0.0.1:9090 # 外部控制端口
extarnal-ui: dashborad # 使用的ui
proxies: # clash官方文檔有更清楚的寫法
- {
type: ss,
name: "TEST-SS",
server: 127.0.0.1,
port: 2020,
password: 123456,
plugin: obfs,
plugin-opts: { mode: http },
} # 公司使用的是ss協議
- {
type: trojan,
name: "TEST-TROJAN",
server: 127.0.0.1,
port: 443,
password: 123456,
#sni
skip-cert-verify: true,
}
proxy-groups:
- { name: WORK, type: select, proxies: ["TEST-SS"] } # 將所需的proxy單獨進行分組
- { name: Proxy, type: select, proxies: ["TEST-TROJAN"] }
rules:
- IP-CIDR, 10.8.0.0/12, WORK # 根據rule將不同的請求轉發到所需的分組去
- IP-CIDR, 172.30.0.0/12, WORK
- IP-CIDR, 100.64.0.0/10, DIRECT
- IP-CIDR, 127.0.0.0/8, DIRECT
- DOMAIN-SUFFIX, google.com, Proxy

最近的任務量比較多

10 月份除開 1-8 只休息了四天, 需求很趕, 代碼質量參差不齊.

上個月的任務

  • React Hook: 這個月打算將之前的代碼邏輯抽離城自定義 hooks
  • shell: 需求太密已擱置
  • Linux: 需求太密已擱置
  • 優化 code: 大部分都已經優化掉了, 少數 code 還存在很大問題.

這個月的目標:

  • 補全測試
  • 優化代碼結構, 文件結構
  • 挖掘 Jest 深入用法
  • 重新熟悉 Typescript
  • shell

最近的事

  • BTC 價格接近 16000
  • 美國大選
  • 追完說唱新世代, 一場三個小時是有夠久的
  • 人生中第一次得蕁麻疹, 查不出病因