This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net | |
import net.Tap.Percentage | |
import scalaz.zio.{Ref, UIO, ZIO} | |
/** | |
* A `Tap` adjusts the flow of tasks through | |
* an external service in response to observed | |
* failures in the service, always trying to | |
* maximize flow while attempting to meet the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats.effect | |
import scalaz.zio._ | |
import scalaz.zio.interop.catz._ | |
import org.http4s._ | |
import org.http4s.dsl.io._ | |
import org.http4s.implicits._ | |
import org.http4s.server.Router | |
import org.http4s.server.blaze.BlazeServerBuilder | |
import scalaz.zio.clock.Clock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class ForwardRoute[F[_]](components: Components[F]) | |
(implicit E: Effect[F], L: Logging[F]) extends Routes[F] { | |
private val http = components.http | |
private val forward = components.config.forwardTo | |
def routes: HttpService[F] = HttpService[F] { | |
case request => | |
for { | |
a <- E.pure(Authority(host = RegName(forward), port = Some(80))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Diff extends App { | |
val jsonInput = "file.json" | |
val csvInput = "file.csv" | |
val config: SparkConf = new SparkConf() | |
.setAppName("Step diff") | |
.setMaster("local[8]") | |
val spark = SparkSession |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<profiles> | |
<profile> | |
<id>docker</id> | |
<activation> | |
<activeByDefault>true</activeByDefault> | |
</activation> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>io.fabric8</groupId> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats.implicits._ | |
import cats.data.EitherT | |
import scala.concurrent.Future | |
import scala.concurrent.Await | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.duration._ | |
trait ServiceError | |
case object Timeout extends ServiceError |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
import play.api.libs.json._ | |
import play.api.{Logger, Play} | |
import scala.util.{Try, Failure, Success} | |
import play.api.libs.json.JsString | |
import scala.Some | |
import play.api.libs.json.JsNumber | |
import play.api.libs.json.JsObject | |
import play.api.libs.ws.{Response, WS} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Wires {@link Validate} annotation with rest call to perform validation on the request entity | |
* ... | |
* @POST | |
* ... | |
* @Validate(RequestValidator.class) | |
* public Response restCall(TransportModel request) | |
* | |
* <aop:aspectj-autoproxy /> | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.oshtykhno.spring; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.annotation.AnnotationConfigApplicationContext; | |
import org.springframework.context.annotation.Condition; | |
import org.springframework.context.annotation.ConditionContext; | |
import org.springframework.context.annotation.Conditional; | |
import org.springframework.core.type.AnnotatedTypeMetadata; | |
import org.springframework.stereotype.Component; |