Skip to content

Instantly share code, notes, and snippets.


Gavin Bisesi Daenyth

View GitHub Profile
Daenyth / toki-pona-words.txt
Last active Jan 15, 2022
lines in /usr/share/dict/words that match toki pona phonotactics
View toki-pona-words.txt
Daenyth / Prelude.scala
Created Jan 14, 2022
cats-effect prelude
View Prelude.scala
package com.myproject.prelude
import cats.syntax.{AllSyntaxBinCompat => CatsSyntax}
import cats.effect.syntax.{AllSyntax => CESyntax}
import cats.effect.instances.{AllInstances => CEInstances}
/** Custom prelude for importing with -Yimport
* This means we never need to import cats syntax or stream explicitly
Daenyth / VulcanHelper.scala
Created Nov 22, 2021
fs2-kafka vulcan => avro Serde helper
View VulcanHelper.scala
import cats.effect.Sync
import cats.syntax.all._
import cats.effect.std.Dispatcher
import fs2.kafka.vulcan.{AvroSettings, avroDeserializer, avroSerializer}
import fs2.kafka.{Deserializer, Headers, Serializer}
import org.apache.kafka.common.serialization.{Serde, Serdes}
import vulcan.Codec
// Credit to Fede Fernández for the original CE2 version
// Note: this isn't under an open source license; it's for educational purposes only
Daenyth /
Last active Aug 25, 2021

Keybase proof

I hereby claim:

  • I am daenyth on github.
  • I am daenyth ( on keybase.
  • I have a public key ASCSw0W8Kr-JKKaGIAxIIOqY3h1MuLZzNqx2epHUbiLD4Qo

To claim this, I am signing this object:

Daenyth /
Last active Jan 14, 2022
What's a monad

"Monad" is a word that describes a set of behaviors

In scala, we use the Monad[Foo] typeclass from cats to define instances of this behavior.

The essence of its behavior is the ability to describe a series of computations, where one computation depends on the result of the computation that came before it.

For example, Monad[Option] shows that the Option[A] data type can be used to describe computations of A which may result in no value.

View gist:3815d59338a3ded3fbb33f43493fc26b[aria-label="Timeline: Trending now"][aria-label="Who to follow"][data-testid="sidebarColumn"]
View gist:aa29b92d9dea593afceadab0ed8f0e4d
Exception filling window for RimWorld.Dialog_FormCaravan: System.NullReferenceException: Object reference not set to an instance of an object
at (wrapper dynamic-method) RimWorld.Dialog_FormCaravan.RimWorld.Dialog_FormCaravan.DoWindowContents_Patch2(RimWorld.Dialog_FormCaravan,UnityEngine.Rect)
at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x00165] in <0feb66f0236b4f2faa0d13d3d46f45b1>:0
Verse.Log:Error(String, Boolean)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)
Daenyth / .scalafmt.conf
Created Dec 2, 2020
My scalafmt preference (for now)
View .scalafmt.conf
version = "2.7.1"
align = some
align.arrowEnumeratorGenerator = true
align.openParenCallSite = true
align.tokens = [caseArrow]
binPack.parentConstructors = true
comments.wrap = standalone
Daenyth / DoobieSlickCompat.scala
Created Oct 30, 2020
Slick Database => doobie Transactor
View DoobieSlickCompat.scala
import cats.effect.{Async, Blocker, ContextShift}
import doobie.util.transactor.Transactor
import scala.concurrent.ExecutionContext
trait DoobieSlickCompat {
/** Create a Doobie Transactor backed by the same Jdbc DataSource as the live slick Database */
def transactorFromSlick[F[_]: Async: ContextShift](
slickDb: slick.jdbc.JdbcBackend#Database,
Daenyth /
Created Oct 10, 2020
Scala AWS library index


There's a lot of libraries with overlapping support. This tries to index the ones I've seen.

I only care about / list the ones that support cats-effect/fs2 in some way or another.

I'll list some project status:

  • Dead = fully abandoned or archived
  • Inactive = no changes for over a year (as of oct 2020)