Skip to content

Instantly share code, notes, and snippets.

@BobbyRyterski
BobbyRyterski / mac_fix_gpu.sh
Last active August 29, 2015 14:14
Mac GPU switching fix
#!/usr/bin/env bash
# https://gist.github.com/BobbyRyterski/096c2566ca486649d25c
# save your battery, fix settings for apps that default to use the discrete gpu
# http://answers.microsoft.com/en-us/mac/forum/macoffice2011-macoutlook/office-for-mac-mavericks-high-performance-gpu/e1a6aff0-e36e-40ae-ab62-aa7e3e0c6b10
# http://blog.her.se/2014/03/increase-battery-performance-in-your.html
fix_app_gpu_defaults() {
[[ -d "$1" ]] || { echo "App not found: $1" >&2; return 1; }
@BobbyRyterski
BobbyRyterski / base62.sh
Last active January 18, 2023 07:36
BASH base 62 encode / decode
#!/usr/bin/env bash
# https://gist.github.com/BobbyRyterski/7a511b96ece47655b17d
# based on http://stackoverflow.com/q/14471692
readonly BASE62=($(echo {0..9} {a..z} {A..Z}))
base62_encode() {
local out=
for i in $(bc <<< "obase=62; $1"); do
@BobbyRyterski
BobbyRyterski / md5_compare.sh
Created June 27, 2014 00:23
md5_compare.sh
#!/bin/bash
error() {
echo "$*"
exit 1
}
usage() {
echo "Usage: bash md5_compare.sh [A] [B]"
echo " Checks that all hashes in B are in A"
@BobbyRyterski
BobbyRyterski / README.md
Last active December 27, 2015 10:39
ffp.sh

ffp.sh

A BASH script to generate FLAC fingerprint files.

Usage

./ffp.sh DIR