Skip to content

Instantly share code, notes, and snippets.

@pbassiner
pbassiner / AutomateScalafmtPlugin.scala
Last active April 30, 2017 15:58
Automate Scalafmt Plugin
import org.scalafmt.bootstrap.ScalafmtBootstrap
import org.scalafmt.sbt.ScalafmtPlugin
import sbt._
import sbt.Keys._
import sbt.inc.Analysis
object AutomateScalafmtPlugin extends AutoPlugin {
object autoImport {
def automateScalafmtFor(configurations: Configuration*): Seq[Setting[_]] =
@pbassiner
pbassiner / ComposingFutureListAndEither.scala
Last active November 24, 2024 19:30
From List[Either[A, B]] to Either[A, List[B]]
import scala.language.postfixOps
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import cats.data.EitherT
import cats.instances.list._
import cats.instances.future._
import cats.syntax.traverse._