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 / 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 / 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 / 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:6572430
Created September 15, 2013 16:50
change extension
for file in *.JPG; do mv -- "$file" "$(expr "$file" : '\(.*\)\.JPG').jpg"; done
@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:8740998
Created January 31, 2014 19:14
Enable JMX Grails
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9004
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
@dgouyette
dgouyette / .tmux.conf
Last active August 29, 2015 14:00
Conf tmux
# Our .tmux.conf file
# Setting the prefix from C-b to C-a
# START:prefix
#set -g prefix C-a
# END:prefix
# Free the original Ctrl-b prefix keybinding
# START:unbind
#unbind C-b
# END:unbind
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
" If you're a more advanced user, building your own .vimrc based
" on this file is still a good idea.
"------------------------------------------------------------
" Features {{{1
"
" These options and commands enable some very useful features in Vim, that
@dgouyette
dgouyette / filterTransform.scala
Last active August 29, 2015 14:09
filterTransform
val objTransformer =
(__ \ "_embedded" \ "contract").json.copyFrom(
(__ \ "contract").readNullable[JsArray].map(_.getOrElse(JsArray()))
) and
(__ \ "_embedded" \ "comment").json.copyFrom(
(__ \ "comment").readNullable[Comment].filter(reviewOpt => isApproved(reviewOpt))
)
(__ \ "title").readNullable[String].map(_.fold(JsObject(Nil))(s => Json.obj("title" -> s)))
@dgouyette
dgouyette / temp.ino
Created August 6, 2015 20:35
temp arduino
#include <SPI.h>
#include <Ethernet.h>
#include <DHT11.h>
int pin=2;
DHT11 dht11(pin);