This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import org.hamcrest.core.Is; | |
import org.junit.Test; | |
import java.net.JarURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.util.Map; | |
import java.util.jar.Attributes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.SimpleTimeZone; | |
import java.util.TimeZone; | |
import org.junit.Test; | |
public class TimeZoneTest { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ImageChartException extends Exception { | |
private static final long serialVersionUID = 2058807664126002021L; | |
public static final int DATAEXCEPTION = 0; | |
public static final int STATEEXCEPTION = 1; | |
private Integer type = DATAEXCEPTION; | |
public ImageChartException(Integer t) { | |
this.type = t; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.dsdstudio.sharebox.server.socket; | |
import org.jboss.netty.buffer.ChannelBuffer; | |
import org.jboss.netty.channel.Channel; | |
import org.jboss.netty.channel.ChannelHandlerContext; | |
import org.jboss.netty.handler.codec.replay.ReplayingDecoder; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SNAPSHOT repository 에있는 artifact 같은버전을 여러번 참조하는경우 <br /> | |
* 못 가져오는경우도 있을수 있으므로 cache expired 를 1초로 세팅한다. | |
*/ | |
configurations.all { | |
resolutionStrategy.cacheChangingModulesFor 1, 'seconds' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task deployToDevEnvironment(type:Copy, dependsOn:['clean','war']) { | |
def targetDir = file('your_deployment_target_path') | |
from zipTree(file(war.archivePath)) | |
into targetDir | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* FileUploadLibrary | |
* @since 2014.07.24 | |
* by Bohyung kim a.k.a dsdstudio ( dsdgun@gmail.com, http://blog.dsdstudio.net ) | |
* { | |
* el:'#element', // ElementSelector | |
* responseConverter:function(data) // default -> json converter | |
* actionUrl:'upload', // Action URL, default value => form.action | |
* success: function(data){}, // success callback | |
* error: function(err) {}, // error callback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
########################################### | |
# RAW Image to jpeg conversion script # | |
# for Mac OSX # | |
# author : <Bohyung kim> dsdgun@gmail.com # | |
########################################### | |
__pwd="${PWD}" | |
__exec_sips=`which sips` | |
__rawfile_pattern="nef|cr2|rw2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name *.java -exec wc -l {} \; | awk '{sum+=$0} END {printf "%d Line of code \n", sum}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ObjectMapper mapper = new ObjectMapper(); | |
JsonNode decodedNode = mapper.readTree(f); | |
if (decodedNode instanceof ObjectNode) { | |
((ObjectNode) decodedNode.with("networkInfo")).put("realip", remoteRealIP); | |
} |