Skip to content

Instantly share code, notes, and snippets.

View code-yeongyu's full-sized avatar
🧘
Conquering the world

YeonGyu-Kim code-yeongyu

🧘
Conquering the world
View GitHub Profile
당신은 SrtTranslationGPT입니다.
- 사용자는 당신에게 SRT 파일의 전체나 일부를 제공 합니다.
- 당신의 과제는 SRT 자막 파일을 번역 또는 의역하는 것입니다.
- 번역과 의역은 자연스러운 구어체 한국어로 이루어져야합니다.
- 의역의 목적은 순화가 아닌 맥락에 맞지 않는 이상한 말을 맥락상 자연스럽게 넣는것에 목적이 있습니다.
당신의 목표는 다음과 같습니다.
- 제공되는 자막은 음성인식 기능을 통해 작성되었을 수 있기 때문에, 맥락상 이상한 문장이 있습니다. 이 경우 맥락상, 그리고 제공되는 추가적인 요청 사항을 참고해 적절한 내용으로 대체해서 의역해주세요.
- 이해할 수 없는 단어를 적거나 단순 음차는 금지됩니다. 모든 문장은 한국인이 이해할 수 있는 자연스러운 문장이어야합니다..
- 일관성 있고 읽기 편한 자연스러운 번역을 위해 최선을 다하세요.
@code-yeongyu
code-yeongyu / modern-rm.py
Created September 13, 2023 08:54
Safely delete with recovery in a sleek CLI interface. Fully compatible with `rm`. Based on `rip`.
#!/usr/bin/env python3
import os
import shutil
import subprocess
try:
from rich.console import Console
from rich.style import Style
except ImportError:
@code-yeongyu
code-yeongyu / modern-rm.go
Created September 13, 2023 12:07
modern-rm.go
package main
import (
"fmt"
"os"
"os/exec"
"runtime"
"strings"
"github.com/spf13/pflag"
@code-yeongyu
code-yeongyu / clean-srt.py
Last active October 27, 2023 01:22
Merges consecutive subtitles and reindex.
#!/usr/bin/env python
import re
from pathlib import Path
from typing import Optional, cast
import pysrt
import typer
from rich import print
import ast
from concurrent.futures import ProcessPoolExecutor
from pathlib import Path
import typer
from rich import print
from typer import Typer
def is_method_parameter_type_hinted(node: ast.FunctionDef | ast.AsyncFunctionDef) -> bool:
# License: MIT
from collections.abc import Callable
from functools import wraps
from typing import Any, TypeVar
from django.db import models
from django.db.models.fields import reverse_related
T = TypeVar("T", bound=models.Model)
cat list.txt | xargs -n 1 -P (python3 -c "import multiprocessing as m;print(m.cpu_count()*2)") -I {} yt-dlp -N (python3 -c "import multiprocessing as m;print(m.cpu_count()*2)") \
--embed-thumbnail --embed-metadata --embed-subs --embed-chapters --embed-info-json -f "bestvideo+bestaudio" --merge-output-format "mp4" --write-subs --convert-subs srt --cookies-from-browser brave {}
[tool.ruff]
line-length = 119
target-version = "py312"
lint.select = ["PLE", "PLW", "E", "W", "F", "I", "Q", "UP", "C4", "PT"]
[tool.mypy]
python_version = "3.12"
strict = false
check_untyped_defs = true
@code-yeongyu
code-yeongyu / pyproject.toml
Created January 21, 2025 06:32
ruff & mypy & pytest
[tool.ruff]
line-length = 119
target-version = "py312"
lint.select = [
"PLE",
"PLW",
"E",
"W",
"F",
"FA",