Skip to content

Instantly share code, notes, and snippets.

Listpack specification

Version 1.0, 1 Feb 2017: Intial specification.

Version 1.1, 2 Feb 2017: Integer encoding simplified. Appendix A added.

Version 1.2, 3 Feb 2017: Better specify the meaning of the num-elements
                         field with value of 65535. The two 12 bits

positive/negative integers encodings were

@mauron85
mauron85 / letsencrypt-cert
Last active March 9, 2021 03:20
Auto refresh LetsEncrypt cert for NGINX with letsencrypt-auto
#!/bin/bash
echo "Running as user $USER"
DIR=/home/letsencrypt/letsencrypt
DOMAIN=mydomain.com
$DIR/letsencrypt-auto -a webroot --webroot-path /home/letsencrypt/webroot/ \
--config-dir /home/letsencrypt/etc \
--logs-dir /home/letsencrypt/log \
@tlrobinson
tlrobinson / docker-pull.sh
Last active October 18, 2023 21:59
Quick and dirty "docker pull"-like shell script.
#!/usr/bin/env bash
set -eu
name="library/redis"
tag="latest"
registry="https://registry-1.docker.io"
blobs="blobs"
data="images/$name/$tag"
@suxue
suxue / WebSocketServer.sh
Created March 16, 2014 11:52
simple WebSocket Server make use of netcat
#!/bin/ksh
typeset port=$((RANDOM % 60000))
while ((port < 30000)); do
port=$((RANDOM % 60000))
done
typeset pipe=`mktemp -u`
mkfifo $pipe
trap "rm -f $pipe" INT
@hashmal
hashmal / shirka_draft.mkd
Last active July 3, 2020 14:03
Design of the Shirka programming language.

Shirka

Automatic garbage collection has made possible the implementation of many flexible, high-level languages in which memory management can simply be ignored most of the time. Unfortunately, garbage collectors have some properties that make their use in several fields (namely real-time applications) unpractical or even impossible:

  • Program execution is suspended during garbage collection cycles ("GC
@endolith
endolith / LICENSE.txt
Last active January 14, 2024 07:37
Arduino hardware true random number generator
MIT License
Copyright (c) 2012 endolith
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
// concepts:
// - actors
// - pattern matching
// - Option (None/Some(x))
// -- enums etc
object Figure extends Enumeration {
type Figure = Value
val Paper, Scissors, Stone = Value
}
// concepts:
// - functional style: higher-order functions, type aliases
// - testing in REPL
object AreaCalculatorApp {
def main(args: Array[String]) = println(area(readVertices(args(0))))
type Vertex = (Double, Double)
def area(vertices: Seq[Vertex]) = triangulate(vertices) map(triangleArea _) sum