Skip to content

Instantly share code, notes, and snippets.

@AltGr
AltGr / reformat-branch.sh
Created May 10, 2022 16:24
Small script used to reformat a local branch commit by commit, using the ocamlformat configuration from origin/master
#!/bin/bash -uex
if [ $# -gt 0 ]; then
echo "Reformats the current branch patch by patch, according to the ocamlformat"
echo "config at origin/master. Use before rebase."
exit 1
fi
reformat() {
git checkout origin/master .ocamlformat
This file has been truncated, but you can view the full file.
# Solver: builtin-mccs+glpk
# Criteria: -removed,-count[version-lag,request],-count[version-lag,changed],-changed
preamble:
property: opam-query: int = [0], version-lag: nat = [0], pinned: bool = [false], installed-root: bool = [false], reinstall: bool = [false], opam-version: string, opam-name: string
package: py
version: 4
depends: ocaml >= 50 , dune >= 45 , ctypes >= 46 , ctypes-foreign >= 2 , conf-python-3-dev
conflicts: py
opam-name: py
required-tools: [["curl" "wget"] "diff" "patch" "tar" "unzip"]
wrap-build-commands: []
wrap-install-commands: []
wrap-remove-commands: []
@AltGr
AltGr / try-opam-2.sh
Last active October 24, 2017 09:32
A script to safely download and try the newest opam release
#!/bin/bash -ue
VERSION=2.0.0~beta4
MINORV=${VERSION##*[^0-9]}
BASEV=${VERSION%$MINORV}
CURRENT_VERSION=$(opam --version --safe)
if [ $? -ne 0 ]; then CURRENT_VERSION=none; fi
if [ -z "${OPAMROOT:-}" ]; then OPAMROOT=~/.opam; fi
(**************************************************************************)
(* *)
(* Copyright 2017 OCamlPro *)
(* *)
(* All rights reserved. This file is distributed under the terms of the *)
(* GNU Lesser General Public License version 2.1, with the special *)
(* exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
@AltGr
AltGr / plotmem
Last active August 29, 2015 14:23
#!/bin/zsh -e
interval=2
pid=
while [ $# -gt 0 ]; do
case $1 in
--help)
echo "plotmem: plots the memory usage of a command in real-time using gnuplot"
echo "Usage: $0 [options] command [command-options]"
echo "Options:"

Keybase proof

I hereby claim:

  • I am AltGr on github.
  • I am altgr (https://keybase.io/altgr) on keybase.
  • I have a public key whose fingerprint is 6EFB F50C 854F 3484 8D35 D70C 1839 9C47 86A9 BC98

To claim this, I am signing this object:

@AltGr
AltGr / opam
Created February 17, 2015 02:56
OPAM starter pack
opam-version: "1.2"
name: "starter-pack"
version: "0.1"
maintainer: "Louis Gesbert <louis.gesbert@ocamlpro.com>"
depends: [
"depext"
"user-setup"
"tuareg"
"merlin"
"ocp-indent"
@AltGr
AltGr / git-paste
Created July 25, 2014 17:04
Plug git directories between repos with history
#!/bin/bash -ue
usage() {
echo "Usage: $0 srcdir[#ref] dstdir[#ref]"
echo
echo "Pastes between subdirectories of git repositories,"
echo "preserving history"
}
SRC="$1"; shift
#aspcud $in $out $pref -removed,-notuptodate,-new
preamble:
property: installed-root: bool = [false], reinstall: bool = [false], buildessential: bool = [false], essential: bool = [false], sourceversion: int = [1], sourcenumber: string = [""], source: string = [""], number: string, recommends: vpkgformula = [true!]
package: dbforge
version: 239
depends: xml-light , mysql , conf-glade = 236 , lablgtk >= 271 , lablgtk-extras >= 161 , config-file >= 153 , ocamlfind
conflicts: dbforge
number: 2.0.1
source: dbforge