Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Lewis samvrlewis

View GitHub Profile
@samvrlewis
samvrlewis / longest-git-commit-message
Last active Mar 6, 2021
Get the longest git commit messages
View longest-git-commit-message
git rev-list --no-merges "${1:-HEAD}" | while read rev; do echo "$(git show -s --format='%b' $rev | wc -w) words: $rev"; done | sort -rn | head -6 | cut -f2 -d: | xargs -I{} git rev-list --pretty=medium {} --max-count=1
@samvrlewis
samvrlewis / yocto-mender-rpi3.sh
Created Nov 15, 2018 — forked from drewmoseley/yocto-mender-rpi3.sh
Script to build Yocto+Mender for Raspberry Pi 3
View yocto-mender-rpi3.sh
#!/bin/bash
#
if [ "$(/bin/ls -1A | wc -l)" -ne "0" ]; then
echo Please run this from an empty directory.
exit 1
fi
BASE=$(pwd -P)
@samvrlewis
samvrlewis / pre-commit.py
Last active Dec 18, 2016
Count words in LaTeX python script
View pre-commit.py
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#-*- mode: python -*-
import subprocess
import os
import phant
THESIS_SECTIONS_DIR = '/Users/Sam/Dropbox/Uni/Thesis/thesis/sections/'