View com.dzombak.iperf3.plist
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>GroupName</key> | |
<string>staff</string> | |
<key>InitGroups</key> | |
<true/> | |
<key>Label</key> | |
<string>com.dzombak.iperf3</string> |
View screenlocked.sh
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 bash | |
set -euo pipefail | |
# from https://stackoverflow.com/a/66723000 | |
function screenIsLocked { [ "$(/usr/libexec/PlistBuddy -c "print :IOConsoleUsers:0:CGSSessionScreenIsLocked" /dev/stdin 2>/dev/null <<< "$(ioreg -n Root -d1 -a)")" = "true" ] && return 0 || return 1; } | |
function screenIsUnlocked { [ "$(/usr/libexec/PlistBuddy -c "print :IOConsoleUsers:0:CGSSessionScreenIsLocked" /dev/stdin 2>/dev/null <<< "$(ioreg -n Root -d1 -a)")" != "true" ] && return 0 || return 1; } | |
if screenIsLocked; then | |
echo "Screen locked" |
View rss-media-info
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 bash | |
if [ "$#" -ne 1 ]; then | |
echo "usage: rss-media-info path/to/attachment.mp3" | |
exit 1 | |
fi | |
read -r -d '' retv <<EOF | |
itunes_duration: '$(ffmpeg -i "$1" 2>&1 | grep "Duration:" | cut -d ' ' -f 4 | sed s/,//)' | |
episode_length: $(stat -f%z "$1") |
View Quick Find in Things.scpt
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
try | |
tell application id "com.culturedcode.ThingsMac" to activate | |
tell application "System Events" | |
tell process "Things" | |
click menu item "New Things Window" of menu "File" of menu bar item "File" of menu bar 1 | |
click menu item "Quick Find…" of menu "Edit" of menu bar item "Edit" of menu bar 1 | |
end tell -- Things | |
end tell -- System Events | |
on error e number n | |
display dialog "Error " & n & ": " & e |
View Chrome Tab List to Things.scpt
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
-- RESET VALUES | |
set urlList to {} | |
set currentTab to 0 | |
-- SET DATE STAMP | |
set the dateStamp to ((the current date) as string) | |
set noteTitle to "URL List from Chrome Tabs on " & the dateStamp | |
-- PROCESS TABS OF FRONTMOST CHROME WINDOW | |
tell application "Google Chrome.app" |
View Sample Template
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
# Sample Bear-Things Template | |
* item a | |
notes for item A | |
* item b | |
* item c | |
notes for item C | |
; comments/empty lines begin with `;` | |
a second line of notes for C | |
--- |
View DeferredThings.scpt
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
use AppleScript version "2.4" -- Yosemite (10.10) or later | |
on replace_chars(this_text, search_string, replacement_string) | |
set AppleScript's text item delimiters to the search_string | |
set the item_list to every text item of this_text | |
set AppleScript's text item delimiters to the replacement_string | |
set this_text to the item_list as string | |
set AppleScript's text item delimiters to "" | |
return this_text | |
end replace_chars |
View sync-music-to-iphone.sh
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 bash | |
set -u | |
WHITE='\033[0;37m' | |
RED='\033[0;31m' | |
YELLOW='\033[0;33m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
if [ -e "/Volumes/Chris Dzombak's iPhone 11 co.brushedtype.doppler-ios" ] ; then |
View git-google
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 bash | |
set -e | |
urlencode() { | |
# from https://gist.github.com/cdown/1163649 | |
# urlencode <string> | |
old_lc_collate=$LC_COLLATE | |
LC_COLLATE=C |
NewerOlder