Blog Articles - page 2
-
Snippet: Tagless Final vs OOP
Snippet of code discussing Tagless Final vs OOP-style dependency injection.
Read article → -
Snippet: Remove blank lines from text
Just a regular expression.
Read article → -
There are No Acceptable Ads
Retracted article
Read article → -
Execute shell commands in F#
Snippet in plain F# with no dependencies. Features a neat shebang.
Read article → -
Using ScalaTest for Effects
Helpers for integrating with
Read article →cats.effect.IO
. -
Best practice for natural Ordering
Definitions of
Read article →scala.math.Ordering
MUST BE consistent withequals
, an often overlooked law that can lead to problems. -
Managing Database Migrations in Scala
The database schema should be described as code, in your repository. And you should be able to semi-automatically update your database schema on new deployments.
Read article → -
List static blog tags in folder (Jekyll, etc)
Script for listing the used tags of a Jekyll directory of articles.
Read article → -
I like Option.get
We should strive to make illegal states unrepresentable.
Read article →Option.get
is a partial function that, according to many, shouldn’t be in the standard library. Yet it doesn’t bother me; the inability of Scala to make it safe is the problem. -
Organize and Index Your Screenshots (OCR) on macOS
Screenshots contain text, text that should be searchable, as finding a screenshot later is the whole point of creating it.
Read article → -
Block comments on the web
Comments on the web can be toxic, and a waste of time. Here’s how to block them…
Read article → -
Generic IOApp alternative
Read article →IOApp
alternative, for Cats Effect v2, that can work with any effect type. -
Effect Runtime
Defining a “runtime” for Cats-Effect v2 that provides the underlying environment necessary (i.e.
Read article →ContextShift
,Timer
,Clock
). -
When My World Vanishes
It’s me, facing a hard to solve problem. It’s a difficult one, and I’m having problems focusing. I make some coffee, I move to another room, and I’m already thinking of running to some coffee shop, forgetting that we’re still in a pandemic.
Read article → -
Scala Snippet: Unlawful Effects
Unlawful/independent version of
Read article →cats.effect.Effect
. -
Running integration tests, with Scala + sbt
Scala sbt setup for separating unit tests from integrationt tests.
Read article → -
Scala Snippet: Flow/Processor to Effect
Converts an Akka Streams
Read article →Flow
into anIn => IO[Out]
method, thus wrappingFlow
into Cats-Effect’sIO
. -
Privilege
Today it’s my 38ᵗʰ birthday. I was born into privilege. Other people aren’t as lucky.
Read article → -
Scala Snippet: Safe Passwords
For security, it’s not a good practice to keep sensitive data in RAM indefinitely.
Read article → -
Sample Error Hierarchy in Scala
Mimicking the HTTP error codes.
Read article →