Skip to content

Instantly share code, notes, and snippets.

View samvrlewis's full-sized avatar

Sam Lewis samvrlewis

View GitHub Profile
#!/usr/bin/env bash
# Short script to benchmark the memory and bandwidth performance of esthri over time
set -ex
export RUST_LOG=warn
if [[ $1 == esthri_new ]]; then
@samvrlewis
samvrlewis / longest-git-commit-message
Last active January 18, 2024 12:48
Get the longest git commit messages
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 November 15, 2018 22:20 — forked from drewmoseley/yocto-mender-rpi3.sh
Script to build Yocto+Mender for Raspberry Pi 3
#!/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 December 18, 2016 03:22
Count words in LaTeX python script
#!/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/'