Skip to content

Instantly share code, notes, and snippets.

View sashagavrilov's full-sized avatar

Sasha Gavrilov sashagavrilov

View GitHub Profile
@n1ko-w1ll
n1ko-w1ll / StreamProcessor.java
Last active November 10, 2017 16:13
Akka Stream Processor - destilled example out of a real world project that demonstrates how to persist the event offset together with the serialized AtLeastOnceDeliverySnapshot
import com.google.protobuf.ByteString;
import akka.actor.Props;
import akka.event.DiagnosticLoggingAdapter;
import akka.event.Logging;
import akka.japi.pf.ReceiveBuilder;
import akka.persistence.AbstractPersistentActorWithAtLeastOnceDelivery;
import akka.persistence.AtLeastOnceDelivery;
import akka.persistence.RecoveryCompleted;
import akka.persistence.SaveSnapshotFailure;
@Tolsi
Tolsi / KlangCancellableFuture.scala
Last active June 1, 2020 13:45
Viktor Klang's interruptible cancellable scala future
import java.util.concurrent.Executors
import scala.concurrent._
import scala.concurrent.duration.Duration
import scala.util.{Failure, Try}
trait CancellableFuture[T] extends Future[T] {
def future(): Future[T]
def cancel(): Unit
@viktorklang
viktorklang / gbr.txt
Created June 30, 2015 08:43
shell alias for showing git branches sorted by last activity date
alias gbr='git for-each-ref --sort="-authordate:iso8601" --format=" %(color:green)%(authordate:iso8601)%09%(color:white)%(refname:short)" refs/heads'
@krasserm
krasserm / akka-persistence-plugins.md
Last active March 27, 2017 10:13
Akka Persistence Plugins
@debasishg
debasishg / gist:8172796
Last active July 5, 2026 16:33
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
@ryotarai
ryotarai / README.md
Last active August 17, 2020 14:30
git-commit && change committer and author automatically

git-commit-auto

  1. Clone
$ git clone http://gist.github.com/5675296.git /path/to/somewhere
$ echo 'export PATH="/path/to/somewhere:$PATH"' >> ~/.bashrc
$ source ~/.bashrc
@marnix
marnix / scala-di-from-comment-7789930.scala
Created March 2, 2012 06:27
This code is a copy (roughly reconstructed from reformatted and reordered parts in an abandoned Eclipse project) of the code that was originally in http://jonasboner.com/2008/10/06/real-world-scala-dependency-injection-di.html#comment-7789930.
trait BeeperDevice {
def beep(beepSound: String)
}
trait DependsOnBeeper {
protected val beeper: BeeperDevice
}
class Beeper extends BeeperDevice {
@niklassaers
niklassaers / recipe-ios.sh
Created February 5, 2012 11:04
Compile protobuf 2.4.1 on iOS 5
export ARCH=arm-apple-darwin10
export ARCH_PREFIX=${ARCH}-
export PLATFORM=iPhoneOS
export SDKVER=5.0
export DEVROOT=/Developer/Platforms/${PLATFORM}.platform/Developer
export SDKROOT="$DEVROOT/SDKs/${PLATFORM}$SDKVER.sdk"
export PKG_CONFIG_PATH="$SDKROOT/usr/lib/pkgconfig:$DEVROOT/usr/lib/pkgconfig"
export AS="$DEVROOT/usr/bin/as"
export ASCPP="$DEVROOT/usr/bin/as"