Skip to content

Instantly share code, notes, and snippets.

View liulinboyi's full-sized avatar
😂
Busy working in Suzhou for a living

Liu Bo liulinboyi

😂
Busy working in Suzhou for a living
View GitHub Profile
@xgqfrms
xgqfrms / douban-api-key.md
Last active August 6, 2021 09:02
douban api key
@myitcv
myitcv / 01_ReactTeamProposal.ts
Last active September 18, 2019 15:32
Typescript example comparing various signatures for getDerivedStateFromProps
interface MyCompProps {
model: Model;
modParams: ModParams;
}
interface MyCompState {
derived1?: Derived1;
derived2?: Derived2;
initialized: boolean;
@bitmingw
bitmingw / git_batch_resolver.py
Last active September 18, 2023 08:20
Batch script to resolve large git conflicts.
#!/usr/bin/env python3
"""
Author: Ming Wen ([email protected])
When resolving conflicts on a merge or rebase, this script
automates `git add/rm` and `git checkout` with --ours or --theirs
for a large batch of changes.
Usage: `python3 git_batch_resolver.py` in your git repository.
@nuintun
nuintun / 用JS计算字符所占字节数.markdown
Last active March 18, 2024 03:31
用JS计算字符所占字节数
/**
 * 计算字符串所占的内存字节数,默认使用UTF-8的编码方式计算,也可制定为UTF-16
 * UTF-8 是一种可变长度的 Unicode 编码格式,使用一至四个字节为每个字符编码
 *
 * 000000 - 00007F(128个代码)      0zzzzzzz(00-7F)                             一个字节
 * 000080 - 0007FF(1920个代码)     110yyyyy(C0-DF) 10zzzzzz(80-BF)             两个字节
 * 000800 - 00D7FF
 * 00E000 - 00FFFF(61440个代码)    1110xxxx(E0-EF) 10yyyyyy 10zzzzzz           三个字节
 * 010000 - 10FFFF(1048576个代码)  11110www(F0-F7) 10xxxxxx 10yyyyyy 10zzzzzz  四个字节
@yisibl
yisibl / git-key.md
Last active May 13, 2023 02:46
如何创建 Git 公钥

如何创建公钥

  1. 首先启动一个Git Bash窗口(非Windows用户直接打开终端)

  2. 执行:

    cd ~/.ssh

    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!