Skip to content

Instantly share code, notes, and snippets.

View practice's full-sized avatar

shawn.won practice

View GitHub Profile
@practice
practice / bootstrap borderless table css
Created April 13, 2013 06:15
bootstrap borderless table css
/* borderless table */
.table.table-borderless td, .table.table-borderless th {
border: 0 !important;
}
.table.table-borderless {
margin-bottom: 0px;
}
@practice
practice / html5shimf.angularjs.html
Created April 13, 2013 06:18
html5shim for angularjs
<!--[if lte IE 8]>
<script>
document.createElement('ng-include');
document.createElement('ng-pluralize');
document.createElement('ng-view');
// Optionally these for CSS
document.createElement('ng:include');
document.createElement('ng:pluralize');
document.createElement('ng:view');
</script>
@practice
practice / bootstrap-font-face
Created April 16, 2013 10:27
bootstrap 글꼴
'Segoe UI','Helvetica Neue',Helvetica,Arial,"나눔고딕",NanumGothic,'Nanum Gothic',sans-serif
Object principal = null; // fix this
Object credentials = null; // fix this
Authentication auth = new org.springframework.security.authentication.TestingAuthenticationToken(principal, credentials);
SecurityContextHolder.getContext().setAuthentication(auth);
@practice
practice / ctemplate.erl
Last active December 22, 2015 17:29
erlang 프로그래밍 템플릿
-module(ctemplate).
-compile(export_all).
start() ->
spawn(fun() -> loop([]) end).
loop(X) ->
receive
Any ->
io:format("Received: ~p~n", [Any]),
@practice
practice / git branch promt
Created November 8, 2013 07:10
git branch promt
export PS1='\h:\w`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`\[\033[37m\]$\[\033[00m\] '
private byte[] downloadFile(String downloadUrl) throws MalformedURLException,
IOException, ProtocolException {
URL url = new URL(downloadUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
ReadableByteChannel src = Channels.newChannel(connection.getInputStream());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
WritableByteChannel dest = Channels.newChannel(baos);
ChannelTools.fastChannelCopy(src, dest);
@practice
practice / bash_profile_java
Created September 2, 2014 08:38
Switch jdk 6,7,8 from terminal in Mac OS X
# refer http://www.jayway.com/2014/01/15/how-to-switch-jdk-version-on-mac-os-x-maverick/
#creating a special home for Java 8
export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)
#creating a special home for Java 7
export JAVA_7_HOME=$(/usr/libexec/java_home -v1.7)
#creating a special home for Java 6
export JAVA_6_HOME=$(/usr/libexec/java_home -v1.6)
@practice
practice / 생활코딩-docker-tutorial
Last active August 29, 2015 14:10
생활코딩 docker tutorial
http://opentutorials.org/course/128/8657
$ sudo apt-get update
$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh # Docker를 설치하자.
$ sudo docker images #이미지 목록을 살펴보자. 아무 것도 없다.
$ sudo docker pull ubuntu:14.04 # 우분투를 땡켜오자.
$ sudo docker run -i -t ubuntu:14.04 /bin/bash # 땡겨온 우분투로 bash를 실행하자.
$ # 다른 터미널로 접속해 아래와 같이 docker ps를 하면 방금 실행한 bash가 보인다. 이게 지금 컨테이너에서 실행되는 것이다.
$ sudo docker ps -a # 실행중인 컨테이너 목록을 보자. -a는 종료된 컨테이너도 보는 옵션.
@practice
practice / gist:8c8bbec56f5538b9c665
Last active August 29, 2015 14:23
clojure restful service
;; handler
(def app
(-> (routes
api-routes ;; for rest api
(wrap-routes home-routes middleware/wrap-csrf) ;; for regular web site
base-routes)
middleware/wrap-base))
;; middleware에 있는 wrap-base
(defn wrap-formats [handler]