Skip to content

Instantly share code, notes, and snippets.

View DenisNovac's full-sized avatar

Denis Novac DenisNovac

View GitHub Profile
@todokr
todokr / RefinedWithNewType.scala
Last active February 25, 2023 18:15
refined + newtype + circe
import Models._
import eu.timepit.refined.api._
import eu.timepit.refined.boolean.{And, Or}
import eu.timepit.refined.collection._
import eu.timepit.refined.numeric._
import eu.timepit.refined.string._
import io.circe._
import io.circe.generic.semiauto._
import io.circe.parser._
import io.estatico.newtype.Coercible
@rkrzewski
rkrzewski / DoobieLiquibase.scala
Created October 19, 2018 16:00
Liquibase migration with Doobie
import cats._
import doobie._
import doobie.implicits._
import liquibase.Liquibase
import liquibase.database.DatabaseFactory
import liquibase.database.jvm.JdbcConnection
import liquibase.resource.ClassLoaderResourceAccessor
object LiquibaseMigration {
def run[F[_]: Monad](xa: Transactor[F]): F[Unit] =
@vorozhba
vorozhba / Как удалить commit в Github.txt
Last active June 24, 2024 07:39
Как удалить commit в Github
1. Получаем хэш-код коммита, к которому хотим вернуться.
2. Заходим в папку репозитория и пишем в консоль:
$ git reset --hard a3775a5485af0af20375cedf46112db5f813322a
$ git push --force

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.

@jcataluna
jcataluna / gist:1dc2f31694a1c301ab34dac9ccb385ea
Created July 8, 2016 17:23
Script to save all images from a docker-compose.yml file
#!/bin/bash
mkdir -p out
for img in `grep image $1| sed -e 's/^.*image\: //g'`;
do
cleanname=${img/\//-}
tag=`docker images | grep $img | awk '{print $2}'`
echo "Exporting image: $img, tag:$tag ($cleanname)..."
docker save $img -o out/$cleanname.tar