Skip to content

Instantly share code, notes, and snippets.

View sentenza's full-sized avatar

Alfredo Torre sentenza

View GitHub Profile
@sentenza
sentenza / Streaming.scala
Created October 12, 2021 14:14 — forked from BalmungSan/Streaming.scala
10 code snippets to introducing cats.effect.IO & fs2.Stream
// IO: A Monad for side-effects.
import $ivy.`org.typelevel::cats-effect:1.3.1`
import cats.effect.IO
import scala.concurrent.ExecutionContext
implicit val IOTimer = IO.timer(ExecutionContext.global)
implicit val IOShift = IO.contextShift(ExecutionContext.global)
// ----------------------------------------------
@sentenza
sentenza / scala-future-vs-io.md
Last active February 5, 2021 11:01
Cats IO Monad vs Scala Future

From Scala Future to Cats Async?

We could try to use the Async type class to model the kind of effects that can be executed concurrently.

Async is a Monad that can describe asynchronous or synchronous computations that produce exactly one result.

The first data type that we can think of is cats.effect.IO but the key aspect to keep in mind is that either a Future or an IO might be synchronous/blocking operations.

@sentenza
sentenza / PowerlineForTerminal.md
Created January 21, 2021 01:17 — forked from DucNgn/PowerlineForTerminal.md
Powerline style for terminal OSX

Installing and configuring Powerline-style command line tools for developers (OSX)

Intro:

For every developer, terminal is their weapon, so why don't you customize it to become a powerful, and a beautiful weapon?

Powerline style refers to a terminal style that helps developer to keep track of their workflow easily, allows them to have perfect visual on current directories and new changes. It is also git recognizable, and failure detector that will help your development process becomes more interact and much faster.

In this guideline, I will introduce you with 2 smart shells: Zsh and Fishshell. Both are perfect for the development jobs due to its rich of resources, and user-friendly.

Note:

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.

@sentenza
sentenza / solid.md
Last active October 10, 2018 09:43
Documentation and resources about Solid (SOcial LInked Data). The aim of this gist is not only to enclose all the essential concepts behind Solid, but also to try to point out its drawbacks and the possible lines of development.

Solid (derived from "SOcial LInked Data") is a proposed set of conventions and tools for building decentralized social applications based on Linked Data principles (LDP).

Solid is a set of [modular and extensible specifications][solid-specs], which build on, and extend the founding technology of the world wide web (HTTP, REST, HTML). They are 100% backwards compatible with the existing web. Each spec, taken in isolation, provides extra features to an existing system. However, when used in combination, they enable exciting new possibilities for web sites and applications.

The key principles at the base of this set of conventions - it's worth to repeat that concept to avoid any ambiguity - are basically 3:

1. True data ownership

Users should have the freedom to choose:

@sentenza
sentenza / employee-controller.scala
Last active September 29, 2018 21:51 — forked from anxious-coder-lhs/employee-controller.scala
Akka HTTP Employee RESTful APIs.
package com.codersbistro.controllers
import akka.actor.ActorSystem
import akka.event.Logging
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import akka.http.scaladsl.model.{StatusCodes}
import akka.http.scaladsl.server.Route
import akka.http.scaladsl.server.Directives._
import com.codersbistro.controllers.EmployeeController.QueryEmployee
import com.codersbistro.repository.EmployeeRepository
@sentenza
sentenza / akka-http-intro.md
Created September 5, 2018 11:48
A short introduction of Akka HTTP
@sentenza
sentenza / ngrxintro.md
Last active August 8, 2018 14:03 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series
@sentenza
sentenza / introrx.md
Created August 8, 2018 13:42 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing