Skip to content

Instantly share code, notes, and snippets.

View nherbaut's full-sized avatar

Nicolas Herbaut nherbaut

View GitHub Profile
# How to perform a release with git & maven following the git flow conventions
# ----------------------------------------------------------------------------
# Finding the next version: you can see the next version by looking at the
# version element in "pom.xml" and lopping off "-SNAPSHOT". To illustrate,
# if the pom's version read "0.0.2-SNAPSHOT", the following instructions would
# perform the release for version "0.0.2" and increment the development version
# of each project to "0.0.3-SNAPSHOT".
# branch from develop to a new release branch
git checkout develop
@nherbaut
nherbaut / java
Last active October 19, 2017 14:32
Sending Celery Task through rabbitmq in Java
package com.mirlitone;
import java.io.IOException;
import org.junit.Test;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
@nherbaut
nherbaut / gist:18c7b3497a3d7b17106a
Last active August 29, 2015 14:10
demarshall with xstream with no root
package com.mirlitone;
import java.io.IOException;
import java.io.Writer;
import java.util.UUID;
import javax.xml.bind.JAXBException;
import org.junit.Test;
@nherbaut
nherbaut / gist:07c03a31eba4cd7d5d8b
Created December 2, 2014 20:00
Chained and paralellized workers with celery
from celery import chord
from celery import group
from celery import chain
from tasks import download,transcode,hls,dash
download.apply_async(("http://google.com","123"),link=chord(group([transcode.s(400,5),transcode.s(400,1),transcode.s(400,3), transcode.s(500,10)]),group(hls.s(),dash.s())))
@nherbaut
nherbaut / là-bas podcast
Created January 26, 2015 09:03
Podcast Là-bas si j'y suis
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>L| -bas si j'y suis</title>
<description>Plus près des jetables que des notable</description>
<link>http://la-bas.org/</link>
<pubDate>21 Jan 2015 19:00:00 PST </pubDate>
<language>fr-fr</language>
<copyright> Copyright 2015 L| -bas si j'y suis </copyright>
<atom:link href="http://mirlitone.com/la-bas.xml" rel="self" type="application/rss+xml"/>
startup:{
driver:"ssh",
conf : {
user:"root",
auth: "cert.pem",
action:"service redis restart"
}
},
startup:{
driver:"webservice",
#!/bin/bash
#Script for Ubuntu 14.04
#Install Java maven apache mongodb and Git
apt-get install openjdk-7-jre openjdk-7-jdk maven apache2 mongodb-server git
#create dir /etc/mediahome
mkdir /etc/mediahome
# creat file box and server configuration
@nherbaut
nherbaut / gist:0951a2d3de18a2e20599
Created March 6, 2015 18:38
type safe list filtering
@SuppressWarnings("unchecked")
public <T extends Property> Collection<T> getList(final Class<T> t){
final Properties props = new Properties();
props.getProperty().add(new Property());
props.getProperty().add(new SmtpProperty());
return (Collection<T>) Collections2.filter(props.getProperty(), new Predicate<Property>() {
@Override
@nherbaut
nherbaut / gist:527d57df91cd09b61408
Created March 9, 2015 08:46
Grizzly Context injection
@Inject
private Provider<org.glassfish.grizzly.http.server.Request> grizzlyRequest;
@GET
@Path("get")
public Response getTest() {
System.out.println(grizzlyRequest.get().getRemoteAddr());
//CODE
}
@nherbaut
nherbaut / gist:add5ea9699553cc8de95
Last active August 29, 2015 14:16
basic auth jersey
public void testGetIt() throws IOException {
HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic("user", "superSecretPassword");
Client client = ClientBuilder.newClient();
client.register(feature);
WebTarget target = client.target("http://localhost:8080/myapp");
target.path("myresource").get();