Skip to content

Instantly share code, notes, and snippets.

View fedesilva's full-sized avatar
👁️‍🗨️

federico silva fedesilva

👁️‍🗨️
View GitHub Profile
@fedesilva
fedesilva / .scalafmt.conf
Last active September 15, 2024 06:27
fede scalafmt.conf
version = "3.7.15"
maxColumn = 100
assumeStandardLibraryStripMargin = true
continuationIndent.callSite = 2
continuationIndent.defnSite = 2
align.openParenCallSite = false
align.openParenDefnSite = false
align = most
align.preset = more
@fedesilva
fedesilva / outout.txt
Created April 12, 2024 01:46
teensyduino verbose output
@fedesilva
fedesilva / build.sbt
Created August 11, 2021 04:02 — forked from xuwei-k/build.sbt
use flatbuffers java from sbt
import scala.sys.process.Process
scalaVersion := "2.12.6"
libraryDependencies ++= Seq(
"com.google.flatbuffers" % "flatbuffers-java" % "1.9.0"
)
sourceGenerators in Compile += Def.task {
val files = (file("src/main/fbs") ** "*.fbs").get.map(_.getAbsolutePath).toList
@fedesilva
fedesilva / .scalafmt.conf
Created June 12, 2019 21:46
My scalafmt config
version = "2.0.0-RC4"
align = most
maxColumn = 100
docstrings = ScalaDoc
assumeStandardLibraryStripMargin = true
continuationIndent.callSite = 2
continuationIndent.defnSite = 2
align.openParenCallSite = false
align.openParenDefnSite = false
@fedesilva
fedesilva / circe-inmemory-ttfi-di.sc
Created May 8, 2019 13:24 — forked from MateuszKubuszok/circe-inmemory-ttfi-di.sc
Showoff code that I probably wouldn't use on production, but looks smarter than whatever stuff is actually required in our everyday coding :P
//
// @author: Mateusz Kubuszok
//
// requirements: ammonite 1.1.0
// usage: run `amm` and copy paste into REPL
import $ivy.`org.typelevel::cats-core:1.3.1`, cats._, cats.syntax.all._
import $ivy.`org.typelevel::cats-effect:1.0.0`, cats.effect._, cats.effect.syntax._
import $ivy.`io.circe::circe-core:0.9.3`, io.circe._, io.circe.syntax._
import $ivy.`io.circe::circe-generic:0.9.3`, io.circe.generic.auto._
@fedesilva
fedesilva / ConsoleJsonWriter.java
Created December 20, 2018 20:54 — forked from jonnywray/ConsoleJsonWriter.java
Generic JSON reporter for Dropwizard metrics (https://dropwizard.github.io/metrics/3.1.0/) for sending JSON representation to arbitrary HTTP endpoint
import com.codahale.metrics.MetricFilter;
import com.codahale.metrics.MetricRegistry;
import com.fasterxml.jackson.databind.SerializationFeature;
import java.io.PrintStream;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
@fedesilva
fedesilva / SangriaReproExample.scala
Created August 13, 2018 19:09 — forked from OlegIlyenko/SangriaReproExample.scala
An example of minimal self-contained snippet that reproduces specific issue
// Imports that you are using
import sangria.schema._
import sangria.execution._
import sangria.macros._
import sangria.marshalling.circe._
import scala.concurrent.ExecutionContext.Implicits.global
// The schema definition
@fedesilva
fedesilva / OneOf.scala
Created July 31, 2018 20:55 — forked from wheaties/OneOf.scala
Type Level OneOf
trait OneOf[Obj, Items]
object OneOf extends LowPriorityOneOf{
implicit def apply[Obj, Items](implicit oneOf: OneOf[Obj, Items]) = oneOf
implicit def left[L, R, Obj <: L] = new OneOf[Obj, L | R]{}
}
protected trait LowPriorityOneOf extends LowPriorityOneOf1{
implicit def right[L, R, Obj <: R] = new OneOf[Obj, L | R]{}
@fedesilva
fedesilva / SimplePartitionSample.scala
Created July 6, 2018 19:46 — forked from johanandren/SimplePartitionSample.scala
Sample of using partition to split up incoming elements over multiple outgoing streams
import akka.actor.ActorSystem
import akka.stream._
import akka.stream.scaladsl._
import scala.io.StdIn
import scala.util.Random
object SimplePartitionSample extends App {
implicit val system = ActorSystem()
#!/bin/sh
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
sudo brew services restart php71
echo "xdebug disabled"