This file contains hidden or 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 ruby | |
# frozen_string_literal: true | |
# Settings | |
chart_width = 8 # character width of chart, > 2 | |
# Colors for level indicator, can be hex or rgb(a) | |
# max is cutoff percentage for indicator level | |
colors = [ | |
{ |
This file contains hidden or 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 ruby | |
# frozen_string_literal: true | |
chart_width = 20 | |
cores = `sysctl -n hw.ncpu`.to_i | |
loads = `sysctl -n vm.loadavg`.split(/ /)[1..3] | |
unit = (chart_width.to_f / 100) | |
chart = Array.new(chart_width, '░') |
This file contains hidden or 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
if ((/^localhost/).test(document.location.host)) { | |
var linkChecker = (function() { | |
"use strict"; | |
let links, errors = [], completed = [], errorCounter = 0; | |
function addStyle(styleString) { | |
const style = document.createElement("style"); | |
style.textContent = styleString; | |
document.head.append(style); | |
} |
This file contains hidden or 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
use AppleScript version "2.4" -- Yosemite (10.10) or later | |
use scripting additions | |
set tabsToClose to {} | |
tell application "Safari" | |
-- cycle through all open windows | |
repeat with _window in windows | |
-- cycle through all tabs of given window | |
repeat with _tab in tabs of _window |
This file contains hidden or 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
#!/bin/bash | |
# get any app's full-size icon, PNG version | |
function geticonpng() { | |
# Autocompletes app names with modified .app_completions scripts | |
APP=`echo $1|sed -e 's/\.app$//'` | |
APPDIR='' | |
for dir in "/Applications/" "/Applications/Setapp/" "/Applications/Utilities/" "/Users/ttscoff/Applications/" "/Developer/Applications/" "/Developer/Applications/Utilties/" "/System/Applications/"; do | |
if [[ -d "${dir}$APP.app" ]]; then | |
APPDIR="$dir" |
This file contains hidden or 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
# Start podcasting | |
## Some time tracking | |
& workflows/Timing | |
- task = Podcasting | |
- project = Podcasting | |
## Do not disturb me, audio settings | |
(dnd on) |
This file contains hidden or 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 ruby | |
# frozen_string_literal: true | |
# Brett Terpstra <https://brettterpstra.com> | |
# | |
# macOS: Stores all input/output devices and volume settings to a | |
# text file, restores on demand | |
# | |
## Dependencies | |
# SwitchAudioSource <https://github.com/deweller/switchaudio-osx> |
This file contains hidden or 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
# Tricks for Bunch.app | |
# <https://brettterpstra.com/projects/bunch/> | |
# Normally we would quit Dropbox just by using: | |
# !Dropbox | |
# But Dropbox has some issues with an AppleScript-style quit | |
# so we revert to sending a KILL signal via shell script | |
$ killall Dropbox | |
# if you want to open the Dropbox process when toggling |
This file contains hidden or 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 ruby | |
require 'json' | |
require 'fileutils' | |
notebook = File.expand_path('~/Desktop/NewSnippets.qvnotebook') | |
FileUtils.mkdir_p(notebook) | |
nbmeta = { | |
"name" => "NewSnippets", | |
"uuid" => %x{uuidgen}.strip |