Skip to content

Instantly share code, notes, and snippets.

@reinh
reinh / README.md
Last active February 25, 2020 23:25
Resilience Engineering quotes

Resilience Engineering quotes

Collected by @reinh.

The Safety Anarchist by Sidney Dekker

Dekker, S. (2017). The Safety Anarchist: Relying on Human Expertise and Innovation, Reducing Bureaucracy and Compliance. United Kingdom: CRC Press.

@reinh
reinh / set-window-title.zsh
Created February 24, 2020 19:51
Set iTerm2 window title to relative PWD (~/foo)
function set-window-title {
echo -ne "\e]1;$(dirs)\a"
}
set-window-title
add-zsh-hook precmd set-window-title
@reinh
reinh / apology.
Created October 22, 2019 18:58 — forked from unclebob/apology.
Apology to Women Programmers. [Originally by Robert Martin, saved here for posterity by @reinh]
Today I gave a keynote at ACCU in Oxford. In the midst of it I made two (count them) two statements that I should have known better than to make. I was describing the late '70s, and the way we felt about the C language at the time. My slide said something like: "C was for real men." Emily Bache, whom I know and hold in high regard, spoke up and said "What about women?". And I said something like: "We didn't allow women in those days." It was a dumb crack, and should either not have been said, or should have been followed up with a statement to the effect that that was wrong headed.
The second mistake I made was while describing Cobol. I mentioned Adm. Grace Hopper. I said something like "May she rest in peace." I don't know that any of the words were actually demeaning, but the tone was not as respectful as it should have been to an Admiral in the United State Navy, and one who was so instrumental in our industry; despite what I feel about Cobol.
I am a 59 year old programmer who was brought up
@reinh
reinh / i_am_me.txt
Last active March 12, 2023 08:00
I Am Me by Virginia Satir
I Am Me
In all the world, there is no one else exactly like me
Everything that comes out of me is authentically me
Because I alone chose it – I own everything about me
My body, my feelings, my mouth, my voice, all my actions,
Whether they be to others or to myself – I own my fantasies,
My dreams, my hopes, my fears – I own all my triumphs and
Successes, all my failures and mistakes Because I own all of
Me, I can become intimately acquainted with me – by so doing
# roll 2d6+3
function roll {
local match total
local -a rolls
if ! [[ "$1" =~ '([0-9]+)d([0-9]+)(\+[0-9]+)?' ]]; then
echo "usage: roll 2d6+3" 1>&2
return 1
fi
class Proc
%i[! ~].each do |op|
define_method(op) { ->(x) { call(x).send(op)} }
end
%i[+ - * / ^ & |].each do |op|
define_method(op) { |other| ->(x) { call(x).send op, other.call(x) } }
end
end
@reinh
reinh / Collate.hs
Last active January 11, 2018 08:52
-- Collation of infinite streams. I guess.
module Collate where
import Prelude hiding (take, zip, repeat, head, tail)
import qualified Data.List as List
infixr 5 :<
-- An infinite stream of values
data Stream a = a :< Stream a

Keybase proof

I hereby claim:

  • I am reinh on github.
  • I am reinh (https://keybase.io/reinh) on keybase.
  • I have a public key whose fingerprint is 47C0 8838 CF46 96A1 2B5C 4E06 B2A1 232F F98C AB84

To claim this, I am signing this object:

$ idris --install ncurses.ipkg
Entering directory `./src'
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C Ncurses
make[1]: `ncurses_extra.o' is up to date.
Leaving directory `./src'
Entering directory `./src'
Installing ncurses_extra.o to /usr/local/Cellar/idris/1.0/share/x86_64-osx-ghc-8.0.2/idris-1.0/libs/ncurses/
Uncaught error: ncurses_extra.o: copyFile:atomicCopyFileContents:withReplacementFile:copyFileToHandle:openBinaryFile: does not exist (No such file or directory)
(defun agda/comment-in ()
(interactive)
(save-excursion
(search-backward "{-+}")
(forward-char 4)
(backward-delete-char 2)
(insert-string "(-}")
(search-forward "{+-}")
(backward-delete-char 3)
(insert-string "-)-}")