Skip to content

Instantly share code, notes, and snippets.

View hongsw's full-sized avatar
๐Ÿ•น๏ธ
Focusing

Seungwoo hong hongsw

๐Ÿ•น๏ธ
Focusing
View GitHub Profile
@hongsw
hongsw / update-asdf-0.16-zshrc.sh
Created March 21, 2025 02:09
Purpose of the Script This script automates the configuration changes required when upgrading to ASDF version 0.16.0 from earlier versions. The purpose is to: Safely back up the user's existing .zshrc configuration file Remove any outdated ASDF-related configuration lines Add the new required environment variables and PATH modifications for ASDFโ€ฆ
#!/bin/bash
# Create backup filename with current date and time
BACKUP_FILE=~/.zshrc.backup.$(date +%Y%m%d%H%M%S)
# Backup original file
cp ~/.zshrc "$BACKUP_FILE"
echo "Existing .zshrc file has been backed up to $BACKUP_FILE"
# Remove existing ASDF-related settings and create new file
@hongsw
hongsw / grpo_demo.py
Created February 2, 2025 12:24 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
@hongsw
hongsw / history.korea.txt
Last active December 8, 2024 03:40
# ๊ด‘ํ•ด๊ตฐ์ผ๊ธฐ[์ค‘์ดˆ๋ณธ]18๊ถŒ, ๊ด‘ํ•ด 1๋…„ 7์›”
# ๊ด‘ํ•ด๊ตฐ์ผ๊ธฐ[์ค‘์ดˆ๋ณธ]18๊ถŒ, ๊ด‘ํ•ด 1๋…„ 7์›”
๋น„๋ณ€์‚ฌ๊ฐ€ ์ง„ํœผ์‚ฌ๋ฅผ ์ฐจ์ถœํ•˜์—ฌ ์„œ๋กœ ์ง€๋ฐฉ์˜ ํ•œ์žฌ์ฑ…์„ ๊ทœํšํ•  ๊ฒƒ์„ ์•„๋ขฐ๋‹ค
์ด์กฐ๊ฐ€ ๋Œ€์ œํ•™ ์œ ๊ทผ์˜ ์ฐจ์ž์— ๋Œ€ํ•œ ๋Œ€์‹ ๋“ค์˜ ์˜๋…ผ์„ ์•„๋ขฐ๋‹ค
์‚ฌํ—Œ๋ถ€๊ฐ€ ์—ญ๊ด€ ํ‘œํ—Œ ๋“ฑ์„ ํŒŒ์ง์‹œํ‚ฌ ๊ฒƒ์„ ์•„๋ขฐ๋‹ค
์‚ฌ๊ฐ„์›์ด ๋ฌธ๊ด€ยท๋ฌด๊ด€ยท์Œ๊ด€์„ ๋ฌผ๋ก ํ•˜๊ณ  ์žฌ๋Šฅ์„ ํ—ค์•„๋ ค ์ˆ˜๋ น์„ ์ž„๋ช…ํ•  ๊ฒƒ์„ ์•„๋ขฐ๋‹ค
์‹ ํ ยท์„œ์„ฑยท๊ฐ•ํ™์ค‘ ๋“ฑ์—๊ฒŒ ๊ด€์ง์„ ์ œ์ˆ˜ํ•˜๋‹ค
๋ฐ•์ง„์›ยท์œ ๊ณต๋Ÿ‰ยท๊ฒฝ์„ฌยท์ด์ด์ฒจ ๋“ฑ์—๊ฒŒ ๊ด€์ง์„ ์ œ์ˆ˜ํ•˜๋‹ค
์˜์˜์ • ์ด์›์ต์ด ์‚ฌ์ง์†Œ๋ฅผ ์˜ฌ๋ฆฌ๋‹ค
์‚ฌํ—Œ๋ถ€๊ฐ€ ์—ฐ๊ณ„ํ•˜์—ฌ ์ž„์ถ˜๋ฐœ ๋“ฑ์˜ ํŒŒ์ง์„ ์ฒญํ•˜๋‹ค
์‚ฌํ—Œ๋ถ€๊ฐ€ ํŒŒ์ง์„ ๊ณ„์ฒญํ•˜๋‹ค
@hongsw
hongsw / main.dart
Created November 13, 2024 03:49
์ถ”์ƒํ™” ํด๋ž˜์Šค ์˜ˆ์‹œ Recipe ํด๋ž˜์Šค๋ฅผ ์ผ๋ฐ˜ํ™”ํ•˜๊ณ , FreeRecipe์™€ PaidRecipe ํด๋ž˜์Šค
class Recipe {
String title;
List<String> ingredients;
Recipe(this.title, this.ingredients);
// ๊ณตํ†ต์œผ๋กœ ์‚ฌ์šฉํ•  ์žฌ๋ฃŒ ๋ชฉ๋ก ๋ฉ”์„œ๋“œ
void getIngredientList() {
print("Ingredients for $title: ${ingredients.join(', ')}");
}
@hongsw
hongsw / main.dart
Created October 23, 2024 02:59
w8-ํŽ˜์ด์ง€ ์ด๋™ with gpt https://chatgpt.com/c/67186524-23bc-8013-a178-c7ce9fece1e8
// ํ•„์ˆ˜ Material Design ์œ„์ ฏ์„ ํฌํ•จํ•˜๋Š” ํŒจํ‚ค์ง€ ์ž„ํฌํŠธ
import 'package:flutter/material.dart';
// ์•ฑ์˜ ์‹œ์ž‘์ 
void main() {
runApp(const MyApp());
}
/// ์•ฑ์˜ ๋ฃจํŠธ ์œ„์ ฏ
/// MaterialApp์„ ๋ฐ˜ํ™˜ํ•˜์—ฌ ๋จธํ‹ฐ๋ฆฌ์–ผ ๋””์ž์ธ ํ…Œ๋งˆ ์ ์šฉ
@hongsw
hongsw / main.dart
Created October 2, 2024 03:25
my_flutter1
import 'package:flutter/material.dart';
void main() async {
runApp(MaterialApp(
initialRoute: '/',
routes: {
// When navigating to the "/" route, build the FirstScreen widget.
'/': (context) => FirstScreen(),
// When navigating to the "/second" route, build the SecondScreen widget.
'/second': (context) => QuizPage(),
@hongsw
hongsw / main.dart
Last active September 25, 2024 02:41
Class๋ฅผ ํ™œ์šฉํ•œ ๋„์„œ๊ด€๋ฆฌ ํ”„๋กœ๊ทธ๋žจ (๋ฌธ์ œ)
class Book {
String title;
String? author; // ์ €์ž ์ •๋ณด๋ฅผ ์„ ํƒ์ ์œผ๋กœ ์ถ”๊ฐ€
Book(this.title, [this.author]);
@override
String toString() {
return '$title';
}
void main() {
String str1 = 'h1';
String str2 = 'h1';
print(str1);
}
void main() {
for (int i = 0; i < 10; i++) {
print('hello Hong ${i + 1}');
}
}