Skip to content

Instantly share code, notes, and snippets.

Brett Terpstra ttscoff

Block or report user

Report or block ttscoff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

A CLI for by Brett Terpstra

Save the file below as bunch in your path. Run bunch -h for help.

CLI for
    -h, --help                       Display this screen
    -l, --list                       List available Bunches
    -o, --open                       Open Bunch ignoring "Toggle Bunches" preference
    -c, --close                      Close Bunch ignoring "Toggle Bunches" preference
ttscoff / Example.bunch
Created May 18, 2019
Sample .bunch file for
View Example.bunch
# Use @@ to hide all visible apps. Usually used at the top of the file
# before launching the rest of the bunch
# Commands are surrounded by parenthesis. Only commands Bunch
# recognizes will be executed
(hide dock)
# Comments start with a hash symbol, blank lines are ignored
# Apps to launch start at the beginning of a line, no
ttscoff / onsetapp.rb
Last active Apr 23, 2019
Check which Setapp Apps you could be using
View onsetapp.rb
#!/usr/bin/env ruby
# encoding: utf-8
# Read /Applications/Setapp to get apps already installed
installed_setapp_apps = Dir.glob('/Applications/Setapp/*.app')! {|app|
# Grab the All Apps page from Setapp to get all available apps
ttscoff / macsymbols.rb
Created Apr 19, 2019
Convert liquid-style tags for Mac symbols into HTML entities
View macsymbols.rb
class String
def replace_with_entity
case self.downcase
when /apple/
when /(comm(and)?|cmd|clover)/
when /(cont(rol)?|ctl|ctrl)/
when /(opt(ion)?|alt)/
ttscoff / sizes.rb
Last active May 8, 2019
sizes: Calculate and sort all filesizes for current folder
View sizes.rb
#!/usr/bin/env ruby
# Sizes - Calculate and sort all filesizes for current folder
# Includes directory sizes, colorized output
# Brett Terpstra 2019 WTF License
VERSION = "1.0.0"
require 'shellwords'
# Just including term-ansicolor by @flori and avoiding all the
# rigamarole of requiring multiple files when it's not a gem... - Brett
ttscoff / buildhelp.rb
Created Mar 29, 2019
A little tool for parsing build notes in my projects
View buildhelp.rb
#!/usr/bin/env ruby
# encoding: utf-8
require 'optparse'
filename = nil
# Check for a build note file in the current folder. Filename must start
# with "build" and have an extension of txt, md, or markdown.
Dir.glob('*.{txt,md,markdown}').each {|f|
if f.downcase =~ /^build/
ttscoff / amazon_all_departments.js
Created Dec 16, 2018
A snippet for use with a browser shortcut manager to focus the amazon search field and set the department to all departments. Because it's got dam annoying that there's no keyboard shortcut for that.
View amazon_all_departments.js
if (document.location.href.match(/ {
document.querySelector("#searchDropdownBox").selectedIndex = 0;
View Lucky Charms.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>Lucky Charms</string>
ttscoff /
Created Sep 26, 2018
A macOS one-liner for switching Dark Mode on/off (Mojave)
osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to not dark mode'
View regexrx2md.rb
#!/usr/bin/env ruby
require 'fileutils'
require 'nokogiri'
require 'optparse'
require 'erb'
def class_exists?(class_name)
klass = Module.const_get(class_name)
return klass.is_a?(Class)
rescue NameError
You can’t perform that action at this time.