Skip to content

Instantly share code, notes, and snippets.

View jpcaruana's full-sized avatar

Jean-Philippe Caruana jpcaruana

View GitHub Profile
@jpcaruana
jpcaruana / .vimrc
Created April 1, 2011 09:21
ma conf vi
" This must be first, because it changes other options as side effect
set nocompatible
" coloration syntaxique
syn on
" met les buffer en arriere plan plutot que de les fermer
set hidden
"Détection du type de fichier pour l'indentation
public class DemarreurDeSuite extends DoFixture {
private static final Logger logger = Logger.getLogger(DemarreurDeSuite.class);
public boolean demarre() throws Exception {
logger.info("demarrage de tous les mock serveurs");
demarreStreamer();
demarrePublicite();
demarrePaiement();
demarreOptionsClient();
package org.agitude.fileutils
import java.io.File
import org.apache.commons.io.FileUtils
// Utility object for test purpose only
object DummyProject {
private val TMP_DIR = new File("tmp")
val WEB_PACKAGE = Package("org.agitude.web", "module1")
@jpcaruana
jpcaruana / Rationnel.scala
Created January 27, 2011 12:42
Rationnel.scala
object Rationnel {
implicit def conversionIntVersRationnel(i :Int) :Rationnel = Rationnel(i)
def apply(a :Int) :Rationnel = new Rationnel(a,1)
def pgcd(a :Int, b :Int) :Int = {
if (b == 0) a
else pgcd(b, a%b)
}
}
case class Rationnel(n :Int, d :Int) {
@jpcaruana
jpcaruana / 2ème passe après modif du pom.xml pour le faire compiler en 1.5
Created January 12, 2011 13:16
mvn clean install sonar:sonar -Dmaven.test.failure.ignore=true
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'sonar'.
[INFO] Ignoring available plugin update: 2.0-beta-2 as it requires Maven version 3.0
[INFO] Ignoring available plugin update: 2.0-beta-1 as it requires Maven version 3.0
[INFO] ------------------------------------------------------------------------
[INFO] Building sampleMavenProject
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting /home/jpcaruana/projets/buildr-sonar/mavenSampleProject/target
@jpcaruana
jpcaruana / mvn archetype
Created January 12, 2011 11:28
mvn archetype:generate
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/2.0/maven-archetype-plugin-2.0.pom
Downloading: http://repo1.maven.org/maven2/org/apache/maven/archetype/maven-archetype/2.0/maven-archetype-2.0.pom
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/2.0/maven-archetype-plugin-2.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
@jpcaruana
jpcaruana / .gitconfig
Created January 11, 2011 16:48
ma conf de git
[color]
branch = auto
diff = auto
status = auto
interactive = auto
[user]
name = Jean-Philippe CARUANA
email = [email protected]
[alias]
last = cat-file commit HEAD
@jpcaruana
jpcaruana / createBuildrProject.sh
Last active December 2, 2017 14:51
utiliser buildr pour créer un projet minimal
#!/bin/bash
projectName=$1
if [[ $projectName == '' ]]; then
echo "usage: $0 nameOfTheProjectToCreate"
exit 1
fi
mkdir $projectName
cd $projectName
@jpcaruana
jpcaruana / appelBarreVerteTime.java
Created January 10, 2011 16:28
new Date() avec BarreVerteTime
Date maDateNonTestable = new Date(); // :-( à ne plus faire
Date maDateTestable = BarreVerteTime.now(); // :-) la nouvelle façon
@jpcaruana
jpcaruana / testAvecTimeRule.java
Created January 10, 2011 16:27
appel à BarreVerteTimeRule
public class MonTest {
@Rule public BarreVerteTimeRule timeRule =
new BarreVerteTimeRule("2010-01-10 10:00:00");
@Test public void premierTest { /*...*/ }
@Test public void deuxiemeTest { /*...*/ }
}