Skip to content

Instantly share code, notes, and snippets.

@AltGr
AltGr / reformat-branch.sh
Created May 10, 2022
Small script used to reformat a local branch commit by commit, using the ocamlformat configuration from origin/master
View reformat-branch.sh
#!/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
View cudf-1.cudf
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
View gist:8ec08822361f140d5396bb945fbad185
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 Oct 24, 2017
A script to safely download and try the newest opam release
View try-opam-2.sh
#!/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
View opam_analyse.ml
(**************************************************************************)
(* *)
(* 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. *)
(* *)
(**************************************************************************)
View plotmem
#!/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:"
View keybase.md

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 Feb 17, 2015
OPAM starter pack
View opam
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 Jul 25, 2014
Plug git directories between repos with history
View git-paste
#!/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
View weird-downgrade-1108-1.cudf
#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