Skip to content

Instantly share code, notes, and snippets.

View goyusia's full-sized avatar
๐Ÿ’ญ
I may be slow to respond.

byunghoo.yu goyusia

๐Ÿ’ญ
I may be slow to respond.
View GitHub Profile
@goyusia
goyusia / test_format_null.c
Created March 6, 2016 06:00
printf(%s) with null pointer
/*
printf(%s) with null pointer
## Execute
$ clang test_format_null.c && ./a.out
## Output
### OSX
|(null)||(nu|

Keybase proof

I hereby claim:

  • I am if1live on github.
  • I am if1live (https://keybase.io/if1live) on keybase.
  • I have a public key whose fingerprint is 24A1 67F1 AD41 EC41 1938 CEE8 FE22 879B 7E79 AFE3

To claim this, I am signing this object:

@goyusia
goyusia / buggy_ruby_parallel.rb
Created February 17, 2016 06:23
buggy ruby parallel example
#!/usr/bin/env ruby
require "parallel"
class User
attr_accessor :name
def initialize(name)
@name = name
end
end
@goyusia
goyusia / million_park_geun_hye.py
Created January 27, 2016 02:39
ํ™•์‚ฐ์„  ๋ฐ€๋ฆฌ์–ธ ใ„นํ˜œ
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
pip install requests
"""
import urllib
import requests
@goyusia
goyusia / maze_with_bug.hs
Created December 26, 2015 17:33
maze solver (haskell version. ์ œ๋Œ€๋กœ ์•ˆ๋Œ์•„๊ฐ)
-- ํ•˜์Šค์ผˆ์„ ์ด์šฉํ•ด ๋ฏธ๋กœ๋ฅผ ํ‘œํ˜„ํ•˜๋ผ.
-- Maze ์ž๋ฃŒํ˜•๊ณผ Node ์ž๋ฃŒํ˜•์ด ํ•„์š”ํ•  ๊ฒƒ์ด๋‹ค.
-- ์ฃผ์–ด์ง„ ์ขŒํ‘œ์— ๋”ฐ๋ผ ํ•˜๋‚˜์˜ ๋…ธ๋“œ๋ฅผ ๋ฆฌํ„ดํ•˜๋Š” ํ•จ์ˆ˜๋„ ํ•„์š”ํ•˜๋‹ค.
-- ๊ทธ๋ ‡๊ฒŒ ๋ฆฌํ„ด๋œ ๋…ธ๋“œ๋Š” ๋‹ค๋ฅธ ๋…ธ๋“œ๋กœ ๋„˜์–ด๊ฐˆ ์ˆ˜ ์žˆ๋Š” ์ถœ๊ตฌ์˜ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋‹ด๊ณ  ์žˆ์–ด์•ผํ•œ๋‹ค.
-- ๋ฏธ๋กœ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋ฆฌ์ŠคํŠธ ๋ชจ๋‚˜๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๋ผ.
module Main where
data Maze t = Maze [[t]] deriving (Show)
@goyusia
goyusia / kick_bedclothes.el
Last active December 24, 2015 12:25
Implemention for ์ด๋ถˆํ‚ฅ
;; execute
;; emacs --batch --script kick_bedclothes.el
;; original: https://twitter.com/sucroseMass/status/680000098248470528
(defun ์ด๋ถˆํ‚ฅ (&optional x)
(message "์ฃฝ๊ณ  ์‹ถ๋‹ค"))
(์ด๋ถˆํ‚ฅ (์ด๋ถˆํ‚ฅ (์ด๋ถˆํ‚ฅ (์ด๋ถˆํ‚ฅ (์ด๋ถˆํ‚ฅ (์ด๋ถˆํ‚ฅ))))))
@goyusia
goyusia / waldo.el
Created December 20, 2015 15:08
Implementation ์™ˆ๋„์ฒด (emacs lisp version)
;; ์™ˆ๋„์ฒด ๊ตฌํ˜„์ฒด
;; ์•ˆ๋…•ํ•˜์‹ ๊ฐ€! ํž˜์„ธ๊ณ  ๊ฐ•ํ•œ ์•„์นจ, ๋งŒ์ผ ๋‚ด๊ฒŒ ๋ฌผ์–ด๋ณด๋ฉด ๋‚˜๋Š” ์™ˆ๋„.
;; execute & output
;; $ emacs --batch --script waldo.el
;; ์•ˆ๋…•ํ•˜์‹ ๊ฐ€!
;; ํž˜์„ธ๊ณ  ๊ฐ•ํ•œ ์•„์นจ
;;
;; (๋‚˜๋Š” ์™ˆ๋„)
@goyusia
goyusia / calc_tk.py
Created December 17, 2015 09:28
calculate tk for translate-shell
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
'''
$ ./calc_tk.py
text = ์•ˆ๋…•ํ•˜์„ธ์š” ํ…Œ์ŠคํŠธ์ž…๋‹ˆ๋‹ค
tk = 513628.127973
'''
text = u"์•ˆ๋…•ํ•˜์„ธ์š” ํ…Œ์ŠคํŠธ์ž…๋‹ˆ๋‹ค"
@goyusia
goyusia / main.c
Created December 15, 2015 08:01
fork with stdout buffer
// https://twitter.com/RhoP_nim/status/676667506052825090
#include "apue.h"
int glob = 6;
char buf[] = "a write to stdout\n";
void err_sys(const char *x, ...)
{
perror(x);
exit(1);
@goyusia
goyusia / suicide.el
Last active December 2, 2015 04:59
Implementation "์‚ด์ž! == !์ž์‚ด", "์ž์‚ด! == !์‚ด์ž"
;; Implementation "์‚ด์ž! == !์ž์‚ด", "์ž์‚ด! == !์‚ด์ž"
;; How to run
;; emacs --script suicide.el
(defun fun-string-msg (word &optional func)
(if (eq nil func)
;; no argument
word
;; argument
word))