Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Dzombak cdzombak

View GitHub Profile
View Quick Find in Things.scpt
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
@cdzombak
cdzombak / Chrome Tab List to Things.scpt
Created Mar 15, 2021
Add browser tab lists as Things tasks
View Chrome Tab List to Things.scpt
-- 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"
@cdzombak
cdzombak / Sample Template
Last active Mar 15, 2021
Bear templates for Things projects
View Sample Template
# 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
---
@cdzombak
cdzombak / DeferredThings.scpt
Last active Mar 15, 2021
OmniFocus-style deferred tasks for Things
View DeferredThings.scpt
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
#!/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
@cdzombak
cdzombak / git-google
Last active Feb 2, 2021
Shell script adding `git google *` to git subcommands. Put this file, named `git-google`, somewhere in your $PATH, and be sure to make this file executable. Then, type "git google commit," for example, to open a Google search for "git commit tutorial." Hacky AF, but it does generally work.
View git-google
#!/usr/bin/env bash
set -e
urlencode() {
# from https://gist.github.com/cdown/1163649
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
View install-restic-pi.sh
#!/usr/bin/env bash
RESTIC_TAG_LATEST=$(curl --silent "https://api.github.com/repos/restic/restic/releases/latest" | grep -Po '"tag_name": "v\K.*?(?=")')
echo "Downloading and installing restic v$RESTIC_TAG_LATEST ..."
RESTIC_URL=https://github.com/restic/restic/releases/download/v${RESTIC_TAG_LATEST}/restic_${RESTIC_TAG_LATEST}_linux_arm.bz2
curl -L --silent ${RESTIC_URL} | bunzip2 > /usr/local/bin/restic
chmod +x /usr/local/bin/restic
@cdzombak
cdzombak / 10-banner
Last active Sep 26, 2019
automatic figlet based banner
View 10-banner
#!/bin/sh
figlet -f big "$(hostname --fqdn)" | grep -v "^ *$"
View rewrite.md

collected links on rewriting software (or not)

View lightweight-healthcheck.sh
#!/usr/bin/env bash
set -u
THING_DESC="dzombak.com"
EMAIL_SUBJECT="[dzombak.com] Website"
LASTSTATUS_FILE="$HOME/.website-healthcheck-status"
EMAIL_TO="chris@example.com"
SMS_TO="+1xxxxxxxxxx"
TWILIO_NUMBER="+1xxxxxxxxxx"