Skip to content

Instantly share code, notes, and snippets.

View dgouyette's full-sized avatar
🏠
Working from home

GOUYETTE Damien dgouyette

🏠
Working from home
View GitHub Profile
@dgouyette
dgouyette / MacroEtAliasTYpe.scala
Created January 10, 2014 19:26
Macro et alias de type
case class CartLine(id: Option[Long], start: DateTime, end: DateTime, saisonId: Long, chambreId: Long, quantity: Int, unityPrice: BigDecimal, tax: BigDecimal, cartId: Option[Long])
case class Cart(id: Option[Long], createdAt: DateTime)
object Cart {
type CartWithLine = (Cart, List[CartLine])
}
implicit val cartLineFormat = Json.format[CartLine]
implicit val cartWithLineFormat = Json.format[CartWithLine]
@dgouyette
dgouyette / gist:6572430
Created September 15, 2013 16:50
change extension
for file in *.JPG; do mv -- "$file" "$(expr "$file" : '\(.*\)\.JPG').jpg"; done
@dgouyette
dgouyette / gist:6478521
Last active December 22, 2015 13:19
vhosts
cat sites-enabled/www.cestpasdur.com
<VirtualHost *:80>
ServerName cestpasdur.com:80
ServerAlias nexus.cestpasdur.com
UseCanonicalName Off
ServerAdmin "[email protected]"
CustomLog /var/www/www.cestpasdur.com/logs/nexus_access_log plesklog
@dgouyette
dgouyette / gist:6350543
Last active December 21, 2015 18:58
idea alias
alias idea='/home/applications/idea-IU-129.451/bin/idea.sh > /dev/null 2>&1 &'
@dgouyette
dgouyette / play.rb
Last active December 15, 2015 14:39
Install Play play-2.1.1-RC2 with homebrew
# Recipe for play-2.1.1-RC2
require 'formula'
class Play < Formula
homepage 'http://www.playframework.org/'
url 'http://downloads.typesafe.com/play/2.1.1-RC2/play-2.1.1-RC2.zip'
md5 'ef4b378dae9c6a8711f9f5395e626ca3'
version '2.1.1-RC2'
@dgouyette
dgouyette / FutureTest.java
Created October 1, 2012 11:46
FutureTest
import com.google.common.util.concurrent.*;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
public class FutureTest {
@Grab('org.fluttercode.datafactory:datafactory:0.8')
@GrabConfig(systemClassLoader=true)
import org.fluttercode.datafactory.impl.DataFactory;
@Grab('org.elasticsearch:elasticsearch:0.19.0')
@GrabConfig(systemClassLoader=true)
import org.elasticsearch.client.Client;
import org.elasticsearch.node.Node;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
@dgouyette
dgouyette / backbonePlay
Created December 23, 2011 07:32
debut de pages play avec backbone
#{extends 'main.html' /}
#{set title:'Home' /}
<script src="@{'/public/javascripts/require-1.0.4.js'}" type="text/javascript" charset="${_response_encoding}"></script>
<script>
require([
"/public/javascripts/order.js!/public/javascripts/json2.js",
"/public/javascripts/order.js!/public/javascripts/jquery-1.7.1.min.js",
@dgouyette
dgouyette / checkExistingFile.groovy
Created July 6, 2011 13:51
Search inside properties if value file exists
new File("D://myPath/").eachDirRecurse() { dir ->
dir.eachFileMatch(~/.*.properties/) { file ->
file.eachLine{ln ->
if ( ln =~/\.bat$/) {
path = ln.split("=")[1]
if (path.startsWith("D:/")){
if (!new File(path).exists()){
println file.path+" => "+ ln
}
}
@dgouyette
dgouyette / unix-commandes.sh
Created May 16, 2011 07:15
Commandes unix
//Trouver une exception dans un répertoire
find . -name "*" | xargs grep ClassCastException
//Compresser un répertoire
tar cvzf plop.tgz lerepertoire