[]: {{{1
File : README.md
Maintainer : Felix C. Stegerman <[email protected]>
Date : 2013-05-25
[]: }}}1
[]: {{{1
[]: {{{1
File : README.md
Maintainer : Felix C. Stegerman <[email protected]>
Date : 2013-05-25
[]: }}}1
[]: {{{1
# Usage: canonpath <path> | |
# No physical check on the filesystem, but a logical cleanup of a | |
# path. | |
# Uses perl. | |
function canonpath () | |
{ perl -MFile::Spec -e 'print File::Spec->canonpath($ARGV[0])' "$1"; } | |
O = require 'obfusk'; U = require 'underscore' | |
f = (x) -> O.Just x + 1 | |
g = (x) -> O.Just x * 42 | |
h = (x) -> O.Nothing() | |
x = U.reduce([f,g], O.mbind, O.Just(2)) | |
y = U.reduce([f,h,g], O.mbind, O.Just(2)) | |
console.log O.match(x, Nothing: (-> 'too bad'), Just: ((x) -> "#{x.value}!!!")) |
ME=$$; echo "I'm $ME" | |
( echo $BASHPID; sleep 5; echo 1; kill -SIGUSR1 $ME ) & | |
( echo $BASHPID; sleep 10; echo 2; kill -SIGUSR1 $ME ) & | |
( echo $BASHPID; sleep 15; echo 3; kill -SIGUSR1 $ME ) & | |
foo () { echo "USR1 received"; } | |
bar () { echo "USR2 received"; } | |
trap foo SIGUSR1 |
grep -R '[^"]\$@\|\$@[^"]' --exclude-dir=.git . 2>/dev/null | grep -v Binary |
# 1 | |
# usage: relpath <to> <from> | |
relpath () { python -c \ | |
'import os.path, sys; print os.path.relpath(*sys.argv[1:])' "$@"; } | |
# 2 | |
rel_bin="${bin#"$PREFIX"}" |
7z a -mhe=on -p foo.7z foo/ |
CFG = { | |
test: {}, | |
prod: {}, | |
dev: { | |
... | |
# smtp: { ... } | |
} | |
} |