Skip to content

Instantly share code, notes, and snippets.

View iRevive's full-sized avatar
💭
¯\_(ツ)_/¯

Maksym Ochenashko iRevive

💭
¯\_(ツ)_/¯
View GitHub Profile
@iRevive
iRevive / README.md
Last active March 21, 2023 12:52
MQTT 5 Connect packet parser for Nginx
package com.example.util.logging
import java.net.InetSocketAddress
import cats.effect.{Concurrent, ContextShift, Resource, Sync, Timer}
import cats.syntax.functor._
import cats.{Monad, MonadError}
import fs2.io.tcp.{Socket, SocketGroup}
import io.odin.LoggerMessage
import io.odin.formatter.Formatter
java.lang.NoClassDefFoundError: scala/tools/scalap/scalax/rules/scalasig/Type
at org.apache.livy.shaded.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3$$anonfun$13.apply(Reflector.scala:123)
at org.apache.livy.shaded.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3$$anonfun$13.apply(Reflector.scala:122)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at org.apache.livy.shaded.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3.apply(Reflector.scala:122)
@iRevive
iRevive / UncancelableApp.scala
Created June 24, 2019 11:08
Fiber cancellation
import cats.effect.{ExitCase, ExitCode, IO, IOApp}
import cats.syntax.flatMap._
import cats.syntax.functor._
import scala.concurrent.duration._
object UncancelableApp extends IOApp {
override def run(args: List[String]): IO[ExitCode] = {
val job: IO[String] = for {
@iRevive
iRevive / DependenciesUpdate.scala
Last active January 23, 2019 11:29
DependenciesUpdate sbt task
import com.timushev.sbt.updates.versions.{ValidVersion, Version}
import sbt._
import scala.collection.immutable.SortedSet
object DependenciesUpdate {
def update(
dependencyUpdates: Map[ModuleID, SortedSet[Version]],
baseDirectory: File,
@iRevive
iRevive / Main.scala
Created May 30, 2017 11:29
VK music parsing
import java.util.regex.Pattern
import net.logstash.logback.encoder.org.apache.commons.lang.StringEscapeUtils
import scala.io.Source
import scala.util.control.NonFatal
object Main {