Skip to content

Instantly share code, notes, and snippets.

View eltabo's full-sized avatar

Francisco Javier Taboada Santamaría eltabo

View GitHub Profile
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/example.json",
"type": "object",
"title": "The Root Schema",
"required": [
"id",
"name",
"price"
@eltabo
eltabo / DigitoControl.java
Created January 14, 2016 07:46
Cálculo del dígito de control del código de municipio INE
public class DigitoControl {
private static final int[][] magic = {
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9},
{0, 3, 8, 2, 7, 4, 1, 5, 9, 6},
{0, 2, 4, 6, 8, 1, 3, 5, 7, 9}
};
public static int calc(int test) {
byte[] bytes = String.format("%05d", test).getBytes();
@eltabo
eltabo / TheEvilMapLikeMonsterThatMakeYouHateMe.java
Last active July 24, 2017 23:27
TheEvilMapLikeMonsterThatMakeYouHateMe
package snippet;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class TheEvilMapLikeMonsterThatMakeYouHateMe<K>{
private HashMap<K, Object> innerMap = new HashMap<K, Object>();
public boolean equals(Object o) {
@eltabo
eltabo / RestTemplateTest.java
Last active August 29, 2015 13:56
RestTemplateTest + Timeouts
package snippet;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.Proxy.Type;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import org.springframework.http.HttpMethod;