Skip to content

Instantly share code, notes, and snippets.

Avatar

Edenir Norberto Anschau edenir-anschau

  • São Paulo, SP, Brazil
View GitHub Profile
@edenir-anschau
edenir-anschau / SSLPoke.java
Created Jul 14, 2020 — forked from MatthewJDavis/SSLPoke.java
Java SSL poke from atlassian
View SSLPoke.java
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {
@edenir-anschau
edenir-anschau / IllegalStateException_thrown_by_DevTools.md
Last active Nov 13, 2017
IllegalStateException thrown by DevTools
View IllegalStateException_thrown_by_DevTools.md
[INFO] Attaching agents: []
Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:/home/user/.m2/repository/ognl/ognl/3.0.8/ognl-3.0.8.jar
	at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromClassPathOfJarManifestIfPossible(ChangeableUrls.java:110)
	at org.springframework.boot.devtools.restart.ChangeableUrls.fromUrlClassLoader(ChangeableUrls.java:96)
	at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getUrls(DefaultRestartInitializer.java:93)
	at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getInitialUrls(DefaultRestartInitializer.java:56)
	at org.springframework.boot.devtools.restart.Restarter.<init>(Restarter.java:140)
	at org.springframework.boot.devtools.restart.Restarter.initialize(Restarter.java:546)
	at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationStartingEvent(RestartApplicationListener.java:67)
	at org.springframework.boot.d
View git_branch_ps1
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[1;31m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[1;32m\]"
NO_COLOR="\[\033[0m\]"
PS1="$GREEN\u@\h$NO_COLOR:\w$YELLOW\$(parse_git_branch)$NO_COLOR\$ "
View gist:0f7dba1b72e901a340dc486a77b20fbf
package test;
import org.apache.http.HttpStatus;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.bio.SocketConnector;
import org.eclipse.jetty.webapp.WebAppContext;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static com.jayway.restassured.RestAssured.*;
@edenir-anschau
edenir-anschau / persistence.xml
Created Feb 6, 2017 — forked from mortezaadi/persistence.xml
persistence xml configurations for major databases and jpa providers
View persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->
View dabblet.css
div {
width: 100px;
height: 100px;
/* Para deixar o texto centralizado na div,
podemos colocar um line-height igual à altura
dela. Só funciona bem se o texto tiver uma
linha só.
*/
line-height: 100px;
text-align: center;
@edenir-anschau
edenir-anschau / gist:ff5dd1c6473d51c68a16ce4fdf5a38d1
Created Dec 20, 2016
Allowing less secure apps to access gmail account
View gist:ff5dd1c6473d51c68a16ce4fdf5a38d1
https://support.google.com/accounts/answer/6010255
View gist:1fedeb2ea144b520a63be1ec4f86a09d
byte[] bytes = ByteStreams.toByteArray(inputStream);
http://google.github.io/guava/releases/19.0/api/docs/com/google/common/io/ByteStreams.html#toByteArray(java.io.InputStream)
View gist:3cd6c22302ea5ce2e824757971a40540
export MAVEN_OPTS="-Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
@edenir-anschau
edenir-anschau / StopwatchExample.java
Created Jul 16, 2016 — forked from P7h/StopwatchExample.java
Sample example demonstrating usage of Stopwatch API of Google Guava.
View StopwatchExample.java
import java.util.Random;
import java.util.concurrent.TimeUnit;
import com.google.common.base.Stopwatch;
/**
* Sample example demonstrating usage of Stopwatch API of Google Guava.
*
* @see <a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Stopwatch.html">Guava Stopwatch</a>
*/
You can’t perform that action at this time.