Skip to content

Instantly share code, notes, and snippets.

View tkim90's full-sized avatar
💥

Tae Kim tkim90

💥
View GitHub Profile
@tkim90
tkim90 / try-catch.ts
Created March 31, 2025 08:41 — forked from t3dotgg/try-catch.ts
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@tkim90
tkim90 / docker-compose.yml
Last active September 6, 2019 18:35 — forked from onjin/docker-compose.yml
example docker compose for postgresql with db init script
postgres:
image: postgres:9.4
volumes:
# running multiple files
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./schema.sql:/docker-entrypoint-initdb.d/1-schema.sql
- ./data.sql:/docker-entrypoint-initdb.d/2-data.sql