Scripts & Snippets
Short scripts and code snippets, mostly Python, zsh and Go.
2020
-
Sync macOS Shortcuts to Alfred Snippets
Python script to sync macOS/iOS system shortcuts to an Alfred snippet collection.
-
Retrieve pasteboard contents by type on macOS
Swift CLI helper to retrieve pasteboard content by type.
2019
-
Pinboard Bookmarks to Chrome
Script to Overwrite a Chrome profile's bookmarks with your Pinboard bookmarks.
-
Set the hostname on macOS
Use
scutil
to set a Mac's FQDN.sudo scutil --set HostName fqdn.example.com
2018
-
Copying Alfred's environment to your shell
A simple script to create an Alfred-like environment in your shell by extracting and exporting variables from info.plist.
2017
-
Multiple app instances and scripting weirdness
It's possible to start multiple instances of an application with
open -n
:
2016
-
Workflow build script for Alfred
A script for building Alfred workflows. Focussed on Python-based workflows.
Creates an
.alfredworkflow
file from the contents of the specified directory. The generated file's name is based on the workflow's name and version extracted frominfo.plist
. -
Text Table in Python
Python class to pretty-print tabluar data in a terminal.
t = Table(titles=['Name', 'Position', 'Goals']) t.add_row(['Dave Smith', 'striker', 12]) t.add_row(['Angus McGregor', 'full back', 1]) print(t)
produces:
Name | Position | Goals ---------------------------------- Dave Smith | striker | 12 Angus McGregor | full back | 1
-
Auto-swap day/night Alfred themes
Swap Alfred theme at sunrise and sunset. Goes well with f.lux and macOS's night mode.