Skip to content

Instantly share code, notes, and snippets.

View ageldama's full-sized avatar

Jonghyouk Yun ageldama

  • Seoul, Republic of Korea
View GitHub Profile
@ageldama
ageldama / gist:4053764
Created November 11, 2012 04:51
Google Drive Client for Ubuntu
http://www.webupd8.org/2012/06/grive-update-brings-full-google-drive.html
> sudo add-apt-repository ppa:nilarimogard/webupd8
> sudo apt-get update
> sudo apt-get install grive
@ageldama
ageldama / gist:4173461
Created November 30, 2012 02:44
EJS element 방식으로 HTML에 내장하여 사용하기.
<!-- 사용할 자바스크립트 참조 -->
<script type='text/javascript' src='underscore.js 참조'></script>
<script type='text/javascript' src='jquery.js 참조'></script>
<script type='text/javascript' src='ejs.js 참조'></script><!-- http://embeddedjs.com/ -->
<!-- EJS 템플릿 예제. -->
<!--
* type='text/template' 으로 지정.
* 이후에 참조를 위해서 id 속성을 지정.
@ageldama
ageldama / gist:4230085
Created December 7, 2012 01:50
tmux-automation: server log monitoring
tmux split-window
tmux split-window
tmux split-window
tmux select-layout tiled
tmux select-pane -t 0
(defprotocol Foo
(blah
[this x]
[this x y]))
(def r (reify Foo
(blah [_ x] x)
(blah [_ x y] y)))
(blah r 1) ;; => 1
(defn print-all [arr]
(println "-----")
(doseq [i arr] (println i)))
;;; 기본적으로 동작할때.
;;; http://docs.oracle.com/javase/6/docs/api/java/io/File.html#listFiles()
(print-all (.listFiles (java.io.File. ".")))
;;;--> dir-file-filter은 그냥 FileFilter을 구현한 객체 인스턴스.
(def dir-file-filter
(defprotocol Fruit
(subtotal [item]))
(extend-type Orange
Fruit
(subtotal [item] (* 98 (:qty item))))
;;; 'coupon' is the function returing a 'reify' of subtotal. This is
;;; when someone uses a coupon ticket, the price of some fruits is
@ageldama
ageldama / application.html.haml
Last active December 11, 2015 02:08
rails example code snippets
-# -*- mode: haml; coding: utf-8; -*-
!!! html
%html
%head
%title= @page_title || '기업인'
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
%meta{'http-equiv' => "Content-Type", 'content' => "text/html; charset=UTF-8"}/
@ageldama
ageldama / MainApp.java
Created January 16, 2013 16:38
Spring Simple DataSource Example.
// 요게 애플리케이션 시작하면 일어날 코드.
public static void main(String[] args) {
// 일단 applicationContext.xml 로딩해서 ApplicationContext 객체 얻어냄.
ApplicationContext appCtx = new ClasspathApplicationContext("classpath*:applicationContext.xml");
// myDao 객체 달라고 요청.
MyDao myDao = (MyDao) appCtx.getBean("myDao");
}
@ageldama
ageldama / CalcController.java
Created January 16, 2013 16:51
Spring Web MVC Example.
@Controller
public class CalcController {
@RequestMapping("/")
public void welcomeHandler() {
}
@RequestMapping("/plus")
public ModelMap plus(Integer a, Integer b) {
ModelMap m = new ModelMap();
@ageldama
ageldama / gradleDebugJettyRun.sh
Created January 29, 2013 06:58
gradle remote-debug jettyRun alias.
alias gradleDebugJettyRun="GRADLE_OPTS='-Xdebug -Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n' gradle jettyRun"