Skip to content

Instantly share code, notes, and snippets.

View Tolsi's full-sized avatar
⌨️
I am jumping on the keyboard

Sergey Tolmachev Tolsi

⌨️
I am jumping on the keyboard
View GitHub Profile
@rodricels
rodricels / .tmux.conf
Last active April 21, 2024 12:22
tmux configuration, mouse copy & paste added
# My tmux configuration, partly based on https://github.com/wbkang/wbk-stow/blob/master/tmux-config/.tmux.conf
# Scroll History
set -g history-limit 50000
# show messages for 4 seconds instead
set -g display-time 4000
# set first window to index 1 (not 0) to map more to the keyboard layout
set-option -g renumber-windows on
@atamborrino
atamborrino / speculativeRetries.scala
Last active June 6, 2018 14:28
Speculative retries for Scala's Futures, inspired from Cassandra Java driver http://docs.datastax.com/en/developer/java-driver/3.1/manual/speculative_execution/
import akka.actor.Scheduler
import scala.concurrent.{ExecutionContext, Future, Promise}
import scala.concurrent.duration.FiniteDuration
object FutureHelper {
private val log = ScalaLogger.get(this.getClass)
/**
* Retry concurrently the async execution ''f'' every ''delay'' while no execution completes.
* Number of retries is bounded by ''maxSpeculativeExecutions''.
@travisbrown
travisbrown / queens.scala
Last active October 4, 2017 07:38
Aphyr's n-queens solution from Typing the technical interview, but Scala
class Nil
class Cons[X, Xs]
class First[List] { type X }
object First {
type Aux[List, X0] = First[List] { type X = X0 }
implicit val nilFirst: Aux[Nil, Nil] = ???
implicit def consFirst[X0, Xs]: Aux[Cons[X0, Xs], X0] = ???
}
@Joris-van-der-Wel
Joris-van-der-Wel / build.sh
Last active March 3, 2023 14:47
GNU Solfege on OS X
# Download and extract from https://www.gnu.org/software/solfege/ for example "solfege-3.22.2.tar.gz"
brew install librsvg texinfo pygtk timidity
export PATH=`brew --prefix`/opt/gettext/bin:$PATH
export PKG_CONFIG_PATH=`brew --prefix`/opt/libffi/lib/pkgconfig:$PKG_CONFIG_PATH
./configure
make
@brendanzab
brendanzab / reactive_systems_bibliography.md
Last active October 10, 2022 06:36
A reading list that I'm collecting while building my Rust ES+CQRS framework: https://github.com/brendanzab/chronicle

Functional, Reactive, and Distributed Systems Bibliography

Books

@nielsutrecht
nielsutrecht / RsaExample.java
Created December 28, 2016 14:13
Example of RSA generation, sign, verify, encryption, decryption and keystores in Java
import javax.crypto.Cipher;
import java.io.InputStream;
import java.security.*;
import java.util.Base64;
import static java.nio.charset.StandardCharsets.UTF_8;
public class RsaExample {
public static KeyPair generateKeyPair() throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
@3noch
3noch / keybase+git-crypt.md
Last active February 16, 2020 20:55
How to add a Keybase user to your repo using git-crypt
keybase pgp pull <keybase.io user>
gpg --edit-key <keybase.io user>
  > lsign
  > save
git-crypt add-gpg-user <keybase.io user>

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@baaldfg
baaldfg / ambilight.ino
Last active April 20, 2024 09:30 — forked from jamesabruce/ambilight.ino
Modified Adalight protocol implementation that uses FastLED library for driving 3-wire LED strips (WS2811, WS2812B) or 4-wire LED strips (e.g WS2801) with parallel output (up to 8 substrips)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//DESCRIPTION
// Modified Adalight protocol implementation that uses FastLED library (http://fastled.io)
// for driving 3-wire LED (WS2811, WS2812b, WS2813, Neopixel, ...) and 4-wire LED (e.g WS2801) strips.
// It uses FastLEDs parallel output feature to drive the LED stgrips which are arranged in upt to 8 substrips.
// It has been tested in the following arangement with Prismatik (V5.x only) and AmbiBox (http://www.ambibox.ru/en/index.php/Main_Page).
// With Abmbibox (V2.1.7) it seems to work better as the CPU load with Prismatik is quite high. On a fast machine, this will be probably not an issue.
// The official Ambibox download link seems to be dead. Version 2.1.7 can be found here: https://github.com/AmbiBox/kodi.script.ambibox/releases
// The file triggers a virus/malware warning. For me it seems like a false positive. Only install The main program as the rest
@mandubian
mandubian / gist:0fd090c0f75a46346f5e7898eeac9e28
Last active September 15, 2017 15:11
Improving compile-time for structure based on implicits resolutions