Skip to content

Instantly share code, notes, and snippets.

arey /
Created March 30, 2018 16:34
Java Logback configuration replacing classic logback.xml use
package com.javaetmoi.logback;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
import ch.qos.logback.classic.joran.action.JMXConfiguratorAction;
import ch.qos.logback.classic.jul.LevelChangePropagator;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.Appender;
arey / angular-from-scratch.html
Last active August 29, 2015 14:00
HTML et JavaScript basé sur le hand's on labs "AngularJS from scratch : comprendre Angular en le re-faisant de zéro" de Devoxx France 2014
<!DOCTYPE html>
<meta charset="utf-8">
<title>AngularJS from scratch</title>
<body class="container text-center">
<h1 class="page-header" ng-bind="labs.titre">AngularJS from scratch</h1>
<input type="text" ng-model="labs.titre"/>
arey /
Created April 9, 2014 19:56
No-operation Hibernate Scanner
package com.javaetmoi.core.persistence.hibernate;
import java.util.Collections;
import java.util.Set;
import org.hibernate.jpa.boot.archive.internal.StandardArchiveDescriptorFactory;
import org.hibernate.jpa.boot.scan.spi.AbstractScannerImpl;
import org.hibernate.jpa.boot.scan.spi.ScanOptions;
import org.hibernate.jpa.boot.scan.spi.ScanResult;
import org.hibernate.jpa.boot.spi.ClassDescriptor;
arey / pom-jasmine.xml
Created March 4, 2014 09:10
jasmine-maven-plugin configuration testing JavaScript code of a Java web app with Jasmine
<project xmlns="" xmlns:xsi=""
<name>JavaEtMoi Samples :: ${project.artifactId} - ${project.packaging}</name>
<description>Maven configuration to test JavaScript code of a Java web app with Jasmine et PhantomJS</description>
arey /
Created February 20, 2014 17:29
CXF interceptor fixing memory leak by removing attachments
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
import org.apache.cxf.endpoint.ClientImpl;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.phase.Phase;
* Fix CXF memory leak by removing attachments once the SOAP message was sent.
public class ClearAttachmentsOutInterceptor extends AbstractSoapInterceptor {
arey / JarFileClassPathLocationScanner
Created January 21, 2014 11:04
Flyway JarFileRecursiveClassPathLocationScanner for jar files opening all war and jar recursively.
package com.googlecode.flyway.core.util.scanner.classpath;
import java.util.Enumeration;
import java.util.Set;
arey / musicbrainz_fulltext
Created November 12, 2013 19:11
Full text search example on the MusicBrainz Elasticsearch index created by the batch provided in the repository.
curl -XPOST '' -d '
"from": 0,
"size": 10,
"query": {
"bool": {
"must": [
"fuzzy_like_this": {
"fields": [
arey / musicbrainz_autocomplete
Last active December 28, 2015 03:39
Search query that could be used for completion suggestions on the MusicBrainz Elasticsearch index created by the batch provided in the repository.
curl -XPOST '' -d '
"fields": [
"query": {
"query_string": {
arey / u2_archtung_baby.json
Created November 10, 2013 12:17
JSON document indexed into Elasticsearch (ref.
"id": "744c7a1b-ac79-35c4-bd92-7e2c6a24c8d8",
"name": "Achtung Baby",
"year": 1991,
"tags": [
"pop rock",
"album rock",
arey / select_musicbrainz_u2_album
Created October 2, 2013 06:54
SQL query retrieving all U2 album from the MusicBrainz database.
release_group.gid AS albumid,
release_group.type AS albumPrimaryTypeId, as albumPrimaryTypeName, AS albumName, AS artistName,
artist.gid AS artistGid,
artist.type as artisTypeId, as artistTypeName,
artist.begin_date_year artistBeginDateYear,