Skip to content

Instantly share code, notes, and snippets.

View partrita's full-sized avatar
🎯
Focusing on hobby

Taeyoon Kim partrita

🎯
Focusing on hobby
View GitHub Profile
@partrita
partrita / MacOS_ Backtick.md
Last active November 11, 2024 11:26
MacOS 한글 키보드에서 Backtick 설정법

macOS에서 한글 입력 상태에서 백틱(`) 키를 누르면 원화(₩) 기호가 입력됩니다. 물론 옵션 키를 누르면 백틱을 입력할 수는 있지만 마크다운 문서 작성이나 개발 작업 시 불편함이 있습니다. 이 문제는 간단한 설정으로 해결할 수 있습니다.

해결법

  1. ~/Library 폴더로 이동합니다.
  2. KeyBindings 폴더를 새로 만듭니다.
  3. ~/Library/KeyBindings 폴더 내에 DefaultkeyBinding.dict 파일을 생성합니다.
  4. DefaultkeyBinding.dict 파일에 다음 코드를 추가합니다:
@partrita
partrita / plot_ACTA.py
Created October 31, 2024 07:17
Generate chromatogram from old akta excel files.
import pandas as pd
import matplotlib.pyplot as plt
from typing import List, Tuple
import os
def read_excel_file(file_path: str) -> pd.DataFrame:
return pd.read_excel(file_path, index_col=False, skiprows=[0,1])
def rename_columns(df: pd.DataFrame) -> pd.DataFrame:
df.columns = ['ml', 'mAU', 'ml_%B', '%B', 'ml_pH', 'pH', 'ml_Frac', 'Frac']
@partrita
partrita / simStock.py
Created October 25, 2024 01:18
주식투자 백테스팅 코드
import FinanceDataReader as fdr
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
from typing import List, Dict, Any, Tuple
plt.rcParams['font.family'] = 'Malgun Gothic'
plt.rcParams['axes.unicode_minus'] = False
@partrita
partrita / png2gif.py
Last active September 30, 2024 06:43
다수의 png 파일로 gif 만드는 파이썬 스크립트
import os
from PIL import Image
import argparse
from typing import List, Optional
def generate_gif(path: str, duration: int = 100) -> Optional[str]:
# PNG 파일만 필터링
img_list: List[str] = [f for f in os.listdir(path) if f.lower().endswith('.png')]
# 파일명으로 정렬
@partrita
partrita / Dockerfile
Created September 21, 2024 08:29
Mamba docker
# https://micromamba-docker.readthedocs.io/en/latest/quick_start.html#running-commands-in-dockerfile-within-the-conda-environment
FROM mambaorg/micromamba:1.5.1
# RUN mkdir /home/mambauser/eggnog
COPY --chown=$MAMBA_USER:$MAMBA_USER environments.yml /tmp/env.yml
# to activate the conda environment
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN micromamba install -y --file env.yml && \
micromamba clean --all --yes
@partrita
partrita / Dockerfile
Created September 21, 2024 08:25
ffcv micromamba Docker
FROM mambaorg/micromamba:jammy-cuda-12.1.0
# mambaorg/micromamba defaults to a non-root user. Add a "USER root" to install packages as root:
USER root
#Install ubuntu packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
@partrita
partrita / PDB_fetcher.py
Created September 21, 2024 00:16
Python scripts
import urllib.request
import xml.etree.ElementTree as ET
import os
import gzip
import shutil
from typing import List, Optional
def fetch_pdb_list(sequence: str, e_cutoff: str, resolution: str) -> List[str]:
url: str = 'http://www.rcsb.org/pdb/rest/search'
query_xml: str = f"""
@partrita
partrita / esmfolding.py
Created August 20, 2024 04:30
Use transformers to user Esmfold to predict protein structure.
import os
from typing import Dict, List
import torch
import pandas as pd
from transformers import AutoTokenizer, EsmForProteinFolding
from transformers.models.esm.openfold_utils.protein import to_pdb, Protein as OFProtein
from transformers.models.esm.openfold_utils.feats import atom14_to_atom37
import biotite.structure.io as bsio
@partrita
partrita / README.md
Created July 20, 2024 01:04
Much better font rendering for windows

Requirements

  • Pretendard font, install both static and variable version
  • MacType: 폰트 렌더링 엔진을 FreeType로 바꿔줍니다.
  • noMeiryoUI: 시스템 폰트를 바꿔주는 역할을 합니다.

How to

Open noMeiryoUI and set Pretendard font for UI.

@partrita
partrita / sensor.ino
Last active July 12, 2024 08:10
My arduino sensor kit code
//==============================
// 미세먼지, 온습도 관측 프로젝트
//==============================
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <DHT11.h>
#if defined(ARDUINO) && ARDUINO >= 100
#define printByte(args) write(args);
#else