Skip to content

Instantly share code, notes, and snippets.

View dsdstudio's full-sized avatar
🎹
Focusing

Bohyung kim dsdstudio

🎹
Focusing
View GitHub Profile
@dsdstudio
dsdstudio / logback.xml
Created January 25, 2016 02:17
logback rollingfileappender + gzip compression
<?xml version="1.0" encoding="UTF-8"?>
<!-- debug=true 해주는이유는 설정이 잘못되었는지 미리 판단이 가능하기 때문이다 -->
<configuration debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
</Pattern>
</layout>
</appender>
@dsdstudio
dsdstudio / maven.xml
Last active January 5, 2016 14:22
maven execute main class
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>java</goal>
</goals>
@dsdstudio
dsdstudio / upload.js
Created December 22, 2015 06:02
file upload lib prototyping
function upload(opt) {
opt = $.extend({
method:'POST',
url:'',
data:{},
onprogress:function() {},
onload:function(e, file) {},
onsuccess:function(e, file) {},
onerror:function(e, file) {}
}, opt);
@dsdstudio
dsdstudio / ns-cheatsheet.clj
Last active September 2, 2015 10:12 — forked from ghoseb/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
@dsdstudio
dsdstudio / json-to-formdata.js
Last active August 29, 2015 14:22
complex data structure json to form data
function jsonToFormData($json) {
function isObject($o) { return typeof $o === 'object' && $o !== null; }
function isFunction($o) { return typeof $o === 'function'; }
function visit($json, $arr, $prefix) {
var t0, i, j;
t0 = $arr || [];
$prefix = $prefix || '';
for (i in $json) {
if (isFunction($json[i])) continue;
if ( Array.isArray($json[i]) ) {

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@dsdstudio
dsdstudio / jspstyle-tpl-engine.js
Last active August 29, 2015 14:20
간단한 한줄짜리 jsp style 템플릿 엔진
/**
* javascript jsp style micro template compiler
* template => <%= val %>
* */
function compile(tpl, data) {
var compiledStr = ''
,regex = '/\<\%\=(.+?)\%\>/gim'
,t0;
while((t0 = regex.exec(compiledStr)) != null)
compiledStr = compiledStr.replace(new Regexp(t0[0], 'gi'), data[t0[1]]);
@dsdstudio
dsdstudio / reverse_proxy.go
Created March 31, 2015 16:54
simple reverse proxy server
package main
import (
"log"
"strings"
"net/url"
"net/http"
"net/http/httputil"
)
@dsdstudio
dsdstudio / _vimrc
Last active August 29, 2015 14:11
windows용 _vimrc 기본 설정
set enc=utf8
set fileencoding=utf8
set ts=4
set sw=4
set nu
set hlsearch
set ai
set nobackup
set visualbell
colorscheme darkblue
@dsdstudio
dsdstudio / jssort.js
Created October 27, 2014 10:15
javascript sort
page = page.sort(function(a, b) {
var $a = a.SEQ || 0;
var $b = b.SEQ || 0;
if ( $a == $b ) return 0;
if ( $a < $b ) return -1;
return 1;
});