Skip to content

Instantly share code, notes, and snippets.

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

federico silva fedesilva

👁️‍🗨️
View GitHub Profile
@fedesilva
fedesilva / fsharp-tutorial.fs
Created April 10, 2025 15:00 — forked from odytrice/fsharp-tutorial.fs
F# Code Samples
// This sample will guide you through elements of the F# language.
//
// *******************************************************************************************************
// To execute the code in F# Interactive, highlight a section of code and press Alt-Enter in Windows or
// Ctrl-Enter Mac, or right-click and select "Send Selection to F# Interactive".
// You can open the F# Interactive Window from the "View" menu.
// *******************************************************************************************************
// For more about F#, see:
@fedesilva
fedesilva / config
Created February 18, 2025 23:33 — forked from adibhanna/config
Ghostty config
font-family = BerkeleyMono Nerd Font
#font-family = Iosevka Nerd Font
# font-family = SFMono Nerd Font
font-size = 20
theme = GruvboxDarkHard
shell-integration-features = no-cursor,sudo,no-title
cursor-style = block
adjust-cell-height = 35%
# background-opacity = 0.96
@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]{}