Skip to content

Instantly share code, notes, and snippets.

View brendan-donegan's full-sized avatar

Brendan Donegan brendan-donegan

View GitHub Profile
brendand@brendand-T450:~$ cat algo.py
L = list(range(1000000))
LS = set(L)
def findit():
if 500000 in L:
pass
def findset():
if 500000 in LS:
pass
#!/bin/sh
#
# This pre-commit hook looks for `fdescribe`, `fcontext`, `fit`, `fspecify` and `fexample` in the
# staged files and exits with an error code of 1 if there are such changes.
#
STATUS=0
for focus in fdescribe fcontext fit fspecify fexample; do
FILES=$(git diff --staged -G"^\s*$focus\(" --name-only | wc -l)
if [ $FILES -gt 0 ]
then