Skip to content

Instantly share code, notes, and snippets.

@Alpha59
Alpha59 / Nibble.py
Last active October 24, 2017 15:16
A very simple python implementation of a BrainF*** style language using nibbles (4-bits strings)
class Stack:
import sys
import re
chunks = []
heap = []
index = 0
stackIndex = 0
stack = []
ptrRight = "0000"
@Alpha59
Alpha59 / creditwherecreditisdue.sh
Last active February 3, 2023 07:56
A very very slow one-liner that goes through a git blame and sees how many lines were contributed by each author.
git ls-files -z | xargs -0n1 git blame -wfn | grep -v "test" | grep "\.(js|html)[^o]\s" | perl -n -e '/\((.*)\s[\d]{4}\-/ && print $1."\n"' | awk '{print $1" "$2" "$3}' | sort -f | uniq -c | sort -nr
# Lists the number of lines that an author has contributed to the code base.
# This also filters for !test and ==.js or .html (which was useful for this particular run)
# A Django version of the same thing:
git ls-files -z | xargs -0n1 git blame -wfn | grep -v "test" | grep -v "fixture" | grep -v "json" | grep -v "gpg" | grep -v ".md" | grep -v "initial_schema" | grep -v "fonts" | grep -v "min." | grep -v "migrations" | grep -v "images" | grep -v "/bootstrap" | grep -v "debug" | grep -v "/img" | grep -v "vendor" | perl -n -e '/\((.*)\s[\d]{4}\-/ && print $1."\n"' | awk '{print $1" "$2" "$3}' | sort -f | uniq -c | sort -nr