Skip to content

Instantly share code, notes, and snippets.

View isnbh0's full-sized avatar

John Choi isnbh0

View GitHub Profile
@isnbh0
isnbh0 / response.json
Created April 28, 2025 05:00
GPT-4o audio response
This file has been truncated, but you can view the full file.
{
"id": "chatcmpl-BRAsOaBxRQUCPNYCZ4CZGifZKhBgB",
"object": "chat.completion",
"created": 1745816364,
"model": "gpt-4o-audio-preview-2024-12-17",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
@isnbh0
isnbh0 / test_find_text_color.py
Last active October 24, 2024 02:10
find similar and legible text color
import colorsys
import random
from PIL import Image, ImageDraw, ImageFont # pip install pillow
def darken(rgb: tuple[int, int, int], amount: float) -> tuple[int, int, int]:
if not (0.0 <= amount <= 1.0):
raise ValueError("Amount must be between 0.0 and 1.0")
r, g, b = rgb
@isnbh0
isnbh0 / amend_git_commits.sh
Last active October 24, 2024 02:30
amend git commits
#!/bin/bash
# [WARNING]
# This script has not been tested with multi-line commit messages. Use at your own risk.
# 이 스크립트는 multi-line 커밋 메시지의 경우에 대해서는 테스트를 진행한 바가 없습니다. 사용 시 주의 바랍니다.
# This script amends the last N git commit messages with the following optional features, applied in order:
# 1. Removing a specified number of characters from the end
# 2. Adding a designated suffix or a reference number formatted as (#<reference_number>)
# 3. Stripping trailing whitespace