Skip to content

Instantly share code, notes, and snippets.

View aalfson's full-sized avatar
💭

Aaron Alfson aalfson

💭
View GitHub Profile
@aalfson
aalfson / select_all_that_match
Last active August 29, 2015 14:02
Select All Cells that Match a Selected Cell - Excel VBA Macro
'Excel macro that will select all of the cells that match the value contained in the currently selected cell.
Sub SelectAllThatMatch()
Set sourceCell = ActiveCell
Set selectedCells = sourceCell
Dim rwIndex As Integer
Dim rwMax As Integer
rwMax = ActiveSheet.UsedRange.Rows.Count
@aalfson
aalfson / redis_max_key_size.sh
Last active August 29, 2015 14:05 — forked from epicserve/redis_key_sizes.sh
Bash script that prints out the largest key in your Redis store.
#!/usr/bin/env bash
# This script prints out the largest key in your Redis store.
# This script was forked from Brent O'Connor at https://gist.github.com/epicserve/5699837. It was subsequently modified by Aaron Alfson.
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}