Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
😏

mvillafuertem

💭
😏
View GitHub Profile
@mvillafuertem
mvillafuertem / ExceptionHandlingExample.java
Created Oct 5, 2022 — forked from IgorBerman/ExceptionHandlingExample.java
akka streams in java with kill switch, shutdown hook and error handling
View ExceptionHandlingExample.java
package com.example;
import java.util.concurrent.CompletionStage;
import scala.concurrent.Await;
import scala.concurrent.duration.Duration;
import akka.Done;
import akka.NotUsed;
import akka.actor.ActorSystem;
import akka.japi.Pair;
@mvillafuertem
mvillafuertem / localstack.md
Created Sep 28, 2022 — forked from lobster1234/localstack.md
Working with localstack on command line
View localstack.md

Starting localstack

C02STG51GTFM:localstack mpandit$ make infra
. .venv/bin/activate; exec localstack/mock/infra.py
Starting local dev environment. CTRL-C to quit.
Starting local Elasticsearch (port 4571)...
Starting mock ES service (port 4578)...
Starting mock S3 server (port 4572)...
Starting mock SNS server (port 4575)...
View print system and environment properties in sbt console
sbt> eval new scala.sys.SystemProperties().foreach(x => println(x))
sbt> eval scala.sys.env.foreach(x => println(x))
@mvillafuertem
mvillafuertem / kubectl-multi-version-brews.md
Created Mar 16, 2022 — forked from rdump/kubectl-multi-version-brews.md
kubectl multi-version brews (kubernetes-cli formula)
View kubectl-multi-version-brews.md

kubectl multi-version brews

Applicability

The instructions below apply to older versions of Homebrew which still provide switch capability.

For current Homebrew, you'll likely need to keep Versions around, and build locally. Here's my versions repository https://github.com/rdump/homebrew-versions

MacPorts is now keeping versioned installations available as well, by default.

@mvillafuertem
mvillafuertem / Workshop.scala
Created Oct 17, 2021 — forked from calvinlfer/Workshop.scala
Day 1 and 2 ZIO async and concurrent workshop
View Workshop.scala
package net.degoes.zio
import java.io.IOException
import zio._
import java.text.NumberFormat
import java.nio.charset.StandardCharsets
import zio.blocking.Blocking
import zio.console.Console
@mvillafuertem
mvillafuertem / ArgsOps.scala
Created Jul 3, 2021 — forked from gwenzek/ArgsOps.scala
Scala parser for programm args
View ArgsOps.scala
import scala.language.implicitConversions
/**
* @author gwenzek
*
*/
class ArgsOps(ops: Map[String, OptionalParam], val args: Array[String]){
def apply(op: String) = ops(op)
}
@mvillafuertem
mvillafuertem / day-3.scala
Created Jun 21, 2021 — forked from calvinlfer/day-3.scala
Functional Scala: Toronto edition
View day-3.scala
// Copyright(C) 2018 - John A. De Goes. All rights reserved.
package net.degoes.effects
import scalaz.zio._
import scalaz.zio.console._
import scala.annotation.tailrec
import scala.concurrent.duration._
@mvillafuertem
mvillafuertem / MLToyApp.scala
Created Dec 13, 2020 — forked from abomm/MLToyApp.scala
Machine Learning application design with Pure Functional ZIO in Scala
View MLToyApp.scala
package ziomlscoring
import zio._
import ziomlscoring.SizeMyShirt.moduleExperimentFramework.ExperimentFramework
import ziomlscoring.SizeMyShirt.moduleInferenceLogger.InferenceLogger
import ziomlscoring.SizeMyShirt.moduleTShirtSizer.TShirtSizer
import ziomlscoring.SizeMyShirt.sizeMyShirtMicroService
object SizeMyShirt {
case class UserId(value: Long) extends AnyVal
@mvillafuertem
mvillafuertem / solving_spark_signature_error.md
Created Nov 21, 2020 — forked from hkhamm/solving_spark_signature_error.md
Solving a Spark Invalid signature file digest for Manifest main attributes error
View solving_spark_signature_error.md

##Solving a Spark error: Invalid signature file digest for Manifest main attributes

When using spark-submit to run a jar, you may encounter this error:

Invalid signature file digest for Manifest main attributes

The error occurs when one of the included libraries in the jar's META-INF directory has a bad signature.

View gist:404ff2be0db87432add8f6c929b280ca
Works in git 2.28
git clone --filter=blob:none --no-checkout --depth 1 --sparse <project-url>
cd <project>
git sparse-checkout init --cone
Specify the files and folders you want to clone
git sparse-checkout add <folder>/<innerfolder> <folder2>/<innerfolder2>
git checkout