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 ConfigurableUrlByteSource extends ByteSource{ | |
private final URL url; | |
private int connectTimeout = 0; | |
private int readTimeout = 0; | |
public ConfigurableUrlByteSource(URL url) { | |
this.url = Preconditions.checkNotNull(url, "url is null"); |
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
/** | |
* get {@code ObjectMapper} with singleton pattern | |
* | |
* @author myles | |
* | |
*/ | |
public enum ObjectMapperHolder { | |
INSTANCE; |
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 sourcesJar(type: Jar, dependsOn:classes) { | |
classifier = 'sources' | |
from sourceSets.main.allSource | |
} | |
artifacts { | |
archives sourcesJar | |
} |
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
apply plugin: 'maven' | |
uploadArchives { | |
repositories { | |
mavenDeployer { | |
//release repository for version with no suffix '-SNAPSHOT' | |
repository(url: "http://x.x.x.x/nexus/content/repositories/releases") { | |
authentication(userName: "name", password: "passwd") | |
} | |
//snapshot repository for version with suffix '-SNAPSHOT' |
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
#!/bin/bash | |
echo "Import the public key used by the package management system...." | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
echo 'Create a list file for MongoDB...' | |
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list | |
echo 'Reload local package database.' | |
sudo apt-get update |
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
#!/bin/bash | |
SCRIPT_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})) | |
# assume this script is in APP_HOME/bin directory | |
cd $SCRIPT_DIR/.. | |
APP_HOME="`pwd -P`" |
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
#show current git branch in shell | |
function git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return; | |
echo "("${ref#refs/heads/}") "; | |
} | |
PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;36m\]\$(git_branch)\[\033[0;33m\]\[\033[0m\]$ " |
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
n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
</head> | |
<object |
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
@Configuration | |
public class WebConfig extends WebMvcConfigurerAdapter { | |
@Override | |
public void configurePathMatch(PathMatchConfigurer configurer) { | |
// enable matrix variable support | |
if (configurer.getUrlPathHelper() == null) { | |
UrlPathHelper urlPathHelper = new UrlPathHelper(); | |
urlPathHelper.setRemoveSemicolonContent(false); | |
configurer.setUrlPathHelper(urlPathHelper); |
OlderNewer