Skip to content

Instantly share code, notes, and snippets.

View jpcaruana's full-sized avatar

Jean-Philippe Caruana jpcaruana

View GitHub Profile
@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 / 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) {
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")
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();
@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
# Scavenged from Git 1.6.5.x contrib/completion/git_completion.bash
# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
# returns text to add to bash PS1 prompt (includes branch name)
__gitdir ()
{
if [ -z "${1-}" ]; then
if [ -n "${__git_dir-}" ]; then
echo "$__git_dir"
elif [ -d .git ]; then
echo .git
@jpcaruana
jpcaruana / precompiler.rb
Created July 22, 2011 08:03 — forked from cacoco/precompiler.rb
Buildr Extension for precompiling JSP files.
module Precompiler
include Extension
first_time do
# Define task not specific to any projet.
desc 'Precompile jsps'
Project.local_task('precompile' => 'compile') { |name| "Precompiling #{name}" }
end
before_define do |project|
@jpcaruana
jpcaruana / list.log
Created November 17, 2011 15:23
list.redis
redis 127.0.0.1:6379> RPUSH messages "Bienvenue dans redis"
(integer) 1
redis 127.0.0.1:6379> RPUSH messages "Merci pour cette petite introduction sur barreverte.fr"
(integer) 2
redis 127.0.0.1:6379> RPUSH messages "Non seulement je passe du bon temps, mais je m'amuse en meme temps"
(integer) 3
redis 127.0.0.1:6379> LRANGE messages 0 3
1) "Bienvenue dans redis"
2) "Merci pour cette petite introduction sur barreverte.fr"
3) "Non seulement je passe du bon temps, mais je m'amuse en meme temps"
@jpcaruana
jpcaruana / autostart.sh
Created November 18, 2011 13:10
ma conf LXDE sous Mint
#!/bin/bash
xrandr --output VGA1 --auto --right-of HDMI1
@jpcaruana
jpcaruana / redis_pubsub_demo.rb
Created November 22, 2011 14:42 — forked from pietern/redis_pubsub_demo.rb
How to create a web chat with ruby & redis (Pieter Noordhuis)
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby