Skip to content

Instantly share code, notes, and snippets.

# tmux config by Cheol Kang (kang@cheol.net)
# Set copy-mode as vi mode
set-window-option -g mode-keys vi
# Re-bind split-window
bind s split-window -v # horizontal
bind v split-window -h # vertical
# Re-bind select-pane
@cornchz
cornchz / clipimage.js
Created September 19, 2011 02:47
clipImage
/**
* Clip images, given as jQuery objects.
* @param img_obj jQuery Object
*/
window.clipImage = (function() {
return function (img_obj) {
function setViewport(img, x, y, width, height) {
img.style.left = "-" + parseInt(x) + 'px';
img.style.top = "-" + parseInt(y) + 'px';
img.style.width = width === 'auto' ? width : parseInt(width) + 'px';

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@cornchz
cornchz / helloworld.py
Created April 16, 2012 12:21
GA version "Hello World!" in Python
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from itertools import izip
from random import randint
from random import random as rand
GA_POPSIZE = 2048
GA_MAXITER = 16384
GA_ELITERATE = 0.1
#!/usr/bin/
# -*- encoding:utf-8 -*-
from itertools import count, islice, takewhile, imap
import time
def primes1(candidates = count(2)):
# Pick a prime and yield.
prime = candidates.next()
yield prime
@cornchz
cornchz / generator_inside_with.md
Created April 25, 2012 07:29
return generator inside a with statement

generator에 대한 뭔가를 쓰다가 발견했다.

만들고 싶었던 함수는 이거.

def readlines(filename):
    with open(filename, 'r') as f:
        for line in f:
            yield line

print ''.join(readlines('test.txt'))

@cornchz
cornchz / sy.md
Created August 10, 2012 10:05
Notes from the Mystery Machine Bus - Steve Yegge

Notes from the Mystery Machine Bus

I've spent the past eight years (starting back in June 2004) writing elaborate rants about a bunch of vaguely related software engineering issues.

I was doing all that ranting because I've been genuinely perplexed by a set of "bizarre" world-views held dear by -- as far as I can tell -- about half of all programmers I encounter, whether online or in person.

Last week, after nearly a decade of hurling myself against this problem, I've finally figured it out. I know exactly what's been bothering me.

In today's essay I'm going to present you with a new conceptual framework for thinking about software engineering. This set of ideas I present will be completely obvious to you. You will probably slap yourself for not having thought of it yourself. Or you might slap the person next to you. In fact you probably have thought of it yourself, because it is so blindingly obvious.

@cornchz
cornchz / convert.py
Created August 31, 2012 13:20 — forked from e9t/README.md
Extract text in .smi files and convert to .txt files
#! /usr/bin/python2.7
# -*- coding: utf-8 -*-
"""
The `.smi` files should be in the `./smi` folder.
Extracted text will be contained in `.txt` files and located in a `./txt' folder.
"""
import html5lib
import os
  1. 인상깊게 읽은 컴퓨터 관련 도서, 블로그 글 또는 에세이 등이 있다면 무엇인지, 그리고 어떤 면에서 인상이 깊었는지를 총 세 가지 이상의 대상(예컨대 책 두 권, 블로그 글 하나, 혹은 책 세 권 등)에 대해 적으시오.
  2. 주로 보는 블로그, 잡지, 커뮤니티 사이트나 뉴스 사이트가 있다면 무엇인지, 그리고 그걸 주로 보는 이유를 적으시오.
  3. IT 쪽에서 자신에게 큰 영향을 준 사람(프로그래머 등)의 이름(복수 가능)과 그 사람에게서 본인은 어떤 영향을 받았는지 간단히 적으시오.
  4. 읽어 본 코드나 사용해 본 라이브러리, 프로그램 중에서 프로그래머로서의 성장에 도움이 된 경우가 있다면, 그것의 명칭과 이유를 적으시오.
  5. 본인이 자기 자신, 친구, 가족 등 가까운 사람을 위해서 만들었고 지금도 사용하는 프로그램이 있다면 어떤 것인지 적으시오.
  6. 자신이 개발한 프로그램 중에 실제 사용자가 만족해서 좋은 피드백을 받았던 경우가 있다면 어떤 프로그램인지 그리고 구체적으로 어떤 피드백이었는지 적으시오.
  7. 프로그래밍 외의 다른 관심사와 프로그래밍을 연계해서 해본 프로젝트가 있다면 그에 대해 설명하시오. (예컨대 별자리에 관심이 있어서 관련 프로그램을 만들어 봤다던지)
  8. 후배나 주변 사람에게 프로그래밍을 가르친 일이 있다면 어떤 상황에서 무엇을 가르쳤는지 적으시오. (발표 자료나 교육 자료의 URL이 있으면 함께 적으시오 -- 웹 공간이 필요하다면 http://www.slideshare.net 에 올리고 URL을 보내면 됩니다)
  9. 팀으로 개발할 때 수동적인 멤버를 적극적으로 만들기 위한 시도를 해 본 적이 있다면 구체적으로 어떤 시도를 했는지, 그리고 어떤 결과가 있었는지, 또 어떤 교훈을 얻었는지 적으시오.
  10. 작년이나 올해 새롭게 공부한 프로그래밍 언어, 프레임워크, 소프트웨어 기술 등이 있다면 무엇인지 적으시오.
@cornchz
cornchz / usage.md
Last active December 11, 2015 18:28
ucat() {
cat $@ | native2ascii -encoding UTF-8 -reverse
}
uhead() {
head $@ | native2ascii -encoding UTF-8 -reverse
}