Skip to content

Instantly share code, notes, and snippets.

View jiwnchoi's full-sized avatar
👋
Hello

Jiwon Choi jiwnchoi

👋
Hello
View GitHub Profile
# 주간 업데이트 함수
weekly_update() {
# 마지막 실행 시간을 저장할 파일
last_run_file="$HOME/.last_weekly_update"
# 현재 시간
current_time=$(date +%s)
# 파일이 존재하지 않으면 생성
if [ ! -f "$last_run_file" ]; then
@jiwnchoi
jiwnchoi / demo.json
Created March 18, 2024 09:27
demo.json
[
{
"role": "user",
"content": "draw random scatterplot",
"type": "message"
},
{
"role": "assistant",
"type": "message",
"content": "For a random scatter plot, let's choose two different columns that might provide an interesting contrast or relationship when visualized. Given we have previously looked at financial aspects, it might be illuminating to look into how movies fare in terms of audience and critic ratings.\n\n### Plan to Visualize with Vega-Lite:\nTherefore, a compelling choice for a scatter plot could be to visualize the relationship between:\n- The **IMDB Rating** (as the x-axis) and \n- The **Rotten Tomatoes Rating** (as the y-axis).\n\nBoth are numeric ratings from different review platforms, and comparing them can highlight differences in reception between general audiences (IMDb) and critics (Rotten Tomatoes).\n\nHere are the steps for creating this visualization using Vega-Lite:\n1. Define the `$schema` for Vega-Lite.\n2. Specify the `data` as `artifacts/data.csv
@jiwnchoi
jiwnchoi / vjson.py
Created March 14, 2024 06:26
dataclass json encoder / decoder
from __future__ import annotations
from dataclasses import asdict, is_dataclass
from json import JSONDecoder, JSONEncoder
from typing import Type, TypeVar
T = TypeVar("T")
class VJSONEncoder(JSONEncoder):
@jiwnchoi
jiwnchoi / check_full.js
Last active December 5, 2023 08:18
chatgpt_response_time_checker.js
// input prompt to text area and paste code to javascript console.
(function () {
const DOMPath = document.querySelector("#__next > div.relative.z-0.flex.h-full.w-full.overflow-hidden > div.relative.flex.h-full.max-w-full.flex-1.flex-col.overflow-hidden > main > div.flex.h-full.flex-col > div.w-full.pt-2.md\\:pt-0.dark\\:border-white\\/20.md\\:border-transparent.md\\:dark\\:border-transparent.md\\:w-\\[calc\\(100\\%-\\.5rem\\)\\] > form > div > div > div")
const genButton = "button[data-testid='send-button']"
const stopButton = "button[aria-label='Stop generating]'";
const startTime = Date.now()
document.querySelector(genButton).click()
const observer = new MutationObserver(checkForTargetElement);
const observerConfig = { subtree: true, childList: true };
@jiwnchoi
jiwnchoi / exec_time_checker.py
Last active May 8, 2023 14:50
Python Decorator for Recording Excution Times of Function
import time
from typing import Dict
class ExecTimeChecker:
execution_times: Dict[str, float]
def __init__(self):
self.execution_times = {}
@jiwnchoi
jiwnchoi / Dockerfile
Created February 23, 2023 05:55
Deploy FastAPI+PyTorch API with Docker
## First, clone your api repository to current folder. and copy Dockerfile
FROM pytorch/pytorch:latest
## Copying current folder to image
COPY ./ ./
## install git-lfs for downloading Huggingface model and datasets.
RUN apt update -y && apt install git git-lfs -y
RUN git lfs install