Skip to content

Instantly share code, notes, and snippets.

View simonjbeaumont's full-sized avatar

Si Beaumont simonjbeaumont

View GitHub Profile
@simonjbeaumont
simonjbeaumont / tmup
Last active October 13, 2021 11:03
Update bash to latest tmux environment on reattaching.
#!/bin/bash
tmup ()
{
echo -n "Updating to latest tmux environment...";
export IFS=",";
for line in $(tmux showenv -t $(tmux display -p "#S") | tr "\n" ",");
do
if [[ $line == -* ]]; then
unset $(echo $line | cut -c2-);
@simonjbeaumont
simonjbeaumont / iTunes-goodies.sh
Created March 10, 2012 17:19
Three hidden goodies in iTunes (Terminal Hacks)
#1: Invert iTunes Store links (Arrows name field browse Library)
defaults write com.apple.iTunes invertStoreLinks -bool YES
#2: Make [⌘F] focus the search input in iTunes
defaults write com.apple.iTunes NSUserKeyEquivalents -dict-add "Target Search Field" "@F"
#3: Enable iTunes track notifications in the Dock
defaults write com.apple.dock itunes-notifications -bool true
#####
@simonjbeaumont
simonjbeaumont / gist:2007619
Created March 9, 2012 17:19
Enable iTunes Dock notifications
# Enable iTunes track notifications in the Dock
defaults write com.apple.dock itunes-notifications -bool true
@simonjbeaumont
simonjbeaumont / bisect0001.out
Last active August 29, 2015 14:21
ocveralls vs. bisect coverage metrics
@simonjbeaumont
simonjbeaumont / check_subvendor_ids.sh
Created June 10, 2014 16:13
Script to check validity of subvendor ids
#!/bin/bash
SUBVENDOR_IDS=$(grep -P '^\t\t[0-9a-f]{4}' /usr/share/hwdata/pci.ids | cut -d' ' -f1 | tr -d '\t' | sort -u)
VENDORS=$(grep -P '^[0-9a-f]{4}' /usr/share/hwdata/pci.ids)
VENDOR_IDS=$(grep -P '^[0-9a-f]{4}' /usr/share/hwdata/pci.ids | cut -d' ' -f 1)
for svid in $SUBVENDOR_IDS; do
if [ $(echo "$VENDOR_IDS" | grep $svid) ]; then
echo "Found $svid"
else
@simonjbeaumont
simonjbeaumont / Makefile
Created May 13, 2014 12:56
Why does this have return code 0 when executed?
default:
ocamlfind ocamlc -o test_test -package oUnit -linkpkg -g test.ml
clean:
rm *.cmi *.cmo *.cmx test_test