Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthieu Guillermin mguillermin

  • Swappie
  • Helsinki, Finlande
View GitHub Profile
View Applied-FP-with-Scala.md

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
schaloner / Application.java
Last active Jan 3, 2016
Load externally-defined data into an in-memory database for Play 2 testing.
View Application.java
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
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
<?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
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
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@naholyr
naholyr / _service.md
Created Dec 13, 2012
Sample /etc/init.d script
View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@ratibus
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
bverbeken / AfterOrganisationTest.java
Created Oct 19, 2012
Custom JUnit runner for Playframework (2.0) apps to eliminate boilerplate code
View AfterOrganisationTest.java
@RunWith(PlayJUnitRunner.class)
public class AfterOrganisationTest {
@Test
public void canBePersisted() {
new Organisation("org1").save();
Organisation reloadedOrg = Ebean.find(Organisation.class).findUnique();
assertThat(reloadedOrg.name).isEqualTo("org1");
}
@ziadoz
ziadoz / awesome-php.md
Last active Jan 14, 2022
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
View awesome-php.md