Skip to content

Instantly share code, notes, and snippets.

Lucas Farias luksrn

Block or report user

Report or block luksrn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@luksrn
luksrn / docker-compose.yml
Created Apr 1, 2019 — forked from pantsel/docker-compose.yml
example docker-compose.yml for kong, postgres and konga
View docker-compose.yml
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
View docker-composer.yml
version: '3'
services:
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
networks:
- desenv-local
ports:
- "5672:5672"
- "15672:15672"
View SessionRepositoryFilter.java
public class SessionRepositoryFilter implements Filter {
public doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
HttpServletRequest httpRequest = (HttpServletRequest) request;
SessionRepositoryRequestWrapper customRequest =
new SessionRepositoryRequestWrapper(httpRequest);
chain.doFilter(customRequest, response, chain);
}
View FirstTest.java
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
@Tag("fast")
class FirstTest {
View database-module.java
// module-info.java
module br.com.esig.database {
}
View MapeadorLinha.java
package br.com.esig.database;
import java.sql.ResultSet;
public interface MapeadorLinha<T> {
T mapear(ResultSet res, int index);
}
@luksrn
luksrn / gist:4e912a4dfec66bbede900f1682b59880
Last active Feb 18, 2017
java-modular-9-parte-01-theUnsafe
View gist:4e912a4dfec66bbede900f1682b59880
Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
Unsafe unsafe = (Unsafe) f.get(null);
View PessoaMethodMissing.groovy
class Pessoa {
def methodMissing(String name, args){
println "Foi chamado ${name} com os argumentos ${args}"
}
}
def p = new Pessoa()
p.andar()
p.falar("Groovy!")
View PessoaMissing.groovy
class Pessoa {
}
def p = new Pessoa()
p.andar()
//groovy.lang.MissingMethodException: No signature of method: Pessoa.andar() is applicable for argument types: () values: []
//Possible solutions: any(), any(groovy.lang.Closure), find(), miau(), find(groovy.lang.Closure), findAll()
// at ConsoleScript3.run(ConsoleScript3:6)
View metaClass.groovy
Object.metaClass.miau = {-> println "Miau!!!"}
"String".miau()
145.miau()
You can’t perform that action at this time.