https://git.coolaj86.com/coolaj86/unibabel.js/src/branch/master/index.js
base64 解中文会乱码,原因是解出来的东西是一个 8 位整数,你得对这个整数进行 .toString(8) 并在前面加上 % 变成形如 %E5%B1%8E 这样的字符串,再进行 decodeComponentURI
汉字转 binary bytes (base64-expression)
| export class ListNode<T> { | |
| val: T; | |
| next: ListNode<T> | null; | |
| constructor(val: T, next: ListNode<T> | null = null) { | |
| this.val = val; | |
| this.next = next; | |
| } | |
| /** |
| export function getRandomId() { | |
| return Date.now().toString(36); | |
| } | |
| export function getRandomId2() { | |
| return Math.random().toString(36).slice(2); | |
| } |
https://git.coolaj86.com/coolaj86/unibabel.js/src/branch/master/index.js
base64 解中文会乱码,原因是解出来的东西是一个 8 位整数,你得对这个整数进行 .toString(8) 并在前面加上 % 变成形如 %E5%B1%8E 这样的字符串,再进行 decodeComponentURI
汉字转 binary bytes (base64-expression)
| # https://www.viafitness.com/files/viafit_time_zones.pdf | |
| env TZ='Asia/Shanghai' node |
| # 查看当前文件夹大小 | |
| du -h -d 0 | |
| # 查看当前文件夹下各个子目录的大小 | |
| du -h -d 1 | |
| # 等价于 du -h -d 0 | |
| du -h -s |
| /** | |
| * object skin copy | |
| * e.g: SkinMerge<{ a: 1, c: 1 }, { a: 2, b: 2 }> ==> { a: 2, b: 2, c: 1 } | |
| */ | |
| type SkinMerge<O1, O2> = { | |
| [k in (keyof O1 | keyof O2)]: k extends keyof O2 ? O2[k] : (k extends keyof O1 ? O1[k] : never) | |
| } | |
| /** | |
| * get keys from O where the value is object |
| # clone git repo without the repo's full history: | |
| $ git clone --depth=1 |
安卓 X5 浏览器显示 <video> 标签的时候会出现层级遮盖 H5 元素的问题,可以参考 X5 文档: https://x5.tencent.com/tbs/guide/video.html
| -- by @W-46ec | |
| -- a4.hs | |
| -- Token data type | |
| data Token = Num Double | Op String | Err String | |
| deriving (Eq, Show) | |
| -- Stack operations |
| # 设置 | |
| git config --global https.proxy http://127.0.0.1:1080 | |
| git config --global http.proxy https://127.0.0.1:1080 | |
| # 取消 | |
| git config --global --unset http.proxy | |
| git config --global --unset https.proxy | |
| # 删除 npm proxy 配置 | |
| npm config delete proxy |