Skip to content

Instantly share code, notes, and snippets.

View mguillermin's full-sized avatar

Matthieu Guillermin mguillermin

  • Swappie
  • Helsinki, Finlande
View GitHub Profile
@bverbeken
bverbeken / AfterOrganisationTest.java
Created October 19, 2012 11:31
Custom JUnit runner for Playframework (2.0) apps to eliminate boilerplate code
@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");
}
@ratibus
ratibus / gist:3952552
Created October 25, 2012 13:29
Nettoyage de dépôt Git
# 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
@damienalexandre
damienalexandre / facets.php
Created May 28, 2013 08:30
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.
<?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)
@schaloner
schaloner / Application.java
Last active January 3, 2016 11:09
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()
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

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)

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
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@adamloving
adamloving / temporary-email-address-domains
Last active April 24, 2024 14:20
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).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com