Skip to content

Instantly share code, notes, and snippets.

View dsdstudio's full-sized avatar
🎹
Focusing

Bohyung kim dsdstudio

🎹
Focusing
View GitHub Profile
var regmap = {
nonargfuncreg:/(function)\s(\w*)\s\(\){/,
fnargreg:/(function)\s(\w*)\s\(([a-zA-Z,]*)\){/
};
@dsdstudio
dsdstudio / service.sh
Last active December 18, 2015 03:48
java Daemon control script
#!/usr/bin/env bash
###########################################
# Linux/Unix Daemon control script #
# @author : Bohyung kim<dsdgun@gmail.com> #
# @since : 2013.06.06 #
###########################################
# 기본경로는 현재 위치지만 따로 설정할수도 있다.
__workdir=`pwd`
# application 이름
import java.io.*;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@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 / gist:6931207
Last active December 25, 2015 06:19
NIO readAllLine from file, StandardCharsets
for (String s : Files.readAllLines(Paths.get(file.getAbsolutePath()), StandardCharsets.UTF_8))
buffer.append(s);
@dsdstudio
dsdstudio / pom.xml
Last active December 27, 2015 10:49
maven shade plugin -> Executable jar
<project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
@dsdstudio
dsdstudio / pom.xml
Created December 30, 2013 08:42
maven-shade-plugin no dependency-reduced-pom generated
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
@dsdstudio
dsdstudio / gist:8539151
Created January 21, 2014 12:30
redis client test
// redis-cli.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#define REDIS_PORT 6379
#define REDIS_HOST "127.0.0.1"
#define RedisAskingPriceTable "stockrules_recently_ap"
#define RedisMarketPriceTable "stockrules_recently_mp"
@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>