Skip to content

Instantly share code, notes, and snippets.

View dborovikov's full-sized avatar

Denis Borovikov dborovikov

  • SoundCloud
  • Berlin
View GitHub Profile
import com.amazonaws.services.sqs.AmazonSQSClient;
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.SimpleRegistry;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.server.Directives._
import akka.stream.{ ActorMaterializer, Materializer }
import com.typesafe.scalalogging.StrictLogging
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.language.postfixOps
import cats.data.{ Xor, XorT }
import cats.std.future._
import cats.syntax.xor._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import scala.concurrent.{ Await, Future }
object XorDemo extends App {
sealed trait Error
import cats.data.XorT
import cats.std.future._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import scala.concurrent.{ Await, Future }
object XorDemo extends App {
sealed trait Error
object Payments {
trait PaymentProcessorType {
}
object DefaultPaymentProcessorType extends PaymentProcessorType
trait PaymentProcessor {
def processorType: PaymentProcessorType
def process(payment: Payment): Unit
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
public class ParallelGroups {
object HelloWorld extends App {
implicit val system = ActorSystem()
implicit val executor = system.dispatcher
implicit val materializer = ActorMaterializer()
val routes: Route = path("check") {
get {
complete("Hello, World")
}
}
import java.util.Arrays;
import java.util.Random;
public class MaxSubArray {
public static int maxSubArray(int[] arr) {
if (arr.length == 0) {
return 0;
}
int maxEndingHere = arr[0];
int maxSoFar = arr[0];
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public class MergeRangesJava {
public static class Range {
public final int start;
public final int end;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public class MergeRangesJava {
public static class Range {
public final int start;
public final int end;