This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pid_for_name() { | |
ps -A | grep -m1 $1 | awk '{print $1}' | |
} | |
function pause_af { | |
kill -17 $(pid_for_name afplay) | |
} | |
function play_af { | |
kill -19 $(pid_for_name afplay) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const IMAGE_REGEXP = /\.(?:jpe?g|png)$/; // https://regexper.com/#%2F%5C.%28%3F%3Ajpe%3Fg%7Cpng%29%24%2F | |
const ImageminWebpWebpackPlugin = require('imagemin-webp-webpack-plugin'); | |
const { environment } = require('@rails/webpacker'); | |
environment.plugins.prepend('ImageminWebpWebpackPlugin', new ImageminWebpWebpackPlugin({ | |
silent: false, | |
detailedLogs: true, | |
})); | |
const manifest = environment.plugins.get('Manifest') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# This simple bash script ensures that bundle-audit is updated and called before a push to Heroku | |
# The goal is to ensure that a developer deploying the site is 100% aware of any vulerable gems | |
# and _must_ intentionally use `--no-verify` if they do not want to update gems. | |
if [ "$1" = "heroku" ]; then | |
bundle exec bundle-audit check --update | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rv() { | |
new_version=${1}; | |
sed_command_base="^ruby.*\([[:digit:]]\.\)*[[:digit:]]*"; | |
if [[ -z "$new_version" ]]; then | |
if [[ -e Gemfile ]]; then | |
echo "Gemfile: $(sed -ne /${sed_command_base}/p Gemfile)"; | |
fi | |
if [[ -e .ruby-version ]]; then |