Skip to content

Instantly share code, notes, and snippets.

View lauriro's full-sized avatar

Lauri Rooden lauriro

View GitHub Profile
@lauriro
lauriro / diff.mdown
Created February 23, 2021 15:55 — forked from ndarville/diff.mdown
Paul Heckel's Diff Algorithm

[Isolating Differences Between Files][paper]

Advantage over Other Algorithms

The diff output is more specific:

[I]f a whole block of text is moved, then all of it, rather than just the beginning and end, is detected as changed.

>The algorithm described here avoids these difficulties. It detects differences that correspond very closely to our intuitive notion of difference.

@lauriro
lauriro / heredoc
Last active September 11, 2021 16:05
#!/bin/sh
# Usage info
show_help1() {
cat << EOF
Usage: ${0##*/} [-hv] [-f OUTFILE] [FILE]...
Do stuff with FILE and write the result to standard output. With no FILE
or when FILE is -, read standard input.
-h display this help and exit
-f OUTFILE write the result to OUTFILE instead of standard output.