Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View seliopou's full-sized avatar
💭
I may be slow to respond.

Spiros Eliopoulos seliopou

💭
I may be slow to respond.
View GitHub Profile
@seliopou
seliopou / dune
Last active November 17, 2020 02:41
(executable (name test_rng) (libraries async mirage-crypto-rng-async) (preprocess (pps ppx_jane)))
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);
#!/usr/bin/env bash
TMPFILE=$(mktemp)
trap "rm $TMPFILE" exit
set -x
set -e
error_and_exit() {
echo -e "$(basename $0): $1"
#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 October 25, 2016 17:28
Oasis pack bug
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 July 21, 2016 14:08
angstrom.0.1.0 benchmarks
# 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 14:41
Angstrom benchmarks
$ ./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 November 17, 2015 23:05
Quick and dirty script to scrape a playlist from Rdio and print it to the console in a csv format.
/* 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 November 6, 2015 17:30
Tributary inlet
@seliopou
seliopou / _.md
Last active October 26, 2015 14:02
Tributary inlet