Skip to content

Instantly share code, notes, and snippets.

View jboner's full-sized avatar

Jonas Bonér jboner

View GitHub Profile
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@viktorklang
viktorklang / in-fino-veritas.zsh-theme
Last active July 31, 2023 01:47
In Fino Veritas ZSH theme
#!/usr/bin/env zsh
# in fino veritas
# Borrowing shamelessly from these oh-my-zsh themes:
# fino-time
# pure
# https://gist.github.com/smileart/3750104
# Set required options
@jessitron
jessitron / stayingDead.scala
Created March 19, 2014 15:23
Akka testing: it's a good idea to tell your actor system to leave a dead top-level actor dead. See: http://blog.jessitron.com/2014/03/testing-in-akka-sneaky-automatic.html
// In real life, it's great that stuff gets restarted when it fails.
// In testing, we'd rather know that it failed.
import akka.actor._
class DyingActor extends Actor {
def receive = { case "die" => throw new Exception("poo") }
}
// Default config, everything restarts automatically
val system = ActorSystem("ordinary")
@krasserm
krasserm / akka-persistence-plugins.md
Last active March 27, 2017 10:13
Akka Persistence Plugins
@debasishg
debasishg / gist:8172796
Last active March 15, 2024 15:05
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
@DrewEaster
DrewEaster / akka-ddd.scala
Last active December 26, 2015 15:49
An adapted version of Vaughn Vernon's ideas from his very useful blog post http://vaughnvernon.co/?p=770
trait AggregateType {
val description: String
val classType: Class[_ <: Actor]
}
object DomainModel {
def apply(name: String)(aggregateTypes: AggregateType*) = {
new DomainModel(name, aggregateTypes)
}
}
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
import akka.actor._
import akka.persistence._
object EventsourcingExample extends App {
class EventsourcedProcessor extends Processor {
var events: List[Any] = Nil
var awaitStack: List[Actor.Receive] = Nil
def receive = {
case Persistent(event, _) if recoveryRunning ⇒ update(event)
@johnynek
johnynek / twophase.scala
Last active October 2, 2020 22:36
A two-phase commit Transaction Monad. See: http://en.wikipedia.org/wiki/Two-phase_commit_protocol
// Run this with scala <filename>
/**
* A Two-phase commit Monad
*/
trait Transaction[+T] {
def map[U](fn: T => U): Transaction[U] = flatMap { t => Constant(fn(t)) }
def flatMap[U](fn: T => Transaction[U]): Transaction[U] =
FlatMapped(this, fn)
@puredanger
puredanger / gist:6250711
Created August 16, 2013 15:05
bash replacement for rm to prevent shooting yourself in the face.
function rm () {
local path
for path in "$@"; do
# ignore any arguments
if [[ "$path" = -* ]]; then :
else
local dst=${path##*/}
# append the time if necessary
while [ -e ~/.Trash/"$dst" ]; do
dst="$dst "$(date +%H-%M-%S)