Skip to content

Instantly share code, notes, and snippets.

Lindsey Kuper lkuper

Block or report user

Report or block lkuper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active Nov 12, 2019
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@pozorvlak
pozorvlak / sitrep.md
Last active Jan 17, 2016
CRDT/Semilattice SITREP
View sitrep.md

Here's where I understand the state of the art to be:

  • In this INRIA tech report, Shapiro, Preguiça, Baquero and Zawirski (SPBZ) prove, amongst other things, that a sufficient condition for CRDTs to achieve eventual consistency on networks which may reorder and duplicate packets (which I'll call flaky networks, henceforth) is that
    1. the underlying datatype forms a semilattice,
    2. messages are full states,
    3. incoming messages are combined with the node's current state using the least-upper-bound operation in the semilattice.
  • It's possible to relax condition 2 and still achieve eventual consistency over flaky networks by fragmenting the state into independent parts and transmitting updates to each part separately. For instance, in the G-Set CRDT (an add-only bitset) one can transmit only the index of the element to be added.
  • In [these slides from a talk at Dagstuhl](http://www.dagstuhl.de/mat/Files/13/13081/13081.BaqueroCarlos.Sl
@DanielleSucher
DanielleSucher / one_char.sh
Last active Dec 17, 2015 — forked from aprescott/gist:5683945
Bash script to find all single-character commits in a git repository
View one_char.sh
first_commit=$(git log --pretty=format:%H | tail -1)
git rev-list --all --no-merges |
while read commit; do
if [ $commit == $first_commit ]; then break; fi;
IFS_backup=$IFS
IFS=$'\n'
diff_lines=( $(git diff --numstat --minimal -U0 --word-diff=porcelain $commit^ $commit | grep -E '^(\+[^+]|-[^-]).*$') )
IFS=$IFS_backup
@chrishunt
chrishunt / shas.sh
Last active Dec 17, 2015
Show commits with a 1 char diff
View shas.sh
# Find all SHAS with a single line diff
SHAS=`git log --stat --oneline |\
grep "| 2 +-" -B1 |\
egrep -v "^(\s|-)" |\
cut -d' ' -f1`
# Of those SHAS, find the ones with single character diff
git show --word-diff=plain -p --oneline `echo $SHAS` |\
egrep "(\[-|{\+).(\+}|-\])" -B10 |\
grep "$SHAS"
@aprescott
aprescott / gist:5683945
Last active Dec 17, 2015
An attempt at showing only git commits where a single character has been changed.
View gist:5683945
# an attempt at showing only commits where a single character has been changed.
#
# lots of false positives.
git rev-list --all --no-merges |
while read commit; do
files_changed=$(git diff $commit^ $commit --name-only | wc -l)
diffcontent="$(git diff --numstat --minimal -U0 --word-diff=porcelain --word-diff-regex=. $commit^ $commit | grep -e '^\+.$')"
if [ $files_changed -eq 1 ] && [ $(echo "$diffcontent" | wc -l) -eq 1 ] && [ ! -z "$diffcontent" ]; then
@bcantrill
bcantrill / cornellcs.txt
Created Dec 13, 2012
An old e-mail to the Cornell CS faculty; have things changed in the last 12 years?
View cornellcs.txt
From bmc Mon Oct 2 15:12:34 2000
Subject: Undergrad systems curriculum
To: faculty@cs.cornell.edu
Date: Mon, 2 Oct 2000 15:12:34 -0700 (PDT)
X-Mailer: ELM [version 2.4ME+ PL31H (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 4065
Status: RO
View gist:2646038
rust-try:
#!/bin/bash
git diff --quiet HEAD
if [[ "$?" != "0" ]]; then
echo "Cannot push to master with uncommited changes."
exit 1
fi
git push -f mozilla HEAD:try
@nikomatsakis
nikomatsakis / hashtable-prob.md
Created Dec 2, 2011
Addressing "the hashtable problem" with modular type classes
View hashtable-prob.md

The "Hashtable Problem"

There is a danger with typeclasses only on functions because they permit a lack of coherence. This danger is particularly acute with collections, where the definition of a particular interface---such as hashable or ord---may be used in structuring the data structure. This renders the data structure corrupt when used with a different implementation.

To see the problem, consider a hashtable defined something like this:

You can’t perform that action at this time.