Skip to content

Instantly share code, notes, and snippets.

View puzza007's full-sized avatar
💭
💅

Paul Oliver puzza007

💭
💅
View GitHub Profile
%% use sync log so we can check if it caused a wrap event
%% and record the timestamp/num entries for the new wrapfile
%% (ie, collect metadata about each wrapfile.N, for faster seeking)
disk_log:blog(State#state.log, Line),
%% Fun used to write index marker, if we need to this insertion:
WriteIndexFun = fun(FileOffset) ->
Info = disk_log:info(State#state.log),
NoItems = proplists:get_value(no_items, Info),
CurrFile = proplists:get_value(current_file, Info),
@benlk
benlk / curl-with-sftp.sh
Last active September 9, 2018 03:52
For when you need to rebuild curl
#!/bin/sh
# copied from http://zeroset.mnim.org/2013/03/14/sftp-support-for-curl-in-ubuntu-12-10-quantal-quetzal-and-later/
mkdir /tmp/curl
cd /tmp/curl
sudo apt-get update
sudo apt-get install build-essential debhelper libssh2-1-dev
apt-get source curl
sudo apt-get build-dep curl
cd curl-*
dpkg-buildpackage
@zeeshanlakhani
zeeshanlakhani / eqc_statem.md
Created July 13, 2015 18:26
Andrew Stone's Great eqc_statem notes

Testing Stateful Code

So far, all the properties we have written have tested stateless code. Stateless code is made up of pure functions and is inherently easier to test than stateful code with side effects. The chief problem with testing stateful code is that the input to output mapping depends on the current state of the program. Previous operations can cause the same function to return different output given the same input. Therefore, in order to test stateful code, our tests must maintain some state of their own. This state is known as the model state and is updated as part of the testing process.

@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links

The best:

@xandkar
xandkar / Makefile
Last active February 25, 2016 07:38
X-Plane Autopilot POC
build:
@ocamlbuild \
-use-ocamlfind \
-tags thread \
-syntax camlp4o \
-pkgs bitstring.syntax,bitstring,core,async \
x_plane_autopilot.byte
deps:
@opam install core async bitstring
@purcell
purcell / with-docker-db.sh
Last active March 6, 2018 22:54
Run a command against a PostgreSQL DB installed and started on demand using Docker
#!/bin/bash -e
image=mdillon/postgis:9.6-alpine
container_name=my-app-postgresql
if [ -z "$1" ]; then
echo "Run command with a dockerised PostgreSQL DB.
usage: $(basename "$0") command