Skip to content

Instantly share code, notes, and snippets.

View bpgould's full-sized avatar
💭
drinking from the firehose, happily

Bennett Gould bpgould

💭
drinking from the firehose, happily
View GitHub Profile
@bpgould
bpgould / identify_changed_dirs.sh
Created October 18, 2022 02:13
bash script to save directories with changed files in Travis CICD
#!/bin/bash
# this script will run in Travis CICD, identify changed files
# and save the directories of the files if a condition is met,
# it will then print the array of matching directories
if [[ "$TRAVIS_EVENT_TYPE" == "push" ]]; then
# collect only changed files from commit
files=($(git diff-tree --no-commit-id --name-only -r "$TRAVIS_COMMIT"))
elif [[ "$TRAVIS_EVENT_TYPE" == "pull_request" ]]; then
# collect all changed files from commit range
@mlgill
mlgill / proc.sh
Last active October 17, 2022 18:41
Bash script to display sorted list of processes using most memory or cpu with colorized output
#!/bin/bash
# Michelle L. Gill
# 2014/10/25
# For use with Today Scripts
# http://www.reddit.com/r/osx/comments/2k24ps/today_scripts_widget_update_colorized_output
# Inspired by: https://gist.github.com/anonymous/470bb40b05173fdb6348
# Set this to "cpu" or "mem"
procname="cpu"