Skip to content

Instantly share code, notes, and snippets.

View ornicar's full-sized avatar
💭
⏚⏚⏚⏚

Thibault Duplessis ornicar

💭
⏚⏚⏚⏚
View GitHub Profile
@viktorklang
viktorklang / Future-retry.scala
Last active July 23, 2023 23:48
Asynchronous retry for Future in Scala
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import akka.pattern.after
import akka.actor.Scheduler
/**
* Given an operation that produces a T, returns a Future containing the result of T, unless an exception is thrown,
* in which case the operation will be retried after _delay_ time, if there are more possible retries, which is configured through
* the _retries_ parameter. If the operation does not succeed and there is no retries left, the resulting Future will contain the last failure.
@ornicar
ornicar / Pow - the hairy way.md
Last active December 27, 2015 17:39
Pow (http://pow.cx/) functionality for Linux & nginx.

Create required dirs:

mkdir ~/.pow # where play will register the http.port
mkdir ~/.nginx-sites # where pow will create proxy configs

Tell nginx to load sites config from your ~/.nginx-sites by adding this to /etc/nginx.conf:

@benyarb
benyarb / vimium_colemak
Last active March 29, 2025 22:02
Vimium Colemak Keybindings
# Custom key mappings
map n scrollDown
map N previousTab
map e scrollUp
map E nextTab
map i scrollRight
map I goForward