Skip to content

Instantly share code, notes, and snippets.

Avatar

Harry Laoulakos harrylaou

View GitHub Profile
@harrylaou
harrylaou / AppComponents.scala
Last active May 11, 2018
Compile time DI for play
View AppComponents.scala
package application
import akka.actor.Scheduler
import application.filters.ExampleFilter
import com.typesafe.config.Config
import controllers.HomeController
import play.api.ApplicationLoader.Context
import play.api.BuiltInComponentsFromContext
import play.api.cache.EhCacheComponents
import router.Routes
@harrylaou
harrylaou / EitherConstructors.scala
Last active May 3, 2018
Monad Transformers package - just import utils.fee._ , to start using it
View EitherConstructors.scala
package utils.fee
import application.logger.MyLogger.RichLogger
import application.logger.MyLoggerT
import cats.syntax.EitherSyntax
import play.api.mvc.Results
import scala.util.Try
trait EitherConstructors extends EitherSyntax {
View DummyController.scala
package controllers
import application.AppComponents.DatabaseSB
import cats.data.Xor
import cats.implicits._
import emm._
import emm.compat.cats._
import models.User
import play.api.Logger.logger
import play.api.libs.json.{Format, JsValue, Json, Reads, Writes}
View designer.html
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
@harrylaou
harrylaou / CaseClassToMap.scala
Last active Mar 18, 2021
Converting case classes to Maps using Shapeless
View CaseClassToMap.scala
package com.harrylaou
import shapeless._
import shapeless.ops.product._
import shapeless.syntax.std.product._
/**
* Converting case classes to Maps using Shapeless
*
*