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. *)
(* *)
(**************************************************************************)
#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
#internal OPAM solver
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
@AltGr
AltGr / failing.html
Created April 20, 2013 14:01
Overview of changes for a possible option setting align/indent preference
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Overview of possible changes</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style>
TABLE { border-collapse: collapse; border-spacing: 0px; margin: auto; }
H2 { margin-top: 5ex; text-align: center; padding: 1ex;
background-color: orange; }
@AltGr
AltGr / opam_lintian
Created February 4, 2013 11:32
opam lintian warnings
W: opam: hardening-no-relro usr/bin/opam
N:
N: This package provides an ELF binary that lacks the "read-only
N: relocation" link flag. This package was likely not built with the
N: default Debian compiler flags defined by dpkg-buildflags. If built using
N: dpkg-buildflags directly, be sure to import LDFLAGS.
@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:"