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
public class App { | |
static { | |
new Thread(() -> { | |
Server server = new Server(8080); | |
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); | |
context.setContextPath("/"); | |
server.setHandler(context); | |
try { |
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
<dependencies> | |
<dependency> | |
<groupId>org.eclipse.jetty</groupId> | |
<artifactId>jetty-server</artifactId> | |
<version>9.4.6.v20170531</version> | |
</dependency> | |
<dependency> | |
<groupId>org.eclipse.jetty</groupId> | |
<artifactId>jetty-servlet</artifactId> |
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
package com.zt; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ScheduledExecutorService; |
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
final FileReader in = new FileReader(new File("lines.txt")); | |
BufferedReader reader = new BufferedReader(in); | |
final ArrayList<String> strings = new ArrayList<>(); | |
String line; | |
while ((line = reader.readLine()) != null) { | |
strings.add(line); | |
} |
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
for file in `find . -name *.jar`; do jar -ft $file >> ~/out.txt ; done | |
grep "com/sun/[a-z]" out.txt | awk -F"/" '{print $1"/"$2"/"$3}' | sort -u | |
com/sun/accessibility | |
com/sun/activation | |
com/sun/applet2 | |
com/sun/awt | |
com/sun/beans | |
com/sun/codemodel | |
com/sun/corba |
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
from isuper/java-oracle:jdk_8 | |
ENV JRE_HOME=/usr/lib/jvm/java-8-oracle | |
run curl -Lks https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-software-7.0.5-jira-7.0.5.tar.gz -o /root/jira.tar.gz | |
run /usr/sbin/useradd --create-home --home-dir /usr/local/jira --shell /bin/bash jira | |
run mkdir -p /opt/jira | |
run tar zxf /root/jira.tar.gz --strip=1 -C /opt/jira | |
run mkdir -p /opt/jira-home | |
run echo "jira.home = /opt/jira-home" > /opt/jira/atlassian-jira/WEB-INF/classes/jira-application.properties |
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
public class NullPointerExceptionsPuzzle { | |
public static void main(String[] args) { | |
try { | |
throw new NullPointerException("NullPointerException 1"); | |
} catch (NullPointerException e) { | |
throw new NullPointerException("NullPointerException 2"); | |
} finally { | |
return; | |
} | |
} |
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
" set cursorline | |
set expandtab | |
set modelines=0 | |
set shiftwidth=2 | |
set clipboard=unnamed | |
set synmaxcol=128 | |
set ttyscroll=10 | |
set encoding=utf-8 | |
set tabstop=2 | |
set nowrap |
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
//in build.gradle: | |
tasks.withType(JavaExec) { jvmArgs "-javaagent:xrebel.jar" } |
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
//in build.gradle: | |
project.afterEvaluate { | |
for (Task task : project.getTasks()) { | |
if (task instanceof JavaExec) { | |
(task as JavaExec).jvmArgs "-javaagent:xrebel.jar" | |
} | |
} | |
} |