Skip to content

Instantly share code, notes, and snippets.

@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
@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"

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 / 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:"
@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 / 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; }
#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
#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
(**************************************************************************)
(* *)
(* 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 / 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