Skip to content

Instantly share code, notes, and snippets.

View RyanJeong's full-sized avatar
๐Ÿˆ

Ryan M. Jeong RyanJeong

๐Ÿˆ
View GitHub Profile
@RyanJeong
RyanJeong / PRINTS_ITSELF.md
Created August 11, 2019 07:57
A program that prints itself
char* me; void main(void) {printf(me); putchar(13); putchar(34); printf(me); putchar(34); putchar(';');} char* me = 
"char* me; void main(void) {printf(me); putchar(13); puchar(34); printf(me); putchar(34); putchar(';');} char* me=";
@RyanJeong
RyanJeong / GITHUB.md
Last active July 23, 2026 19:05
Github ์‚ฌ์šฉ๋ฒ•

Github ๊ธฐ๋ณธ ๊ฐœ๋…

์„ธ ๊ฐ€์ง€ ์ƒํƒœ

Git์€ ํŒŒ์ผ์„ Committed, Modified, Staged ์ด๋ ‡๊ฒŒ ์„ธ ๊ฐ€์ง€ ์ƒํƒœ๋กœ ๊ด€๋ฆฌ

  • Committed: ๋ฐ์ดํ„ฐ๊ฐ€ ๋กœ์ปฌ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ์•ˆ์ „ํ•˜๊ฒŒ ์ €์žฅ๋๋‹ค๋Š” ๊ฒƒ์„ ์˜๋ฏธ
  • Modified: ์ˆ˜์ •ํ•œ ํŒŒ์ผ์„ ์•„์ง ๋กœ์ปฌ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ์ปค๋ฐ‹ํ•˜์ง€ ์•Š์€ ๊ฒƒ์„ ์˜๋ฏธ
  • Staged: ํ˜„์žฌ ์ˆ˜์ •ํ•œ ํŒŒ์ผ์„ ๊ณง ์ปค๋ฐ‹ํ•  ๊ฒƒ์ด๋ผ๊ณ  ํ‘œ์‹œํ•œ ์ƒํƒœ๋ฅผ ์˜๋ฏธ
    ์›Œํ‚น ํŠธ๋ฆฌ, Staging Area, Git ๋””๋ ‰ํ† ๋ฆฌ

Git์˜ ์„ธ ๊ฐ€์ง€ ์ƒํƒœ๋Š” Git ํ”„๋กœ์ ํŠธ์˜ ์„ธ ๊ฐ€์ง€ ๋‹จ๊ณ„์™€ ์—ฐ๊ฒฐ๋จ

  • Git directory: git์ด ํ”„๋กœ์ ํŠธ์˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ์™€ ๊ฐ์ฒด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์ €์žฅํ•˜๋Š” ๊ณณ์œผ๋กœ, ๋‹ค๋ฅธ ์ปดํ“จํ„ฐ์— ์žˆ๋Š” ์ €์žฅ์†Œ๋ฅผ cloneํ•  ๋•Œ git directory๊ฐ€ ์ƒ์„ฑ๋จ
  • Working tree: ํ”„๋กœ์ ํŠธ์˜ ํŠน์ • ๋ฒ„์ „์„ checkout ํ•œ ๊ฒƒ์œผ๋กœ, git directory ์•ˆ์— ์••์ถ•๋œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ํŒŒ์ผ์„ ๊ฐ€์ ธ์™€์„œ working tree ์ƒ์„ฑ
@RyanJeong
RyanJeong / A_WAY_TO_CONVERT.md
Last active February 6, 2026 13:38
A way to convert char[] to/from TCHAR[] in C/C++(WinAPI)

TCHAR -> char

#define SIZE 1024

TCHAR src[SIZE] = L"This string will be char type";
char  dest[SIZE];

WideCharToMultiByte(CP_ACP, 0, src, lstrlen(src), dest, SIZE, NULL, NULL);
@RyanJeong
RyanJeong / CALLBACK.md
Created August 28, 2019 07:49
What is a callback function?

A callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.

/*
 *  meaningOfLife():  The callback method 
 */
function meaningOfLife() { 
  log("The meaning of life is: 42"); 
} 

