Skip to content

Instantly share code, notes, and snippets.

View if1live's full-sized avatar
💭
I may be slow to respond.

byunghoo.yu if1live

💭
I may be slow to respond.
View GitHub Profile

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:

@if1live
if1live / 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
@if1live
if1live / 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
@if1live
if1live / 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)
@if1live
if1live / 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 "죽고 싶다"))
(이불킥 (이불킥 (이불킥 (이불킥 (이불킥 (이불킥))))))
@if1live
if1live / waldo.el
Created December 20, 2015 15:08
Implementation 왈도체 (emacs lisp version)
;; 왈도체 구현체
;; 안녕하신가! 힘세고 강한 아침, 만일 내게 물어보면 나는 왈도.
;; execute & output
;; $ emacs --batch --script waldo.el
;; 안녕하신가!
;; 힘세고 강한 아침
;;
;; (나는 왈도)
@if1live
if1live / 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"안녕하세요 테스트입니다"
@if1live
if1live / 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);
@if1live
if1live / 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))
@if1live
if1live / Sheep.java
Created November 28, 2015 13:09
Sheep count with Garbage Collector
/*
How to run
$ javac Sheep.java && java Sheep -Xms1k -Xmx1k -XX:MaxPermSize=1k -XX:MaxNewSize=1k
Sample output
양(id=35994) is created
양(id=35995) is created
양(id=35996) is created
양(id=17679) is killed, current alive 양 14956마리
양(id=35997) is created