Skip to content

Instantly share code, notes, and snippets.

View edenir-anschau's full-sized avatar

Edenir Norberto Anschau edenir-anschau

  • São Paulo, SP, Brazil
View GitHub Profile
@edenir-anschau
edenir-anschau / gist:1e5da55ff4b7af8a81842081fedd7c55
Created March 31, 2016 03:25
Jenkins - deny users to sign up
Security Realm -> disable “allow users to sign up”
@edenir-anschau
edenir-anschau / StopwatchExample.java
Created July 16, 2016 14:09 — forked from P7h/StopwatchExample.java
Sample example demonstrating usage of Stopwatch API of Google Guava.
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>
*/
export MAVEN_OPTS="-Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
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)
@edenir-anschau
edenir-anschau / gist:e75af8d0c497370a94b8
Last active December 13, 2016 13:34
Git sees maven empty project
touch src/main/java/.gitignore src/main/resources/.gitignore src/test/java/.gitignore src/test/resources/.gitignore
@edenir-anschau
edenir-anschau / gist:ff5dd1c6473d51c68a16ce4fdf5a38d1
Created December 20, 2016 02:53
Allowing less secure apps to access gmail account
https://support.google.com/accounts/answer/6010255
@edenir-anschau
edenir-anschau / dabblet.css
Created January 21, 2017 21:55 — forked from anonymous/dabblet.css
Untitled
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 / persistence.xml
Created February 6, 2017 18:09 — forked from mortezaadi/persistence.xml
persistence xml configurations for major databases and jpa providers
<?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 -->
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.*;