Skip to content

Instantly share code, notes, and snippets.

View roychen3's full-sized avatar

Roy Chen roychen3

  • Taipei City, Taiwan (R.O.C.)
View GitHub Profile
@roychen3
roychen3 / gist:e6138e5ef3205c741347e4b43a77727f
Last active February 3, 2026 15:37
My VSCode Extensions
code --install-extension aprilandjan.ascii-tree-generator
code --install-extension dracula-theme.theme-dracula
code --install-extension esbenp.prettier-vscode
code --install-extension github.copilot
code --install-extension github.copilot-chat
code --install-extension mhutchie.git-graph
code --install-extension ms-azuretools.vscode-containers
code --install-extension ms-azuretools.vscode-docker
code --install-extension oderwat.indent-rainbow
code --install-extension rangav.vscode-thunder-client
@roychen3
roychen3 / lockAsyncFn.ts
Last active April 26, 2024 05:03
解決非同步 function 的併發問題的 HOF,當第一個非同步處理未完成時,後續接著呼叫此 function,統一等待第一個的回傳值
type LockAsyncFunction<T extends any[], R> = (...args: T) => Promise<R>;
function lockAsyncFn<T extends any[], R>(
fn: LockAsyncFunction<T, R>
): LockAsyncFunction<T, R> {
let locked = false;
let queue: {
resolve: (value: R) => void;
reject: (reason: unknown) => unknown;
}[] = [];
@roychen3
roychen3 / troubleshoot_key_already_in_use.md
Last active February 20, 2024 02:16
github ssh key already in use

Troubleshoot: Key already in use

[time= 2023 09 15]

  1. Generating a new SSH key
$ ssh-keygen

set file name: id_rsa_other_name