Skip to content

Instantly share code, notes, and snippets.

View fanf's full-sized avatar

François Armand fanf

View GitHub Profile
@fanf
fanf / specs2_regex_filtered_file_content_match.scala
Last active December 10, 2015 10:00
Specs2: compare files in two directories, filtering out some line based on regex (for ex when they contains datetime "now", random id, etc)
package test
/**
* Specs2 matcher are wonderful. You're almost sur to find one for your need, whatever the need.
* Mine was to compare the output of an algo writting a directory tree with template filled
* with a reference one. And great! Specs2 has a:
*
* actualDir must haveSameFilesAs(expectedDir)
*
* See: https://etorreborre.github.io/specs2/guide/SPECS2-3.6.6/org.specs2.guide.Matchers.html#optional
@fanf
fanf / ImplicitResolutionError.scala
Last active January 6, 2016 15:18
Implicit resolution error with Rapture
package fanf
import rapture.core._
import rapture.core.timeSystems.numeric
import rapture.io._
import rapture.net._
import rapture.json._
import rapture.uri._
import rapture.codec.encodings.`UTF-8`._
import rapture.json.jsonBackends.jackson._
2016-02-05 15:07:04] DEBUG com.normation.rudder.services.nodes.NodeInfoServiceCachedImpl - NodeInfo cache is up to date, last modification time: '2016-02-05T01:05:24.000+01:00'
[2016-02-05 15:07:04] DEBUG com.normation.rudder.services.policies.DeploymentServiceImpl - Reports updated in 532ms
[2016-02-05 15:07:04] DEBUG com.normation.rudder.services.policies.DeploymentServiceImpl - Timing summary:
[2016-02-05 15:07:04] DEBUG com.normation.rudder.services.policies.DeploymentServiceImpl - Fetch all information : 282 ms
[2016-02-05 15:07:04] DEBUG com.normation.rudder.services.policies.DeploymentServiceImpl - Historize names : 571 ms
[2016-02-05 15:07:04] DEBUG com.normation.rudder.services.policies.DeploymentServiceImpl - Build current rule values : 11 ms
[2016-02-05 15:07:04] DEBUG com.normation.rudder.services.policies.DeploymentServiceImpl - Build target configuration: 68 ms
[2016-02-05 15:07:04] DEBUG com.normation.rudder.services.policies.DeploymentServiceImpl - U

Fin janvier, j'ai envoyé une quarantaine d'emails (le mail est à la fin du text) à des hommes politiques dans le cadre d'une action coordonnée par le Mouvement Y (https://mouvy.fr/)

Je n'ai eu qu'une seule réponse, de M. Luc CARVOUNAS, Sénateur du Val-de-Marne et Maire d'Alfortville.

Je la publie avec son accord:

Keybase proof

I hereby claim:

  • I am fanf on github.
  • I am fanf42 (https://keybase.io/fanf42) on keybase.
  • I have a public key ASCGuywQu4PHCovlhfQ7Siukvf0PAZqdWQ9VTNoPD-OJQAo

To claim this, I am signing this object:

object FreekQuickSearch {
import cats.free.Free
import cats.data.Xor
import freek._
final case class Wrong(message: String, cause: Option[Throwable] = None)
type Maybe[A] = Xor[Wrong, A]
///
object Test {
/*
* This is a clearer version of https://gist.github.com/fanf/f26eee67ae33bf54e363e4e5dce01388
*/
type Maybe[A] = Xor[String, A]
final case class Query(value: String)
final case class Result(value: String)
/*
* Follow up of https://gist.github.com/fanf/845273a15377347a04375d51a0139b78
* trying to use the new onionT1/onionT2/onionT3 from cats 0/6
*/
object Test1 {
type Maybe[A] = Xor[String, A]
final case class Query(value: String)
-startup
plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.400.v20160518-1444
-vmargs
-Xmx3G
-Xms3G
-Xss32m
-XX:+UnlockExperimentalVMOptions
-XX:+UseLargePages
/*
* In our code, we have dozen of class to model our domain.
* Most of them have a name, or an id which happen to be implemented
* by a string.
* As we want the compiler to work for us especially during refactoring,
* we have zillions of things like that:
*/
final case class DirectiveId(value: String)
final case class Directive(