Skip to content

Instantly share code, notes, and snippets.

View mwakaba2's full-sized avatar

Mariko Wakabayashi mwakaba2

View GitHub Profile
@mwakaba2
mwakaba2 / system_design_numbers_cheat_sheet.md
Last active June 23, 2024 09:35
Updated easy to remember system design numbers for back-of-the-envelope calculations

Updated, easy to remember numbers for back-of-the-envelope calculations in system design interviews

Powers of two table

Power    Approx Value (Bytes)       Bytes
-----------------------------------------
10                 1 thousand        1 KB
16                65 thousand       64 KB
20                  1 million        1 MB
30 1 billion 1 GB
@mwakaba2
mwakaba2 / test_run_sync.py
Last active May 9, 2021 22:49
Script to reproduce the `AsyncLibraryNotFoundError` error.
import os
try:
from anyio.to_thread import run_sync
except ImportError:
# fallback on anyio v2 for python version < 3.7
from anyio import run_sync_in_worker_thread as run_sync
import asyncio