Skip to content

Instantly share code, notes, and snippets.

@dbuenzli
dbuenzli / 4.01.0+nonouwc.patch
Created February 17, 2014 13:19
Disable -no_compact_unwind and the warnings that results from doing so
--- configure.old 2013-08-23 08:22:36.000000000 +0200
+++ configure 2014-02-05 15:08:27.000000000 +0100
@@ -280,7 +280,7 @@
*,*-*-darwin*)
bytecccompopts="-fno-defer-pop $gcc_warnings"
mathlib=""
- mkexe="$mkexe -Wl,-no_compact_unwind"
+ mkexe="$mkexe -Wl,-w"
# Tell gcc that we can use 32-bit code addresses for threaded code
# unless we are compiled for a shared library (-fPIC option)
@dbuenzli
dbuenzli / spin.ml
Last active August 29, 2015 13:56
Test case for spinning process with ctypes
(* Spinning with 4.01.0
Compile with:
ocamlfind ocamlc -package tsdl -linkpkg -o spin.byte spin.ml
ocamlfind ocamlopt -package tsdl -linkpkg -o spin.native spin.ml
*)
open Tsdl
let test () =
let () =
let i = open_in_bin Sys.argv.(2) in
let len = in_channel_length i in
let s = String.create len in
really_input i s 0 len;
Printf.printf "let %s =\n\ \"" Sys.argv.(1);
for i = 0 to String.length s - 1 do
if i mod 18 = 0 && i <> 0 then Printf.printf "\\\n ";
Printf.printf "\\x%02X" (Char.code s.[i]);
done;
#aspcud $in $out $pref -removed,-notuptodate,-changed
preamble:
property: pinned: bool = [false], build-dep: bool = [false], installed-root: bool = [false], reinstall: bool = [false], opam-version: string, opam-name: string
package: herelib
version: 3
depends: ocamlfind
conflicts: herelib
opam-name: herelib
opam-version: 109.10.00
@dbuenzli
dbuenzli / safari-trace
Created June 20, 2014 13:26
safari-trace
((state-in((handshake((version TLS_1_2)(machina(Server ServerInitial))(config((ciphers(TLS_RSA_WITH_AES_256_CBC_SHA TLS_DHE_RSA_WITH_AES_256_CBC_SHA TLS_RSA_WITH_AES_128_CBC_SHA TLS_DHE_RSA_WITH_AES_128_CBC_SHA TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA TLS_RSA_WITH_3DES_EDE_CBC_SHA TLS_RSA_WITH_RC4_128_SHA TLS_RSA_WITH_RC4_128_MD5))(version(TLS_1_2 TLS_1_0))(hashes(SHA512 SHA384 SHA256 SHA MD5))(use_rekeying true)(requre_sec_rek true)(validator())(peer_name())(certificate(<CERTIFICATE>))))(rekeying())(hs_fragment())))(decryptor())(encryptor())(fragment())))(record-in(((content_type HANDSHAKE)(version TLS_1_0))((01 00 00 a7 03 03 53 a4 35 6e 8c 09 82 3e 46 16)(f6 bc f5 40 94 b7 e3 80 30 c0 83 c2 cd b7 02 55)(87 9f b1 b2 19 58 00 00 4a 00 ff c0 24 c0 23 c0)(0a c0 09 c0 07 c0 08 c0 28 c0 27 c0 14 c0 13 c0)(11 c0 12 c0 26 c0 25 c0 2a c0 29 c0 05 c0 04 c0)(02 c0 03 c0 0f c0 0e c0 0c c0 0d 00 3d 00 3c 00)(2f 00 05 00 04 00 35 00 0a 00 67 00 6b 00 33 00)(39 00 16 01 00 00 34 00 00 00 0e 00 0c 00 00 09)(31 32 37 2e 30 2e 30
@dbuenzli
dbuenzli / pkgs
Created June 25, 2014 20:03
opam pkg list
asn1-combinators 0.0.1 installed
base-bigarray base root
base-threads base root
base-unix base root
bin_prot 111.03.00 installed
biniou 1.0.9 installed
bytes 1.1 installed
camlp4 4.01.0 installed
camlzip 1.05 installed
cmdliner 0.9.4 installed
@dbuenzli
dbuenzli / Info.plist
Last active August 29, 2015 14:03
Build osx bundle
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key><string>Test</string>
<key>CFDisplayName</key><string>Test</string>
<key>CFBundleIdentifier</key><string>org.example.Test</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>CFBundleSignature</key><string>????</string>
<key>CFBundleVersion</key><string>%%VERSION%%</string>
@dbuenzli
dbuenzli / merlin.log
Created August 24, 2014 15:25
merlin hang
{"time":0.0,"level":"info","section":"general","title":"monitor start","content":["general","info"]}
{"time":0.0,"level":"info","section":"general","title":"available logging sections","content":["general","command","parser","locate","recover","protocol"]}
{"time":0.0,"level":"info","section":"general","title":"monitor start","content":["protocol","info"]}
{"time":0.0,"level":"info","section":"protocol","title":"input","content":{"time":0.005412,"delta":0.0011029999999999998,"body":["project","find","/Users/dbuenzli/gg/src/gg.ml"]}}
{"time":0.0,"level":"info","section":"protocol","title":"output","content":{"time":0.0054789999999999995,"delta":6.699999999999935e-05,"body":["return",{"result":[]}]}}
{"time":0.0,"level":"info","section":"protocol","title":"input","content":{"time":0.005525,"delta":4.60000000000009e-05,"body":["reset","ml","/Users/dbuenzli/gg/src/gg.ml"]}}
{"time":0.0,"level":"info","section":"protocol","title":"output","content":{"time":0.005885,"delta":0.0003599999999999992,"body":["return",{"
@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