Skip to content

Instantly share code, notes, and snippets.

View francisdb's full-sized avatar
💾
undefined

Francis De Brabandere francisdb

💾
undefined
  • Ghent, Belgium
View GitHub Profile
@francisdb
francisdb / gist:3497313
Created August 28, 2012 11:15
Fix locale issues when connecting to ubuntu server from mac (iTerm)
add this to ~/.bash_profile
export LANG="en_US.utf8"
export LANGUAGE="en_US.utf8"
export LC_ALL="en_US.utf8"
@francisdb
francisdb / gist:3614146
Created September 3, 2012 22:24
Story format (Scrum/Kanban/Agile)
As a ...
I want ...
so that ...
@francisdb
francisdb / gist:3701673
Created September 11, 2012 20:14
Moving/copying git commits
git checkout newbranch
git cherry-pick 612ecb3
@francisdb
francisdb / gist:4514950
Last active December 11, 2015 00:09
Logging WS requests in playframework scala
// I'm looking for a better solution for the time logging (preferable in a transparent way)
private def logTime(message: String, promise: Future[Response]) = {
// not 100% ok, request is already running
// might even not be started yet
val now = System.currentTimeMillis
promise.onRedeem { response =>
val time = System.currentTimeMillis - now
logger.info(message + " => " + response.status + " " + time + "ms " + response.body.length + "b")
}
@francisdb
francisdb / gist:5031171
Created February 25, 2013 16:45
add more automatic imports in play framework 2 templates
.settings{
routesImport += "se.radley.plugin.salat.Binders._",
templatesImport += "org.bson.types.ObjectId"
}
#!/bin/sh
export PATH=/opt/play2:$PATH
cd ~/server
rundir=myproject
repo=git@server:myproject.git
temp=$rundir.buid.temp
rm -rf $temp
@francisdb
francisdb / Dependencies.scala
Created August 29, 2013 21:57
JacksonMapper for easy json in scala
val fasterXmlJacksonVersion = "2.2.2"
val appDependencies = Seq(
"com.fasterxml.jackson.core" % "jackson-core" % fasterXmlJacksonVersion,
"com.fasterxml.jackson.core" % "jackson-annotations" % fasterXmlJacksonVersion,
"com.fasterxml.jackson.core" % "jackson-databind" % fasterXmlJacksonVersion,
"com.fasterxml.jackson.module" %% "jackson-module-scala" % fasterXmlJacksonVersion
)
@francisdb
francisdb / gist:6471158
Created September 6, 2013 23:02
Anorm + play json
implicit val pkWrites = new Writes[Pk[Long]] {
def writes(pk: Pk[Long]): JsValue = {
pk.toOption match {
case Some(value) => JsNumber(value)
case None => JsNull // TODO check if correct
}
}
}
@francisdb
francisdb / gist:6630625
Created September 19, 2013 22:16
Debug maven test (waits for debugger to connect)
mvn clean test -Dmaven.surefire.debug -Dtest=com.bla.MyTest

Keybase proof

I hereby claim:

  • I am francisdb on github.
  • I am francisdb (https://keybase.io/francisdb) on keybase.
  • I have a public key ASDi22NaZc8VXnPYJss4TqmTHejsi7CTmjQBvRyqVulKqgo

To claim this, I am signing this object: