Skip to content

Instantly share code, notes, and snippets.

View vilfu's full-sized avatar

Ville Svärd vilfu

  • Funnel
  • Stockholm
View GitHub Profile
@vilfu
vilfu / Dockerfile
Created April 30, 2021 06:42
cowsay Dockerfile example
FROM alpine:3.13
LABEL maintainer="Ville ([email protected])"
RUN apk add git perl
RUN git clone https://github.com/schacon/cowsay.git /cowsay
ENV COWPATH /cowsay/cows
ENTRYPOINT ["perl", "/cowsay/cowsay"]
@vilfu
vilfu / net-negative-oneline
Last active September 26, 2019 21:41
Most net negative commit
git log --shortstat --no-merges --pretty=format:"%h %ae" | awk '{ if (NF == 2) { commit=$1; author=$2 }; if (NF == 7) { removed=$6; if (deletions[author] < removed) {deletions[author]=removed; commits[author]=commit;}; }; if (NF == 5 && $5~/deletions/) { removed=$4; if (deletions[author] < removed) {deletions[author]=removed; commits[author]=commit;}; }; } END { for (author in deletions) { print "-"deletions[author]"\t"commits[author]"\t"author;} }' | sort -n | head -n10