Skip to content

Instantly share code, notes, and snippets.

Avatar

LiBe libetl

View GitHub Profile
@libetl
libetl / MonitorSwf.java
Created Oct 30, 2015
A simple code to list and describe the SWF executions
View MonitorSwf.java
package customcode;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.function.Consumer;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.joda.time.DateTime;
@libetl
libetl / pom.xml
Created Mar 28, 2016
pom configuration to generate android app pics in each resolution
View pom.xml
<plugin>
<groupId>net.trajano.mojo</groupId>
<artifactId>batik-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>ldpi</id>
<goals><goal>rasterizer</goal></goals>
<phase>initialize</phase>
<configuration>
View CurlLogHttpRequestInterceptor.java
package org.toilelibre.libe.logs
import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.ArrayUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpRequest;
@libetl
libetl / CommonPartFinder.java
Created May 1, 2016
Common Part Finder between two String values
View CommonPartFinder.java
package org.toilelibre.libe.util;
public class CommonPartFinder {
private static final int INDEX_NOT_FOUND = -1;
private static final String EMPTY = "";
public static class Range {
private final int aDiffStart;
private final int aDiffEnd;
private final int bDiffStart;
@libetl
libetl / CurlStuff.java
Last active May 18, 2016
Curl in java
View CurlStuff.java
package org.toilelibre.libe.curl;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
import org.apache.commons.cli2.Argument;
import org.apache.commons.cli2.CommandLine;
View ExternalTypeIdTest1288.java
package com.fasterxml.jackson.databind.jsontype.ext;
import java.io.IOException;
import java.util.UUID;
import org.junit.Test;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
@libetl
libetl / free-reseau-incidents-du-jour.sh
Last active Jul 20, 2016
free-reseau-incidents-du-jour.sh
View free-reseau-incidents-du-jour.sh
#!/bin/bash
ESC=$(printf '\033');
RESULT="$(curl -s https://www.free-reseau.fr/incidents-du-jour/)"
echo -e " \033[1;33mNRA\033[0m \033[1;36m0h 4h 8h 12h 16h 20h\033[0m";
echo "$RESULT" | xmllint --html --nowarning --xpath '/html/body/table[position()>2]' - 2>/dev/null | tr '\n' ' ' | sed 's/\s\+/ /g' | sed 's/>\s\+</></g' | sed 's/\(<\/table>\)\?<table style="width:98%; padding-bottom:5px; padding-right:5px;" class="general"><colgroup style="width:22%"><\/colgroup><colgroup class="tablo_group" span="48"><\/colgroup><tr><td> <\/td><td colspan="8">2h<\/td><td colspan="8">6h<\/td><td colspan="8">10h<\/td><td colspan="8">14h<\/td><td colspan="8">18h<\/td><td colspan="8">22h<\/td><\/tr>//g' | sed 's/<tr><td colspan="49"><\/td><\/tr>//g' | sed 's/<\/table><table style="margin-left:auto; margin-right:auto;">.*//' | sed 's/<td class="etatok">1<\/td>/./g' | sed 's/<td class="etatnok">X<\/td>/X/g' | sed 's/<td class="etatnonfait"><\/td>/-/g
@libetl
libetl / A.java
Last active Jul 20, 2016
Jackson unmarshalling with Immutable objects (jackson-databind >= 2.7.6 or >= 2.8.1 or >= 2.9 or >=3)
View A.java
@JsonDeserialize (builder = A.Builder.class)
public class A { private final String b; private final int c;
@JsonPOJOBuilder (withPrefix = "")
public static class Builder {
private String b;
private int c;
@Override
public A build () {
@libetl
libetl / DiveDeepAnalyzer.java
Last active Oct 4, 2016
Dive Deep Analyzer
View DiveDeepAnalyzer.java
package org.toilelibre.libe.divedeepanalyzer;
import java.io.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
View IsItAltered.java
package org.toilelibre.libe.divedeepanalyzer;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import spoon.Launcher;