Skip to content

Instantly share code, notes, and snippets.

@luksrn
luksrn / gist:4eabe736abf7ec1f30f1423b4695850d
Last active Mar 23, 2020
prometheus_http_requests_total - Total de requisições HTTP
View gist:4eabe736abf7ec1f30f1423b4695850d
# 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 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)