Skip to content

Instantly share code, notes, and snippets.

@hi-ogawa
hi-ogawa / translate-clip.sh
Last active August 21, 2021 07:48
Bash scripts for quick translation
#!/bin/bash
#
# Example
# bash translate-clip.bash fr en
#
#
# Dependencies
# - xclip
@hi-ogawa
hi-ogawa / result.ts
Created July 12, 2021 02:53
Typescript Either type
//
// Interfaces
//
export type Result<T, E> = ResultOk<T, E> | ResultErr<T, E>;
export function Ok<T, E>(t: T): Result<T, E> {
return new ResultOk(t);
}
@hi-ogawa
hi-ogawa / README.md
Created July 12, 2021 23:35
Build Bitcoin

Separate directories for different build type

./autogen.sh

mkdir build-0 && cd build-0
../configure --without-bdb --prefix=$PWD/install CC=clang CXX=clang++ LDFLAGS=-fuse-ld=lld

mkdir build-1 && cd build-1
../configure --with-gui=qt5 --with-incompatible-bdb --prefix=$PWD/install CC=clang CXX=clang++ LDFLAGS=-fuse-ld=lld
@hi-ogawa
hi-ogawa / README.md
Last active July 19, 2022 03:41
Reading Typescript
@hi-ogawa
hi-ogawa / README.md
Created October 17, 2021 03:29
Mypy development

Development

pip install -e .
pip install -r test-requirements.txt

# Run single test
pytest mypy -n0 -v -s -k testNarrowingNestedUnionOfTypedDicts

# Run with debugger
@hi-ogawa
hi-ogawa / README.md
Last active July 4, 2024 02:57
archlinux-setup
@hi-ogawa
hi-ogawa / README.md
Last active June 3, 2022 04:03
Reading Next.js

Reading Next.js

TODO

  • server handler
    • API
    • SSR
  • client initialization
  • middleware
  • client navigation, prefetch, and data request
@hi-ogawa
hi-ogawa / README.md
Last active November 28, 2021 05:01
Reading swc

Reading swc

TODO

  • parser/lexer
  • ast
  • transform
  • codegen
  • sourcemap
  • next.js usage
@hi-ogawa
hi-ogawa / README.md
Last active April 15, 2023 17:22
Reading cpython

cpython development

  • misc tips (building, testing, editor setup)
  • module/import system
  • byte code
    • compilation
    • execution
  • generator/coroutine/async/await implementation
  • thread management
    • interpreter initialization