/*
@RyanJeong
RyanJeong / DELETE_ALL_COMMITS.md
Created August 29, 2019 12:01
A way to delete all commit history
# 1. Create orphan branch
$ git checkout --orphan temp
Switched to a new branch 'temp'

# 2. Add all files to newly created branch
$ git add .

# 3. Commit
$ git commit -m "The first commit"
@RyanJeong
RyanJeong / VI.md
Last active November 19, 2021 03:47
VI default setting

$ sudo apt update && sudo apt install vim-gtk -y

$ vi ~/.vimrc

set number
syntax on
set ts=2
set sw=2
set sts=2
set expandtab
@RyanJeong
RyanJeong / GDB.md
Last active November 14, 2019 07:35
GDB Manual

์ฝ”์–ดํŒŒ์ผ ๋ถ„์„ํ•˜๊ธฐ

  • ์ฝ”์–ดํŒŒ์ผ์€ ์ถฉ๋Œํ•  ๋‹น์‹œ ํ”„๋กœ์„ธ์Šค์˜ ๋ฉ”๋ชจ๋ฆฌ ์ด๋ฏธ์ง€๋ฅผ ๋คํ”„ํ•œ ๊ฒƒ์ด๋‹ค.
    ์ฝ”์–ด ํŒŒ์ผ์„ gdb์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜์—ฌ ํ”„๋กœ๊ทธ๋žจ์˜ ์ƒํƒœ๋ฅผ ์กฐ์‚ฌํ•˜๊ณ  ์‹คํŒจ ์›์ธ์„ ๊ทœ๋ช…ํ•  ์ˆ˜ ์žˆ๋‹ค.
    ์–ด๋–ค ์˜ˆ๊ธฐ์น˜ ์•Š์€ ์ผ์ด ๋ฐœ์ƒํ•˜์—ฌ ๋น„์ •์ƒ์ ์ธ ์ข…๋ฃŒ๊ฐ€ ๋ฐœ์ƒํ•  ๋•Œ ์šด์˜์ฒด์ œ๋Š” ๋””์Šคํฌ์— ์ฝ”์–ด ํŒŒ์ผ์„ ๋‚จ๊ธด๋‹ค.
    ๋ฉ”๋ชจ๋ฆฌ์— ๊ด€ํ•œ ๋ฌธ์ œ๋Š” Checker ํŒจํ‚ค์ง€๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์˜ˆ๋ฐฉํ•  ์ˆ˜ ์žˆ์œผ๋‚˜, ๋ฉ”๋ชจ๋ฆฌ fault๋ฅผ ์ผ์œผํ‚ค๋Š” ๊ฒฝ์šฐ์—๋Š” ์ถฉ๋Œํ•˜๋ฉด์„œ ํŒŒ์ผ์„ ๋คํ”„ํ•œ๋‹ค.
    ์ฝ”์–ด ํŒŒ์ผ์€ ์ผ๋ฐ˜์ ์œผ๋กœ ํ”„๋กœ์„ธ์Šค๋ฅผ ์‹คํ–‰์‹œํ‚จ ํ˜„์žฌ ์ž‘์—… ๋””๋ ‰ํ† ๋ฆฌ์— ์ƒ์„ฑ๋˜์ง€๋งŒ ํ”„๋กœ๊ทธ๋žจ ๋‚ด์—์„œ ์ž‘์—… ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ๋ฐ”๊พธ๋Š” ๊ฒฝ์šฐ๋„ ์žˆ๋‹ค.

  • ๋ณดํ†ต ๋ฆฌ๋ˆ…์Šค๋Š” ๋ถ€ํŒ… ์‹œ ์ฝ”์–ด ํŒŒ์ผ์„ ๋งŒ๋“ค์ง€ ์•Š๋„๋ก ์„ธํŒ…๋˜์–ด ์žˆ๋‹ค. ์ฝ”์–ด ํŒŒ์ผ์„ ๋งŒ๋“ค๋„๋ก ์„ค์ •ํ•˜๊ณ ์ž ํ•œ๋‹ค๋ฉด ์…€์˜ ๋‚ด์žฅ ๋ช…๋ น์„ ์‚ฌ์šฉํ•œ๋‹ค.

  1. ๋งŒ์•ฝ C์‰˜ ํ˜ธํ™˜ ์‰˜(tcsh)์„ ์“ฐ๊ณ  ์žˆ๋Š” ๊ฒฝ์šฐ
@RyanJeong
RyanJeong / MYSQL_UBUNTU.md
Created November 19, 2019 05:57
use mysql.h on Ubuntu
  • mysql.h ์—†์„ ๊ฒฝ์šฐ
$ apt-get install libmysqlclient-dev
  • mysql.h์˜ ์œ„์น˜ ๋ฐ˜ํ™˜ํ•˜๋Š” ๋ช…๋ น์–ด
$ mysql_config --cflags 
@RyanJeong
RyanJeong / CCMINER.md
Created December 31, 2019 08:16
Litecoin GPU Mining on Linux
  1. Install VGA driver and CUDA
  2. Edit the .bashrc file from the root user and add the following lines at its end.
$ vi /root/.bashrc

...

export LD_LIBRARY_PATH=/usr/local/cuda-9.1/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-9.1/bin:$PATH
@RyanJeong
RyanJeong / SITES.md
Created January 9, 2020 09:36
Programming reference sites