This file contains hidden or 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
cd $OPENSHIFT_DATA_DIR | |
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u31-b13/jdk-8u31-linux-x64.tar.gz | |
tar -zxvf jdk-8u31-linux-x64.tar.gz | |
rm -f jdk-8u31-linux-x64.tar.gz | |
# JAVA_HOME and PATH are set in startup hook according to these paths |
This file contains hidden or 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
if (!JavaVersion.current().java8Compatible) { | |
throw new IllegalStateException("This needs Java 8. You are using ${JavaVersion.current()}.") | |
} | |
buildscript { | |
repositories { jcenter() } | |
dependencies { | |
classpath 'com.github.jengelman.gradle.plugins:shadow:1.1.1' | |
} | |
} |
This file contains hidden or 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
<!-- comments / name / etc. --> | |
<buildSpec> | |
<buildCommand> | |
<name>org.eclipse.jdt.core.javabuilder</name> | |
<arguments> | |
</arguments> | |
</buildCommand> | |
</buildSpec> | |
<natures> |
This file contains hidden or 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
import java.io.InputStreamReader; | |
import java.io.Reader; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import javax.script.Invocable; | |
import javax.script.ScriptEngine; | |
import javax.script.ScriptEngineManager; |
This file contains hidden or 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
List<String> strings = new ArrayList<String>(); | |
// ... populate list | |
List<String> mappedStrings = strings.stream().map(someString -> someString.toLowerCase()).collect(Collectors.toList()); |
This file contains hidden or 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
import static ch.qos.logback.classic.Level.* | |
import ch.qos.logback.classic.encoder.PatternLayoutEncoder | |
import ch.qos.logback.core.rolling.RollingFileAppender | |
import ch.qos.logback.core.rolling.TimeBasedRollingPolicy | |
import ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP | |
appender("FILE", RollingFileAppender) { | |
file = "logs/server.log" | |
append = true | |
encoder(PatternLayoutEncoder) { pattern = "%d{HH:mm:ss.SSS} %-5level %logger{60} - %msg%n" } |
This file contains hidden or 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
plugins { | |
id 'java' | |
id 'eclipse' | |
id 'idea' | |
id 'com.github.johnrengelman.shadow' version '1.2.1' | |
} | |
repositories { | |
mavenLocal() | |
mavenCentral() |
This file contains hidden or 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
// create an object | |
public class SomeObject { | |
public Date someDate; | |
public Integer someInt; | |
public String someString; | |
public Double someDouble; | |
} | |
// create vertx handler | |
router.put("/vertx", ctx -> { |
This file contains hidden or 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
import io.vertx.core.Handler | |
import io.vertx.groovy.ext.unit.Async | |
import io.vertx.groovy.ext.unit.TestContext | |
import io.vertx.groovy.ext.unit.junit.VertxUnitRunner | |
import org.junit.runner.RunWith | |
@RunWith(VertxUnitRunner.class) | |
abstract class GroovyTestBase { | |
public GroovyTestBase() { |
OlderNewer