Skip to content

Instantly share code, notes, and snippets.

View dacr's full-sized avatar
🕷️

Crosson David dacr

🕷️
View GitHub Profile
@mikearnaldi
mikearnaldi / answers.md
Created November 14, 2021 17:31
My answers to Jan Nasiadka on ZIO
  • What do you think about ZIO’s typed errors? How do you think they help to write better applications?

Having typed errors is fundamental in order to write code that takes care of handling the edge cases, if you don’t have type information when calling a specific effect you cannot know what you may need to handle. At the moment typed errors are still limited in usability by Scala’s capabilities of dealing with unions, namely in Scala 2 unions are represented as sealed traits and you are forced to have an AppError tree with beneath a hierarchy of errors instead with the advent of Scala 3 it will be possible to represent errors using unions getting rid of the need for a big tree of sealed traits.

  • What do you think are the advantages of ZIO’s Fibers over Threads, when writing concurrent applications?

Fibers are extremely lightweight compared to threads and in ZIO they provide even a more rich api and set of capabilities. One of the huge innovations that ZIO introduces is the concept of a fork scope and a su

@mpilquist
mpilquist / predef.scala
Last active August 26, 2021 22:15
Ammonite REPL predef for use with fs2
// Save as ~/.ammonite/predef.sc
// To use fs2 from ammonite repl, type `load.fs2` from repl prompt.
// You'll get all fs2 & cats imports, ContextShift and Timer instances
// for IO, and a globalBlocker
import $plugin.$ivy.`org.typelevel:::kind-projector:0.11.0`
if (!repl.compiler.settings.isScala213)
repl.load.apply("interp.configureCompiler(_.settings.YpartialUnification.value = true)")
@dacr
dacr / index.md
Last active November 17, 2024 18:09
David's programming examples knowledge base / published by https://github.com/dacr/code-examples-manager #fecafeca-feca-feca-feca-fecafecafeca/282b969338bec2e853b6db7eca83d809969279c2

David's programming examples knowledge base

akka-pekko

@novemberborn
novemberborn / howto.md
Created February 18, 2016 17:47
Creating a PKCS#12 file from a Let's Encrypt certificate
@vrischmann
vrischmann / .credentials
Last active January 20, 2023 11:57
Running SBT with a Nexus proxy with authentication
realm=Sonatype Nexus Repository Manager
host=nexus.company.com
user=admin
password=admin123
@bobuss
bobuss / Calisthenics.md
Last active March 31, 2024 09:41
The 9 Rules of Object Calisthenics

Object Calisthenics outlines 9 basic rules to apply when performing the exercise:

  • One level of indentation per method.
  • Don't use the ELSE keyword.
  • Wrap all primitives and Strings in classes.
  • First class collections.
  • One dot per line.
  • Don't abbreviate.
  • Keep all classes less than 50 lines.
  • No classes with more than two instance variables.
@jboner
jboner / latency.txt
Last active November 25, 2024 02:18
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@rweald
rweald / build.sbt
Created March 24, 2012 18:22 — forked from mumoshu/build.sbt
DES and AES encryption in Scala
name := "DES and AES encryption in Scala"
version := "1.0"
scalaVersion := "2.9.1"
libraryDependencies += "commons-codec" % "commons-codec" % "1.6"
@mumoshu
mumoshu / build.sbt
Created January 10, 2012 02:52
DES encryption in Scala
name := "DES encryption in Scala"
version := "1.0"
scalaVersion := "2.9.1"
libraryDependencies += "commons-codec" % "commons-codec" % "1.6"