Skip to content

Instantly share code, notes, and snippets.

open List
let num_devs = 20
let failure_rate = 0.20
let build_time = (15. (* mins *) /. 60.) (* hours *)
let commit_wait_timeslots = 4. /. build_time (* on average *)
let working_hours = 8.
let num_timeslots = working_hours /. build_time |> int_of_float
type build_status = Idle | Building | Pass | Retry | Fail
@eentzel
eentzel / gist:839027
Created February 22, 2011 17:33
setting window title in an alias
alias tailcat='echo -ne "\033]0;Tomcat log\007"; tail -f $CATALINA_HOME/logs/catalina.out'
@eentzel
eentzel / gist:1087394
Created July 17, 2011 09:20
sum number in Emacs' calc-mode
;; select numbers, then run:
;; M-x calc-grab-rectangle
;; to load them into calc, then:
;; v R +
;; to call calc-reduce and pass it the + operator
@eentzel
eentzel / Makefile
Last active October 2, 2015 23:48
Magit 1.2.0 Makefile for Emacs.app
VERSION=1.2.0
EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
PREFIX=/Applications/Emacs.app/Contents/Resources
SYSCONFDIR=/Applications/Emacs.app/Contents/Resources/site-lisp
ELS=magit.el magit-svn.el magit-topgit.el magit-stgit.el magit-key-mode.el magit-bisect.el magit-wip.el rebase-mode.el magit-blame.el
ELS_CONTRIB=contrib/magit-simple-keys.el contrib/magit-classic-theme.el
ELCS=$(ELS:.el=.elc)
ELCS_CONTRIB=$(ELS_CONTRIB:.el=.elc)
DIST_FILES=$(ELS) Makefile magit.texi magit.info README.md magit.spec.in magit-pkg.el.in
DIST_FILES_CONTRIB=$(ELS_CONTRIB) contrib/magit
@eentzel
eentzel / gist:4262923
Created December 11, 2012 22:28
RPM cheatsheet
# what package provides this file?
rpm -qf `which gem`
# rubygems-1.3.7-1.el6.noarch
# what packages depend on this package?
rpm -q --whatrequires rubygems
# rubygem-bundler-1.0.21-0.noarch
# more docs: http://ffmpeg.org/ffmpeg.html
FRAME_RATE=20
ffmpeg -r $FRAME_RATE -pattern_type glob -i "frame_*.png" anim.mp4
@eentzel
eentzel / wait-for.clj
Last active December 12, 2015 02:38 — forked from mrowe/wait-for.clj
;; Based on a queue polling function from Chas Emerick's bandalore:
;; https://github.com/cemerick/bandalore/blob/master/src/main/clojure/cemerick/bandalore.clj#L124
(defn wait-for
"Invoke predicate every interval (default 10) seconds until it returns true,
or timeout (default 150) seconds have elapsed. E.g.:
(wait-for #(< (rand) 0.2) :interval 1 :timeout 10)
Returns nil if the timeout elapses before the predicate becomes true, otherwise
#!/bin/sh
set -e
CREDENTIAL_FILE=~/.aws-creds
PROFILE_NAME=${1:-"default"}
SECTION=$(grep -A 3 "\[${PROFILE_NAME}\]" ${CREDENTIAL_FILE})
CREDENTIAL_LINES=$(echo "$SECTION" |
grep "^\(aws_access_key_id\|aws_secret_access_key\|region\)=")
;; http://www.plope.com/Members/chrism/flymake-mode
(when (load "flymake" t)
(defun flymake-pyflakes-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
# bash function
defcomp () {
local name="$1" && shift
local functionName="$( echo "${name}_completion" | tr - _ )"
source <(cat <<EOM
$functionName () {
local cur
_get_comp_words_by_ref -n =: cur
COMPREPLY=( \$(compgen -W "\$( $@ )" -- "\$cur") )
}