Skip to content

Instantly share code, notes, and snippets.

View jboner's full-sized avatar

Jonas Bonér jboner

View GitHub Profile
@huntc
huntc / actor.rs
Last active April 26, 2021 09:15
Actor thoughts
// Re-creates https://doc.akka.io/docs/akka/current/typed/actors.html#first-example
// The messages
struct Greet {
whom: String,
reply_to: ActorRef<Greeted>,
}
struct Greeted {
@calvinlfer
calvinlfer / distributionflow.scala
Last active March 30, 2019 13:23
Akka Streams Flow that distributes messages (according to a hashing function) across sub-flows. The idea is to have ordered processing per sub-flow but parallel processing across sub-flows.
import akka.stream._
import akka.stream.scaladsl._
/***
* Example based on numBuckets = 3
* --- bucket 1 flow --- ~mapAsync(parallelism)~ ---
* |------------------| / \|---------------|
* Open inlet[A] --- | Partition Fan Out| --- bucket 2 flow --- ~mapAsync(parallelism)~ -----| Merge Fan In | --- Open outlet[B]
* |------------------| \ /|---------------|
* --- bucket 3 flow --- ~mapAsync(parallelism)~ ---
*
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active November 14, 2024 21:20
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@wsargent
wsargent / TracerBulletController.scala
Last active January 23, 2018 17:23
Supports tracer bullet dynamic logging
package controllers
import javax.inject._
import play.api.mvc._
@Singleton
class TracerBulletController @Inject() extends Controller {
private val logger = org.slf4j.LoggerFactory.getLogger("application")
/*
@benjchristensen
benjchristensen / sync-rest-rpc.md
Last active January 15, 2018 07:24
Regarding synchronous RESTful communication ...

Response to https://twitter.com/jeffreymaxwell/status/705760483391963136 requiring more than the 77 characters left on Twitter.

DISCLAIMER: The quality of writing and thinking here is aligned with a Twitter conversation, not a blog post, presentation, or book ;-)

Synchronous RESTful communication between Microservices is an anti-pattern ... you seem to being saying that the Netflix architecture (hystrix, eureka, ribbon, ..) is broken ... hmm what would @benjchristensen say?

@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'
@gregoryyoung
gregoryyoung / gist:a3e69ed58ae066b91f1b
Created June 24, 2015 13:25
Event Sourcing as 3 functions.
f(events) -> state
match f(state, event) -> state
f(state, command) -> events
@djspiewak
djspiewak / streams-tutorial.md
Created March 22, 2015 19:55
Introduction to scalaz-stream

Introduction to scalaz-stream

Every application ever written can be viewed as some sort of transformation on data. Data can come from different sources, such as a network or a file or user input or the Large Hadron Collider. It can come from many sources all at once to be merged and aggregated in interesting ways, and it can be produced into many different output sinks, such as a network or files or graphical user interfaces. You might produce your output all at once, as a big data dump at the end of the world (right before your program shuts down), or you might produce it more incrementally. Every application fits into this model.

The scalaz-stream project is an attempt to make it easy to construct, test and scale programs that fit within this model (which is to say, everything). It does this by providing an abstraction around a "stream" of data, which is really just this notion of some number of data being sequentially pulled out of some unspecified data source. On top of this abstraction, sca

@acolyer
acolyer / service-checklist.md
Last active July 10, 2024 05:13
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@grugq
grugq / gist:03167bed45e774551155
Last active December 26, 2024 17:03
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.