Skip to content

Instantly share code, notes, and snippets.

View nebtrx's full-sized avatar
🎈
out of the comfort zone

Omar García nebtrx

🎈
out of the comfort zone
View GitHub Profile
# See commit changes
git whatchanged -m -n 1 -p <sha of merge commit>
# Delete branch
git branch -d the_local_branch
# Delete remote branch
git push origin --delete <branchName>
# open/edit the GHC compiler seetings
code $(stack ghc -- --print-libdir)/settings
# searh process using the port
lsof -i tcp:<port>
# kill a process
sudo kill -9 <pid>
# list process
@nebtrx
nebtrx / SharedStateZIO.scala
Last active November 7, 2019 06:25
Shared State with `ZIO` instead of `cats-effects`
package com.github.sharedstate
import scalaz.zio.{App, IO, Ref, Void}
import scala.concurrent.duration._
object SharedStateZIO extends App {
// this is a simpler alternative to `scalaz.zio.console.putStrLn`
def putStrLn(str: String): IO[Void, Unit] = IO.sync(println(str))
def process1(myState: Ref[List[String]]): IO[Void, Unit] = {

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.