Skip to content

Instantly share code, notes, and snippets.

View lbialy's full-sized avatar

Łukasz Biały lbialy

View GitHub Profile
@lbialy
lbialy / FP-Implicits-Specification.scala
Last active October 15, 2018 09:29
Scala - multiple approaches to Specification Pattern
object Specification {
type Spec[-A] = A => Boolean
implicit class SpecOps[A](_this: Spec[A]) {
def and(that: Spec[A]) = (item: A) => _this(item) && that(item)
def or(that: Spec[A]) = (item: A) => _this(item) || that(item)
def not = (item: A) => !_this(item)
}
@lbialy
lbialy / gist:81459de956c20307ecf1
Last active January 23, 2018 17:37
Laravel multiple implementations via IoC
######################################
<?php
// project_root/app/config/orderrepository.php
return [
'implementation' => 'Voipdeploy\Application\Database\Repositories\OrmOrderRepository'
];
?>