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 base64 | |
import akka.actor.{Actor, ActorSystem, Props} | |
import akka.persistence.PersistentActor | |
import akka.persistence.journal.WriteEventAdapter | |
import akka.persistence.journal.leveldb.Tagged | |
import akka.persistence.query.journal.leveldb.LeveldbReadJournal | |
import akka.persistence.query.scaladsl.ReadJournal | |
import akka.persistence.query.{EventsByTag, PersistenceQuery} | |
import akka.stream.ActorMaterializer |
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 java.util.concurrent.{Executors, TimeUnit} | |
import scala.concurrent.duration.Duration | |
import scala.concurrent.{Await, ExecutionContext, Future} | |
import scalaz.Applicative | |
import scalaz.syntax.applicative._ | |
object Main extends App { | |
implicit def applicativeFuture(implicit executionContext:ExecutionContext) = new Applicative[Future] { | |
override def point[A](a: => A): Future[A] = Future.successful(a) |
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
# Path to your oh-my-zsh installation. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="philips" | |
# Uncomment the following line to use case-sensitive completion. |
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
@searchBox.keyupAsObservable() | |
.select((ev) -> $(ev.target).val()) | |
.where((text) -> text.length > 2) | |
.throttle(500) | |
.distinctUntilChanged() | |
.select(@searchItems) | |
.switchLatest() | |
.subscribe(@handleItemSearchAutoCompleteSuccess) |
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
public class AutofacScopedHubActivator : IHubActivator | |
{ | |
private readonly ILifetimeScope rootScope; | |
public AutofacScopedHubActivator(ILifetimeScope rootScope) | |
{ | |
this.rootScope = rootScope; | |
} | |
public HubActivationResult Create(HubDescriptor descriptor) |
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.ref.WeakReference | |
import scala.util.Random | |
import scalaz.effect.{IO, IORef} | |
import scalaz._ | |
import scalaz.Scalaz._ | |
import scalaz.std.stream._ | |
object Program extends App { | |
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 java.io.{BufferedInputStream, InputStream} | |
import akka.actor._ | |
import spray.can.Http | |
import spray.http.HttpEntity.Empty | |
import spray.http.MediaTypes._ | |
import spray.http._ | |
import spray.routing.{HttpService, RequestContext} | |
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
public class SystemTime | |
{ | |
private static Func<DateTime> now = () => DateTime.Now; | |
public static Func<DateTime> Now | |
{ | |
get { return now; } | |
set { now = value; } | |
} | |
} |
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
module Utils = | |
let private rng = new Random() | |
let rec PickRandomPair<'TKey when 'TKey : equality> (pool:('TKey * int) list) = | |
let decreasePair(needle:'TKey, pool:('TKey * int) list) = | |
let decrease (key:'TKey, value:int) = if key = needle then (key, value - 1) else (key, value) | |
pool |> Seq.fold (fun acc r -> (decrease(r) :: acc)) [] |
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
module BaseTest = | |
[<TestFixture>] | |
[<AbstractClass>] | |
type public AggregateTest<'TState, 'TCommand, 'TEvent>() = | |
abstract member For: Aggregate<'TState, 'TCommand, 'TEvent> | |
abstract member Given: 'TEvent list | |
abstract member When: 'TCommand | |
abstract member Then: ('TState -> unit) |
OlderNewer