Skip to content

Instantly share code, notes, and snippets.

View agaro1121's full-sized avatar

Anthony Garo agaro1121

View GitHub Profile
@agaro1121
agaro1121 / alacritty-tmux-vim_truecolor.md
Created October 20, 2022 03:05 — forked from andersevenrud/alacritty-tmux-vim_truecolor.md
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@agaro1121
agaro1121 / F_Algebra.scala
Created April 1, 2021 14:24 — forked from MiloXia/F_Algebra.scala
F-algebra & F-coalgebra in Scala
import scala.language.higherKinds
import scalaz._, Scalaz._
object F_Algebra {
//### F-Algebra
//Fixed point of type constructor
case class Fix[F[_]](f: F[Fix[F]])
type Algebra[F[_], A] = Function[F[A], A] //a morphism from F(A) to A
@agaro1121
agaro1121 / predef.scala
Created November 5, 2019 22:44 — forked from mpilquist/predef.scala
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)")
@agaro1121
agaro1121 / logback_disable_in_unit_tests.md
Created October 29, 2018 16:11 — forked from traviskaufman/logback_disable_in_unit_tests.md
Logback: Disable all logging in unit tests

After scouring the internet and piece-mealing together the correct way to do this, here is a step-by-step, all-in-one-place guide to making logback STFU when running your unit tests.

Here's how to do it

Save the following as logback-test.xml under src/test/resources:

<configuration>
  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
      <pattern>%msg%n</pattern>
@agaro1121
agaro1121 / app.js
Created October 7, 2018 22:49 — forked from camshaft/app.js
Superagent circuit breaker
/**
* Module dependencies
*/
var request = require("superagent")
, breaker = require("./breaker");
// Add the circuit breaker to the default middleware
request.middleware.push(breaker(3000));
// ...snip...
@agaro1121
agaro1121 / Main.scala
Created August 30, 2018 09:30 — forked from htimur/Main.scala
Example of extracting KinesisConsumer during Kinesis source creation for the WW-Digital/reactive-kinesis library
import akka.actor.{ActorRef, ActorSystem}
import akka.stream.scaladsl.Sink
import com.weightwatchers.reactive.kinesis.consumer.KinesisConsumer
import com.weightwatchers.reactive.kinesis.stream._
object Main extends App {
val sys = ActorSystem("kinesis-consumer-system")
var consumer = Option.empty[KinesisConsumer]
@agaro1121
agaro1121 / npm-scripts-for-docker.md
Created April 25, 2018 03:22 — forked from duluca/npm-scripts-for-docker.md
npm scripts for Docker

These are generic npm scripts that you can copy & paste into your package.json file as-is and get access to convinience scripts to manage your Docker images all in one place.

Looking for npm scripts for AWS ECS? Go here!

Watch the video: Do More With Less JavaScript

Docker Containers for Static or Angular/React/Vue/etc SPA Websites

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.

@agaro1121
agaro1121 / ExposeHostPort.md
Created July 19, 2017 14:42 — forked from DavidDeCoding/ExposeHostPort.md
Exposing port on host machine to docker container

The vice versa can easily be done by including -p flag. But the way to expose ports of host machine to a docker container is bit convoluted, but can be done.

The steps are:

  1. Create an alias for the ip you want to use.
sudo ifconfig lo0 alias 172.16.123.1
  1. add the flag to docker:

The process to view records in kinesis are as follows:

  1. Get a shard iterator:
aws kinesis get-shard-iterator --shard-id shardId-000000000000 --shard-iterator-type LATEST --stream-name
  1. Run your producer using kpl or anyother library and language.

  2. Read records of the recently created shard iterator: