San Francisco, CA
taehnkim@gmail.com
linkedin.com/in/taehnkim
github.com/tkim90
404-563-4375
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Source: https://www.carlrippon.com/fetch-with-async-await-and-typescript/ | |
| // Source: https://eckertalex.dev/blog/typescript-fetch-wrapper | |
| interface HttpResponse<T> extends Response { | |
| parsedBody?: T; | |
| error?: T; | |
| } | |
| export async function http<T>(request: RequestInfo): Promise<HttpResponse<T>> { | |
| const response: HttpResponse<T> = await fetch(request); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://nextjs.org/docs/deployment | |
| # Install dependencies only when needed | |
| FROM node:alpine AS deps | |
| # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | |
| RUN apk add --no-cache libc6-compat | |
| WORKDIR /app | |
| COPY package.json yarn.lock ./ | |
| RUN yarn install --frozen-lockfile | |
| # Rebuild the source code only when needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from "react"; | |
| export default function useOnClickOutside(ref, handler) { | |
| React.useEffect( | |
| () => { | |
| const listener = (event) => { | |
| // Do nothing if clicking ref's element or descendent elements | |
| if (!ref.current || ref.current.contains(event.target)) { | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Run these commands to create privileged users. | |
| -- application: can run all except truncate or delete tables | |
| -- dev_user: can only read from tables | |
| -- db_admin: can only create roles or delegate roles to users | |
| -- RDS is on Postgres 10.17 | |
| ---------------------------- | |
| -- Create application user | |
| ---------------------------- | |
| --- Before running these commands, make sure no tables exist in the database. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div className="fixed bottom-50 right-0 m-1 p-2 bg-red-500 text-white rounded"> | |
| <div className="block sm:hidden">xs</div> | |
| <div className="hidden sm:block md:hidden">sm</div> | |
| <div className="hidden md:block lg:hidden">md</div> | |
| <div className="hidden lg:block xl:hidden">lg</div> | |
| <div className="hidden xl:block 2xl:hidden">xl</div> | |
| <div className="hidden 2xl:block">2xl</div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Types for the result object with discriminated union | |
| type Success<T> = { | |
| data: T; | |
| error: null; | |
| }; | |
| type Failure<E> = { | |
| data: null; | |
| error: E; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # relative number | |
| set relativenumber | |
| # Global clipboard | |
| set clipboard+=unnamed | |
| """""""""""""""""""""""""""""""""""""""""""""""" | |
| " Setup Vundler for plugin management | |
| """""""""""""""""""""""""""""""""""""""""""""""" | |
| set nocompatible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface PipelineContext<T> { | |
| task: T; | |
| stop: boolean; | |
| } | |
| export type Middleware<T> = (context: PipelineContext<T>) => Promise<PipelineContext<T>>; | |
| /** | |
| * Stops the pipeline execution by setting the stop flag to true. | |
| * |
OlderNewer