Skip to content

Instantly share code, notes, and snippets.

@luksrn
luksrn / gist:4eabe736abf7ec1f30f1423b4695850d
Last active March 23, 2020 03:47
prometheus_http_requests_total - Total de requisições HTTP
# HELP prometheus_http_requests_total Counter of HTTP requests.
# TYPE prometheus_http_requests_total counter
prometheus_http_requests_total{code="200",handler="/api/v1/query"} 30
prometheus_http_requests_total{code="200",handler="/api/v1/status/config"} 1
prometheus_http_requests_total{code="200",handler="/api/v1/targets"} 1
prometheus_http_requests_total{code="200",handler="/metrics"} 509
@luksrn
luksrn / docker-compose.yml
Created April 1, 2019 23:52 — forked from pantsel/docker-compose.yml
example docker-compose.yml for kong, postgres and konga
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
version: '3'
services:
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
networks:
- desenv-local
ports:
- "5672:5672"
- "15672:15672"
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);
}
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 {
// module-info.java
module br.com.esig.database {
}
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 February 18, 2017 00:27
java-modular-9-parte-01-theUnsafe
Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
Unsafe unsafe = (Unsafe) f.get(null);
class Pessoa {
def methodMissing(String name, args){
println "Foi chamado ${name} com os argumentos ${args}"
}
}
def p = new Pessoa()
p.andar()
p.falar("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)