Skip to content

Instantly share code, notes, and snippets.

View benelog's full-sized avatar

Sanghyuk Jung benelog

View GitHub Profile
@benelog
benelog / ksug_hosting.md
Created June 9, 2012 21:07
KSUG 호스팅
@benelog
benelog / download.py
Created June 11, 2012 05:29
Python examples
import sys
import datetime
import os
target_date = datetime.datetime.now() - datetime.timedelta(1)
if len(sys.argv) > 1:
target_date = datetime.datetime.strptime(sys.argv[1], "%Y-%m-%d")
log_file_name = "js_01.%s.log" % target_date.strftime("%Y_%m_%d")
os.system("wget -O raw-data/session1/%s http://benelog.net/%s" % (log_file_name, log_file_name))
@benelog
benelog / git.md
Last active January 19, 2021 13:14
버전관리 유랑기, Git 적응기

버전 관리 시스템 유랑기, 그리고 Git 적응기

2011년 6월 9일11월 10일에 열린 세미나에서 두 번 발표했던 내용을 글로 정리했습니다.

지금까지 다양한 버전관리 시스템을 쓴 경험과 Git의 장점이라고 느낀 점에 대해서 발표했었습니다.

버전관리를 거의 안 하던 시절

버전관리는 먼 나라의 이야기?

Git에 대해 이야기를 하기 전에 지금까지 어떻게 버전관리를 해왔는지 되돌아보겠습니다. 아마 비슷한 경험을 하시고 공감하실 분들이 많으실 듯합니다.

@benelog
benelog / README.md
Created July 28, 2012 19:08
Springnote to Markdown conversion

필요한 환경

Python과 Pandoc이 설치되어 있어야함

사용법

명령행에서 아래와 같이 입력

python springnote2markdown.py [노트ID]

예) http://polylog.springnote.com 를 변환하려면

@benelog
benelog / build-helper.xml
Created August 27, 2012 07:58
Maven code
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>add-acceptancetest-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
package net.benelog.orm;
import java.util.List;
import org.springframework.orm.ibatis.SqlMapClientOperations;
/**
* @author benelog
* SqlMapClientOperations의 메소드를 generics를 이용해서 반복적인 캐스팅을 없애주는 역할을 함
*
@benelog
benelog / InitialConsonantExtractor.java
Created August 27, 2012 09:01
Korean lanauge Utils
public class InitialConsonantExtractor {
private static final char[] INITIAL_CONSONANT =
{'ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'};
public static final int NUMBER_OF_FINAL_CONSONANT = 28;
public static final int NUMBER_OF_VOWEL = 21;
public static boolean isKorean(char ch) {
return (ch >= '가' && ch <= '힣');
}
<%@ page contentType="text/html; charset=UTF-8" session="false"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<head>
<title>test page</title>
@benelog
benelog / gmaven.xml
Created August 28, 2012 10:12
Groovy + maven
<!-- Groovy -->
<dependency>
<groupId>org.codehaus.gmaven.runtime</groupId>
<artifactId>gmaven-runtime-1.7</artifactId>
<version>1.4</version>
</dependency>
@benelog
benelog / OilProduct.java
Created August 29, 2012 09:08
Java basic
public enum OilProduct {
GASOLINE("휘발유", 1), HIGH_GRADE_GASOLINE("고급휘발유", 2), DIESEL("경유", 3);
private String name;
private int productId;
private static Map<Integer, OilProduct> enumMap = new HashMap<Integer, OilProduct>();
static {
for (OilProduct each : OilProduct.values()) {