Skip to content

Instantly share code, notes, and snippets.

View mustpax's full-sized avatar

Mustafa "Moose" Paksoy mustpax

View GitHub Profile
@mustpax
mustpax / group_by_column.gs
Created January 25, 2024 22:11
Google Apps Script for creating collapsible groups (assumes data is sorted, requires underscore)
function run() {
groupByColumn(0);
groupByColumn(1);
groupByColumn(2);
}
function selectRows(sheet, startRow, endRow) {
let numRows = endRow - startRow;
let startRow1Indexed = startRow + 2;
return sheet.getRange(startRow1Indexed, 1, numRows, sheet.getDataRange().getNumColumns());
@mustpax
mustpax / clip.sh
Created May 20, 2024 22:04
Bash script to edit contents of your clipboard with $EDITOR on macOS
#!/bin/bash
set -o errexit # Exit on error
set -o nounset # Treat unset variables as an error
set -o pipefail # Consider errors in a pipeline
default_editor=${EDITOR:-vim}
temp_file_path=$(mktemp /tmp/clip_temp.XXXXXX)
trap "rm -f $temp_file_path" EXIT