This file contains 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 com.company | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.model.StatusCodes._ | |
import akka.http.scaladsl.model.Uri | |
import akka.util.Timeout | |
import com.company.Crawler.Destination | |
import com.company.model.AliasRequest | |
import scala.concurrent.duration._ |
This file contains 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 GraphQlRequest(query: String, operation: Option[String], variables: Json) | |
def parseRequest: Directive1[GraphQlRequest] = { | |
import cats.data.Xor | |
import io.circe.ParsingFailure | |
import io.circe.parser.{parse ⇒ parseJson} | |
entity(as[Json]).map { json ⇒ | |
val cursor = json.hcursor | |
val variables = { |
This file contains 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
private static ActorSystem CreateActorSystem(string systemName) | |
{ | |
var config = ConfigurationFactory.Load() | |
.WithFallback(CustomConfig.Create(systemName)) | |
.WithFallback(ClusterSingletonManager.DefaultConfig()) | |
.WithFallback(RedisPersistence.DefaultConfig()); | |
var path = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "akka.generated.conf")); | |
File.WriteAllText(path, config.ToString(true)); |
This file contains 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 com.company.macros | |
import scala.reflect.macros.blackbox | |
class ADTMacros(val c: blackbox.Context) { | |
import c.universe._ | |
def dynamoFormat[T: c.WeakTypeTag]: Tree = { | |
generate[T] { (tpe, symbols) => |
This file contains 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 Protocol extends TopicOneSupport with TopicTwoSupport { | |
/*can't be sealed now*/ trait PMessage | |
} |
This file contains 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 com.company.macros | |
import scala.reflect.macros.blackbox | |
class ADTMacros(val c: blackbox.Context) { | |
import c.universe._ | |
def customSerializer[T: c.WeakTypeTag]: Tree = { | |
generate[T] { (tpe, symbols) => |
This file contains 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 com.company.serialization | |
import java.nio.ByteBuffer | |
import java.nio.charset.Charset | |
import akka.actor.{ActorRef, ExtendedActorSystem} | |
import akka.persistence.PersistentRepr | |
import akka.persistence.eventstore.EventStoreSerializer | |
import akka.persistence.eventstore.snapshot.EventStoreSnapshotStore.SnapshotEvent | |
import akka.persistence.journal.Tagged |
This file contains 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 scala.concurrent.{ExecutionContext, Future} | |
import scala.concurrent.ExecutionContext.Implicits.global | |
object ModelReaders { | |
implicit object UserReader extends ModelReader[User] { | |
def read(repo: Repo, id: Int) = repo.getUser(id) | |
} | |
implicit object RoomReader extends ModelReader[Room] { | |
def read(repo: Repo, id: Int): Future[Option[Room]] = repo.getRoom(id) | |
} |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
<section name="akka" type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka" /> | |
</configSections> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> | |
</startup> | |
<akka> |
This file contains 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 React, {Component, PropTypes} from 'react'; | |
import {SubscriptionProvider} from 'relay-subscriptions' | |
import uuid from 'uuid' | |
const outgoing = { | |
subscribe: 'subscribe', | |
ping: 'ping' | |
}; | |
const incoming = { |