Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Spiros Eliopoulos seliopou

💭
I may be slow to respond.
View GitHub Profile
View dune
(executable (name test_rng) (libraries async mirage-crypto-rng-async) (preprocess (pps ppx_jane)))
View gist:043d93eb6a3f2e40c26b16244aaabf88
module String = StringLabels
type t = Bytes.t
external unsafe_get_64 : Bytes.t -> int -> int64 = "%caml_string_get64u"
external unsafe_set_64 : Bytes.t -> int -> int64 -> unit = "%caml_string_set64u"
let pp_hum fmt t =
Printf.fprintf fmt "x%.16Lx" (unsafe_get_64 t 0);
Printf.fprintf fmt "x%.16Lx" (unsafe_get_64 t 8);
View release.sh
#!/usr/bin/env bash
TMPFILE=$(mktemp)
trap "rm $TMPFILE" exit
set -x
set -e
error_and_exit() {
echo -e "$(basename $0): $1"
View bind_port.c
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
@seliopou
seliopou / _oasis
Last active Oct 25, 2016
Oasis pack bug
View _oasis
OASISFormat: 0.4
Name: packbug
Plugins: META (0.4), DevFiles (0.4)
BuildTools: ocamlbuild
Authors: garbage
Version: garbage
License: PD
Synopsis: garbage
@seliopou
seliopou / json-results.txt
Last active Jul 21, 2016
angstrom.0.1.0 benchmarks
View json-results.txt
# twitter1.json
┌─────────────────────────┬──────────┬────────────┬──────────┬──────────┬─────────┬──────────┬───────────────┬──────────┬──────────┬─────────────────┬────────────┐
│ Name │ Time/Run │ mWd/Run │ mjWd/Run │ Prom/Run │ mGC R^2 │ mGC/Run │ 95ci │ mjGC R^2 │ mjGC/Run │ 95ci │ Percentage │
├─────────────────────────┼──────────┼────────────┼──────────┼──────────┼─────────┼──────────┼───────────────┼──────────┼──────────┼─────────────────┼────────────┤
│ twitter1: angstrom-json │ 16.12us │ 7_590.08w │ 10.25w │ 10.25w │ 1.00 │ 28.95e-3 │ -0.06% +0.06% │ 0.20 │ 0.09e-3 │ -21.97% +22.24% │ 75.47% │
│ twitter1: ezjsonm │ 21.35us │ 11_403.10w │ 17.20w │ 17.20w │ 1.00 │ 43.50e-3 │ -0.06% +0.06% │ 0.21 │ 0.13e-3 │ -20.83% +21.49% │ 100.00% │
│ twitter1: yojson │ 8.44us │ 652.00w │ │ │ 1.00 │ 2.49e-3 │ -0.37% +0.37% │ │ │ │ 39.52% │
└───────────────────────
@seliopou
seliopou / angstrom_perf.txt
Last active May 14, 2016
Angstrom benchmarks
View angstrom_perf.txt
$ ./pure_benchmark.native -q 30 +time # 4.02.3
Estimated testing time 1m (2 benchmarks x 30s). Change using -quota SECS.
┌──────┬──────────┬──────────┬───────────────┬─────────┬──────────┬──────────┬────────────┐
│ Name │ Time R^2 │ Time/Run │ 95ci │ mWd/Run │ mjWd/Run │ Prom/Run │ Percentage │
├──────┼──────────┼──────────┼───────────────┼─────────┼──────────┼──────────┼────────────┤
│ json │ 1.00 │ 21.16ms │ -0.59% +0.62% │ 18.67Mw │ 239.28kw │ 239.28kw │ 47.53% │
│ http │ 1.00 │ 44.52ms │ -0.28% +0.29% │ 32.01Mw │ 65.11kw │ 65.11kw │ 100.00% │
└──────┴──────────┴──────────┴───────────────┴─────────┴──────────┴──────────┴────────────┘
$ ./pure_benchmark.native -q 30 +time # 4.03.0+flambda
Estimated testing time 1m (2 benchmarks x 30s). Change using -quota SECS.
@seliopou
seliopou / rdio_scrape.js
Last active Nov 17, 2015
Quick and dirty script to scrape a playlist from Rdio and print it to the console in a csv format.
View rdio_scrape.js
/* rdio_scrape.js
*
* Quick and dirty script to scrape a playlist from Rdio and print it to the
* console in a csv format.
*
* XXX NB TODO READ THIS: Playlists are loaded lazily by Rdio, so make sure
* that when you navigate to a new playlist page you scroll from beginning to end
* and back again, making sure that all the songs have been rendered on the way
* back up.
*
@seliopou
seliopou / _.md
Created Nov 6, 2015
Tributary inlet
View _.md
@seliopou
seliopou / _.md
Last active Oct 26, 2015
Tributary inlet
View _.md