Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / update-mac.sh
Created July 20, 2017 22:49
Update Mac Software script (super quicker than app store)
#!/usr/bin/env bash
softwareupdate -l
while true; do
echo "Do you wish to update all the above things?"
read -p "[y/n]? " yn
case $yn in
[Yy]* ) softwareupdate -i -a; break;;
[Nn]* ) exit;;
@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@magnetikonline
magnetikonline / gittruncatehistory.sh
Last active February 27, 2020 22:29
Truncate Git history to after specific SHA1, dropping everything at and before it.
#!/bin/bash -e
# Inspired by: https://github.com/adrienthebo/git-tools/blob/master/git-truncate
if [[ (-z $1) || (-z $2) ]]; then
echo "Usage: $(basename "$0") DROP_AT_SHA1 BRANCH"
exit 1
fi
if [[ ! $1 =~ ^[0-9a-f]{7,40}$ ]]; then
echo "Error: invalid Git commit SHA1" >&2
@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {