Skip to content

Instantly share code, notes, and snippets.

View kossal's full-sized avatar

Christopher Kossal Wilson kossal

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kossal on github.
  • I am ck_wilson (https://keybase.io/ck_wilson) on keybase.
  • I have a public key ASAAmvylqo3tEj_-rcpy3yTuaisulb6UhwbsqmoCfTw_xAo

To claim this, I am signing this object:

@kossal
kossal / for-greeting-app.scala
Created July 24, 2021 21:42
Greeting ZIO app with for
object App extends zio.App {
val salute: ZIO[Console, IOException, Unit] = putStrLn("Hello! What's your name?")
def respond(name: String): ZIO[Console, IOException, Unit] =
putStrLn(s"Hello $name! It's nice to finally meet you")
val action: ZIO[Console, IOException, Unit] = for {
_ <- salute
name <- getStrLn
@kossal
kossal / zio-methods.scala
Created July 24, 2021 21:39
ZIO common methods
// succeed returns a succesful ZIO and fail a failing ZIO
ZIO.succeed("Hello"): Task[String]
ZIO.fail(new Throwable("Failed")): Task[String]
// Lift computations to ZIO
// Any failure will be captured as a Throwable
ZIO.effect(5 / 10): Task[Double]
// Lift effects that don't fail
ZIO.effectTotal(println("This should not fail")): UIO[Unit]
@kossal
kossal / getStrLn.scala
Last active July 24, 2021 19:03
getStrLn equivalent
case class ZIO[E, R, A](run: R => Either[E, A])
val getStrLn = ZIO[Console, IOException, Unit](run: console => {
try {
// This function doesn't actually exist but you get my point
Right(console.readLine)
} catch {
case e: IOException => Left(e)
}
})
@kossal
kossal / greeting.scala
Last active July 24, 2021 18:10
ZIO greeting app
package app
import zio._
import zio.console._
import java.io.IOException
object App extends zio.App {
def respond(name: String): ZIO[Console, IOException, Unit] =
@kossal
kossal / TAC.md
Last active July 21, 2021 17:23
Technical Account Manager

Technical Account Manager role at Deal Engine

At Deal Engine, we strive on automating and optimizing processes in an industry that has been stagnant for several decades - the travel industry.

  • Have you ever wondered what happens to your ticket when you miss a flight? And did you know you can always get some money back?
  • Have you ever experienced the price volatility where sometimes you end up paying a lot more than the person sitting next to you on a plane?

We solve these and more pains, working with leisure and corporate travelers, along with airlines and service providers. We are on a mission to become the most efficient and transparent online travel agency in the world.

Even though we are a small team we are currently operating in more than 10 countries, managing and optimizing more than 1 billion dollars in flight tickets.

library(tabulizer)
library(purrr)
url <- "https://www.gob.mx/cms/uploads/attachment/file/544266/Tabla_casos_positivos_COVID-19_resultado_InDRE_2020.03.30.pdf"
# Cada página es una lista
infectados_ss <- extract_tables(url, encoding = "UTF-8")
# Las primeras 5 filas son los nombres de las columnas
# Los uno y filtro de la lista original
columnas <- sapply(asinfectados_ss[[1]][1:5])