Skip to content

Instantly share code, notes, and snippets.


Dave Cottlehuber dch

View GitHub Profile
View emacs-indent-erlang
;;; File: emacs-indent-erlang
;;; adapted from
;; this has to be set to the real path on your system
(add-to-list 'load-path "~/.emacs.d/elpa/erlang-20131025.6")
(load-library "erlang")
;; comment out the call to untabify if you want the mixed tabs and spaces
(defun emacs-indent-function ()
View prealloc_bin.S
{module, prealloc_bin}. %% version = 0
{exports, [{module_info,0},{module_info,1},{new,1}]}.
{attributes, []}.
{labels, 7}.
{function, new, 1, 2}.
#!/usr/bin/env bash
# Note: erlang depends on ncurses, openssl at a minimum
usage ()
echo "usage: $0 <release> <type>"
echo " release: R14B01|R14B02|R14B03|R14B04|R15B|R15B01|R15B02|R15B03|R16B|R16B01|R16B02"
echo " type: normal, opt, gcov, gprof, debug, valgrind, or lcnt"
dch / report.erl
Created Feb 21, 2014
online version of crash_dump viewer that doesn't require blowing up your vm. Snaffled off erlang-questions.
View report.erl
-author("Matthew Evans <>").
crash_report() ->
Date = erlang:list_to_binary(rfc1123_local_date()),
Header = binary:list_to_bin([<<"=erl_crash_dump:0.2\n">>,Date,<<"\nSystem version: ">>]),
Ets = ets_info(),
Report = binary:list_to_bin([Header,erlang:list_to_binary(erlang:system_info(system_version)),erlang:system_info(info),erlang:system_info(procs),Ets,erlang:system_info(dist),
dch / git-orphan
Created Feb 25, 2014
`git orphan` sets up a new git branch with no parent commit. Needs git 1.8 at least, maybe earlier versions.
View git-orphan
git checkout --orphan $* && git rm -rf .
dch / erlang.rb
Last active Aug 29, 2015
Install OTP 17.0-rc2 via homebrew: `brew install wxmac && brew install --no-docs --with-dirty-schedulers --time --devel -v`
View erlang.rb
require 'formula'
# Major releases of erlang should typically start out as separate formula in
# Homebrew-versions, and only be merged to master when things like couchdb and
# elixir are compatible.
class Erlang < Formula
homepage ''
# Download tarball from GitHub; it is served faster than the official tarball.
url ''
sha1 'b8f6ff90d9eb766984bb63bf553c3be72674d970'
dch /
Last active Aug 29, 2015
PPSP-TP feedback

Tracker Review


  • the draft is too long for the 4 requirements from [rfc6972]
  • much of the included content is not directly relevant and arguably confusing
  • there is not enough separation of concern between TP and PPSP
  • technically it might be replaced with simpler alternatives (with some compromises)
  • I'm not intending to implement this in its current form
APPDIRS := $(wildcard apps/*)
## Example hack to filter one out:
## APPDIRS := $(filter-out apps/fooapp, $(APPDIRS))
$(foreach appdir,$(APPDIRS),$(MAKE) -C $(appdir) $(1) ;)
View .gitignore
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<CHANGE-ME>"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-""} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted