Code 공유할 때 Gist 사용해보기

Code 공유할 때 Gist 사용해보기

Blog 또는 code 공유에 있어서 Syntax highlight는 가독성때문에 중요하다고 생각한다.
현재 사용하고 있는 Ghost의 MarkDown을 사용하여 code를 공유하면 아래와 같고.

#!/bin/bash
PATH="$PATH:/usr/bin/"
export USER="junho"  #Current unbuntu id
DISPLAY="3" #이것도 새로만들어줌.
DEPTH="16"
GEOMETRY="1280x800"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost"
. /lib/lsb/init-functions

case "$1" in
start)
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;

stop)
log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;

restart)
$0 stop
$0 start
;;
esac
exit 0

Gist 란 서비스로 code를 작성한후 post에 임베딩해서 넣으면 아래와 같다.

앞으로 더 애용해야될 서비스 같다.