Skip to content

Instantly share code, notes, and snippets.

View paurkedal's full-sized avatar

Petter A. Urkedal paurkedal

View GitHub Profile
[Unit]
Description=OCSIGEN Server Instance
After=network.target
[Service]
EnvironmentFile=/etc/sysconfig/ocsigen-%i
User=ocsigen
ExecStart=/usr/local/bin/opam-env ${OPAMSWITCH} ocsigenserver -c /etc/ocsigen/%i-${OPAMSWITCH}.conf
ExecStop=/usr/bin/echo shutdown >/var/run/ocsigen/%i-command.pipe
ExecReload=/usr/bin/echo reload >/var/run/ocsigen/%i-command.pipe
(* Ad comment to https://github.com/ocaml/ocaml/pull/722
*
* E.. Everything indented to even columns.
* O.. Patterns indented to odd columns, the rest to even columns.
* .L. Loose layout, delimiters above and below cases.
* .C. Compact layout, end delimiter attached to last case.
* ..P Delimited with parentheses, as allowed by the current syntax.
* ..B Delimited with brackets, as in the PR.
* .XX Pointed form.
*)
open String
(* Author: Alain Frisch, from ocaml PR 626 *)
let rec split_limit sep s len i0 i acc lim =
if i = len then
List.rev (sub s i0 (i - i0) :: acc)
else if unsafe_get s i = sep then
let acc = sub s i0 (i - i0) :: acc in
if lim = 1 then
List.rev (sub s (i + 1) (len - i - 1) :: acc)