Skip to content

Instantly share code, notes, and snippets.

View woupiestek's full-sized avatar

Wouter Stekelenburg woupiestek

View GitHub Profile
@woupiestek
woupiestek / phantom.scala
Created October 11, 2019 13:59
Cats effect IO query context for phantom dsl.
import cats.effect.{ContextShift, IO, Timer}
import cats.effect.concurrent.Deferred
import com.outworkers.phantom.DefaultImports
import com.outworkers.phantom.Manager.scalaExecutor
import com.outworkers.phantom.builder.query.execution.{FutureMonad, PromiseInterface}
import com.outworkers.phantom.ops.QueryContext
import scala.concurrent.ExecutionContextExecutor
import scala.concurrent.duration._
@woupiestek
woupiestek / LoadFromApplicationConf.scala
Created February 25, 2016 09:36
Configure logback with HOCON
package mypackage
import ch.qos.logback.core.joran.action.Action
import ch.qos.logback.core.joran.spi.InterpretationContext
import com.typesafe.config.ConfigFactory
import org.xml.sax.Attributes
/**
* Make properties defined in application.conf available to logback
*/
@woupiestek
woupiestek / LoggingMonadTransformerPOC.scala
Last active January 4, 2016 15:49
Build a logging monad with scalaz, apply it to futures and reproduce functionality of the futures monad.
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.language.higherKinds
import scalaz._
import Scalaz._
object LoggingMonadTransformerPOC extends App {
type LoggedT[F[_], A] = WriterT[F, List[String], A]
type LoggedFuture[A] = LoggedT[Future, A]