Skip to content

Instantly share code, notes, and snippets.

@dbuenzli
dbuenzli / min.html
Created August 26, 2014 18:34
Hashtbl values disappearing in Safari
<!DOCTYPE html>
<!--
This code is in the public domain.
-->
<html lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript" defer="defer" src="min.js"></script>
<title>Vgr_htmlc minimal example</title>
</head>
@dbuenzli
dbuenzli / ocp-index-conflict.cudf
Created October 27, 2014 10:59
cudf ocp-index conflict
# aspcud /Users/dbuenzli/sync/repos/vg/$in /Users/dbuenzli/sync/repos/vg/$out -removed,-notuptodate,-changed
preamble:
property: pinned: bool = [false], installed-root: bool = [false], reinstall: bool = [false], opam-version: string, opam-name: string
package: conf-python-2-7
version: 1
conflicts: conf-python-2-7
opam-name: conf-python-2-7
opam-version: 1.0
@dbuenzli
dbuenzli / watch.ml
Last active August 29, 2015 14:16
watch.ml
open Rresult_infix
open Bos_unix
(* Watch a directory for changes. First run will create a database
watchdb in the directory with modification times. Subsquent runs
will check files against that database. *)
module Db = struct
let db_file = Path.file "watchdb"
let exists () = OS.File.exists db_file
@dbuenzli
dbuenzli / gen.ml
Last active June 11, 2022 18:13
OCaml simple generators
(*---------------------------------------------------------------------------
Copyright (c) 2015 Daniel C. Bünzli. All rights reserved.
Distributed under the BSD3 license, see license at the end of the file.
%%NAME%% release %%VERSION%%
---------------------------------------------------------------------------*)
(* Simple generators according to:
Kiselyov, Peyton-Jones, Sabry
Lazy v. Yield: Incremental, Linear Pretty-printing
@dbuenzli
dbuenzli / l.ml
Last active July 21, 2016 08:48
List of strings combinators
(*---------------------------------------------------------------------------
Copyright (c) 2015 Daniel C. Bünzli. All rights reserved.
Distributed under the BSD3 license, see license at the end of the file.
%%NAME%% release %%VERSION%%
---------------------------------------------------------------------------*)
module L : sig
type t
val empty : t
val s : string -> t
@dbuenzli
dbuenzli / free.ml
Last active May 14, 2017 13:48
Freer monad derivations.
(*---------------------------------------------------------------------------
Copyright (c) 2015 Daniel C. Bünzli. All rights reserved.
Distributed under the BSD3 license, see license at the end of the file.
%%NAME%% release %%VERSION%%
---------------------------------------------------------------------------*)
(* An OCaml derivation of http://okmij.org/ftp/Computation/free-monad.html *)
module type FUNCTOR = sig
type 'a t
@dbuenzli
dbuenzli / Dockerfile
Created July 12, 2016 13:24
Docker cross compilation
FROM ocaml/opam:alpine-armhf_ocaml-4.02.3
ENV OPAMYES 1
ENV OPAM_PKGS ocamlfind ocamlbuild cmdliner bos topkg topkg-care
RUN opam update -u && \
opam config exec -- opam-depext $OPAM_PKGS && \
opam install $OPAM_PKGS
WORKDIR /build
CMD ["bash"]
@dbuenzli
dbuenzli / .block
Last active September 16, 2016 21:09 — forked from mbostock/.block
Hierarchical Edge Bundling
license: gpl-3.0
@dbuenzli
dbuenzli / .block
Last active September 16, 2016 23:58
license: gpl-3.0
<test*> : use_c, use_a, use_b