Skip to content

Instantly share code, notes, and snippets.

@mnicky
mnicky / ChainingImplicits.scala
Created May 4, 2021 15:08
Chaining implicits for Scala < 2.13
package utils
object ChainingImplicits {
/**
* Defines chaining operators similar to pipe() and tap() from Scala 2.13.
*
* Example usage:
* <pre>
* import utils.ChainingImplicits._
@mnicky
mnicky / Result.java
Created January 26, 2019 23:46
Result monad for Java (WIP)
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;

Symmetric Encryption

The only way to encrypt today is authenticated encryption, or "AEAD". ChaCha20-Poly1305 is faster in software than AES-GCM. AES-GCM will be faster than ChaCha20-Poly1305 with AES-NI. Poly1305 is also easier than GCM for library designers to implement safely. AES-GCM is the industry standard.

Use, in order of preference:

  1. The NaCl/libsodium default
@mnicky
mnicky / gist:7e0e21b8dfa07ee9ba57
Created December 18, 2015 10:04 — forked from grugq/gist:7713916
The text from: http://dee.su/uploads/baal.html On Underground Communications
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Undercover communication
It should be obvious by now, that the only way to communicate
stealthily and securely is to avoid raising suspicion to the
level at which the authorities might consider it worthwhile
to put you under active surveillance (e.g., park a van with
TEMPEST equipment by your apartment).
@mnicky
mnicky / mvnc.sh
Created June 4, 2014 12:55 — forked from japgolly/mvnc.sh
#!/bin/bash
RESET="\e[0m"
BLACK="\e[0;30m"
RED="\e[0;31m"
GREEN="\e[0;32m"
YELLOW="\e[0;33m"
BLUE="\e[0;34m"
MAGENTA="\e[0;35m"
CYAN="\e[0;36m"
"""A simple implementation of a greedy transition-based parser. Released under BSD license."""
from os import path
import os
import sys
from collections import defaultdict
import random
import time
import pickle
SHIFT = 0; RIGHT = 1; LEFT = 2;
@mnicky
mnicky / lux_aeterna.txt
Created January 27, 2013 15:56
Lux Aeterna - Requiem for a Dream
Intro
|E|-----------------------|-----------------------|
|B|-----------------------|-----------------------|
|G|-2-----2-----2-----2---|-----------------------| x2
|D|-----------------------|-3-----3-----2-----2---|
|A|-0-----0-----0-----0---|-----------------------|
|E|-----------------------|-1-----1-----0-----0---|
@mnicky
mnicky / clojure-blip-videos-orig-urls.txt
Created December 14, 2012 11:30
Direct links to Clojure videos on Blip TV
http://blip.tv/file/get/Richhickey-ClojureDataStructuresPart1411.flv
http://blip.tv/file/get/Richhickey-ClojureDataStructuresPart2306.flv
http://blip.tv/file/get/Richhickey-ClojureSequences733.flv
http://blip.tv/file/get/Richhickey-ClojureConcurrency252.flv
http://blip.tv/file/get/Richhickey-ClojureForJavaProgrammers2Of2680.mov
http://blip.tv/file/get/Richhickey-ClojureForJavaProgrammers1Of2174.flv
http://blip.tv/file/get/Richhickey-ClojureForLispProgrammersPart2299.mov
http://blip.tv/file/get/Richhickey-ClojureForLispProgrammersPart1372.flv
http://blip.tv/file/get/Richhickey-HammockdrivenDevelopment465.mov
http://blip.tv/file/get/Richhickey-MichaelFogusFertileGroundTheRootsOfClojure492.mov
@mnicky
mnicky / mk.scm
Created December 11, 2012 21:40 — forked from swannodette/gist:4262177
MiniKanren impl. in Scheme
#lang r5rs
(define-syntax var
(syntax-rules ()
((_ x) (vector x))))
(define-syntax var?
(syntax-rules ()
((_ x) (vector? x))))
@mnicky
mnicky / interp3.lisp
Created December 11, 2012 21:38
Scheme interpreter with explicit continuations by Peter Norvig
;source: http://norvig.com/paip/interp3.lisp
;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*-
;;; Code from Paradigms of Artificial Intelligence Programming
;;; Copyright (c) 1991 Peter Norvig
;;; File interp3.lisp: Scheme interpreter with explicit continuations
;;; One bug fix by Cheng Lu Hsu, hsuc@cory.Berkeley.EDU