Skip to content

Instantly share code, notes, and snippets.


Matthieu Guillermin mguillermin

  • Swappie
  • Helsinki, Finlande
View GitHub Profile

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
schaloner /
Last active Jan 3, 2016
Load externally-defined data into an in-memory database for Play 2 testing.
package controllers;
import models.Item;
import play.libs.Json;
import play.mvc.Controller;
import play.mvc.Result;
public class Application extends Controller
public static Result index()
damienalexandre / facets.php
Created May 28, 2013
Here is an example of how to get a query Filter from a list of Facet and user query (how to apply a facet on a query) with Elastica.
View facets.php
* Return query Filter from a list of query string & allowed Facets
* @param array $query The user query (facet_name => query, facet_name => query...)
* @param array $allowed_facets An array of Elastica\Facet
* @return \Elastica\Filter\AbstractFilter (if multiple filters, they are combined in BoolAnd filter)
private function getFacetsFilters($query, $allowed_facets)
adamloving / temporary-email-address-domains
Last active Jan 25, 2022
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
View temporary-email-address-domains
naholyr /
Created Dec 13, 2012
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.


Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
ratibus / gist:3952552
Created Oct 25, 2012
Nettoyage de dépôt Git
View gist:3952552
# On clone le dépot tout frais pour avoir un fichier pack complet pour l'analyse (c'est + simple)
git clone --mirror ...
# On se déplace dans le répertoire du clone
# On fait l'état des lieux initial
git count-objects -v > count-objects-init.txt
# On exporte le verify-pack (ça prend du temps ça)
git verify-pack -v objects/pack/pack*.idx > verify-pack.txt
bverbeken /
Created Oct 19, 2012
Custom JUnit runner for Playframework (2.0) apps to eliminate boilerplate code
public class AfterOrganisationTest {
public void canBePersisted() {
new Organisation("org1").save();
Organisation reloadedOrg = Ebean.find(Organisation.class).findUnique();
ziadoz /
Last active Jan 14, 2022
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.