This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (* ocamlfind ocamlopt -thread -package lwt,tls,x509,cohttp,cohttp-lwt,lwt_ppx,cohttp-lwt-unix -linkpkg cohttp_tls.ml *) | |
| open Lwt | |
| open Printf | |
| open Cohttp | |
| open Cohttp_lwt_unix | |
| let ca_file = "ca-chain.crt" | |
| let cert_file = "your.crt" | |
| let key_file = "your_private.key" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; | |
| ;; Paths for Emacs itself | |
| ;; | |
| ;(setq merlin-debug 'message) | |
| (setq | |
| opam-prefix | |
| (substring | |
| (shell-command-to-string "/usr/local/bin/opam config var prefix 2>/dev/null") 0 -1)) | |
| (setq opam-bin (concat opam-prefix "/bin")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (* ocamlfind ocamlopt -o exmpl -package curl -linkpkg exmpl.ml *) | |
| open Printf | |
| let _ = Curl.global_init Curl.CURLINIT_GLOBALALL | |
| (* | |
| ************************************************************************* | |
| ** Aux. functions | |
| ************************************************************************* | |
| *) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Unix | |
| open Hashtbl | |
| open Bigarray | |
| open Bigarray.Array2 | |
| module type Params = sig | |
| type a | |
| type b | |
| type c | |
| val kind : (a,b) Bigarray.kind |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let (>>) x f = f x ;; | |
| let hash = hash_string (Hash.sha256()) ;; | |
| let sign_of_message key msg = | |
| msg >> hash >> | |
| (pkcs1v1pad key) >> | |
| (RSA.sign key) >> | |
| strrev | |
| ;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Unix | |
| open Printf | |
| exception EOF | |
| exception WriteError | |
| module BE = EndianString.BigEndian | |
| module M = Map.Make(struct type t = int let compare = compare end) | |
| type entry = Todo of (int * string) | Done of int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #use "topfind" | |
| #require "unix" | |
| open Printf | |
| let _ = | |
| let ts = Unix.gettimeofday () in | |
| let str = sprintf "%0.5f" ts in | |
| printf "%b\n" (ts = float_of_string str); | |
| let str = sprintf "%0.6f" ts in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; | |
| ;; OCaml mode | |
| ;; | |
| (setq | |
| opam-share | |
| (substring | |
| (shell-command-to-string "opam config var share 2>/dev/null") 0 -1)) | |
| (setq load-path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Unix | |
| open Printf | |
| module SM = Map.Make(struct type t = Unix.file_descr let compare = compare end) | |
| type context = { | |
| buf : string; | |
| smap : socket_context SM.t; | |
| count : int; | |
| history : string list; |
NewerOlder