Skip to content

Instantly share code, notes, and snippets.

Avatar

Anton Parkhomenko chuwy

View GitHub Profile
@chuwy
chuwy / iglu-violation.json
Created Mar 18, 2019
Iglu Client error format
View iglu-violation.json
{
"anyOf": [
{
"description": "Resolution error - schema could not be found on specified repositories, defined by ResolutionError ADT in Iglu Client",
"properties": {
"repositories": {
"description": "Defined by LookupHistory ADT in Iglu Client",
"properties": {
"name": {
"type": "string",
@chuwy
chuwy / BreakReferentialTransparency.scala
Created Mar 1, 2018
Interleaving lazy and eager evaluation to break referential transparency
View BreakReferentialTransparency.scala
import cats._
import cats.implicits._
import cats.effect._
import cats.effect.implicits._
object Db {
private val cache = collection.mutable.Map.empty[String, String]
def expensiveIO(input: String): IO[String] =
IO { Thread.sleep(1000); println("Executed expensive action"); input ++ input }
@chuwy
chuwy / diff_hosted_repo.txt
Created Feb 12, 2018
diff -r hosted repo
View diff_hosted_repo.txt
Only in hosted: com.admo-analytics
Only in hosted: com.adxtracking
Only in hosted: com.angelrush
Only in hosted: com.calltracks
Only in hosted: com.certivox
Only in repo: com.convertro
Only in hosted: com.duproprio
Only in hosted: com.duproprio_comfree
Only in hosted: com.findly
Only in hosted: com.finerylondon
View keybase.md

Keybase proof

I hereby claim:

  • I am chuwy on github.
  • I am chuwy (https://keybase.io/chuwy) on keybase.
  • I have a public key ASC4yihj3aD9BK2glw6wm-sUNqbq9Qj8uWYJMcb3KhGjrQo

To claim this, I am signing this object:

@chuwy
chuwy / Validator.scala
Created Feb 23, 2017
Json Schema Validator
View Validator.scala
package jsonschemavalidator
import scala.language.implicitConversions
import cats.syntax.either._
import cats.syntax.semigroup._
import cats.syntax.semigroupk._
import cats.syntax.validated._
import cats.data.ValidatedNel
import cats.instances.all._
@chuwy
chuwy / interval.scala
Created Feb 4, 2017
Simple FS2 interval implementation
View interval.scala
import fs2._
import scala.concurrent.duration._
/**
* Stream of signals with pauses
*/
object Interval {
private implicit val strategy = Strategy.fromFixedDaemonPool(3)
private implicit val scheduler = Scheduler.fromFixedDaemonPool(3)
@chuwy
chuwy / webserver.py
Last active Apr 4, 2016
Webserver printing headers
View webserver.py
#!/usr/bin/env python
"""
Webserver printing headers
"""
import SimpleHTTPServer
import SocketServer
import logging
import sys
@chuwy
chuwy / issuer.py
Last active Mar 1, 2016
Script for looking unmentioned commits
View issuer.py
#!/usr/bin/env python3
"""
Script for looking unmentioned commits in milesone comparing with specified PR
Usage: issuer.py user password company/repository milestone_pattern pull_id
"""
import sys
import itertools
import re
View akka-fail.log
1450880573740
1450880574145
1450880574470
1450880574796
java.util.concurrent.TimeoutException: Futures timed out after [3 seconds]
1450880577800
java.util.concurrent.TimeoutException: Futures timed out after [3 seconds]
1450880580803
java.util.concurrent.TimeoutException: Futures timed out after [3 seconds]
1450880583807
View akka-fail.scala
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model._
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{ Sink, Source, Flow }
import com.typesafe.config.ConfigFactory
import scala.concurrent.{ Future, Await, ExecutionContext }
import scala.concurrent.duration._