^ Matches at the start of string or start of line if multi-line mode is
enabled. Many regex implementations have multi-line mode enabled by
default.
$ Matches at the end of string or end of line if multi-line mode is enabled.
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
# Check/install brew | |
if test ! $(which brew); then | |
echo "Installing homebrew" | |
ruby -e "$(curl -fsSl https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
fi | |
brew analytics off | |
# Update homebrew recipes | |
brew update |
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
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |
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
# restart bluetoothd and bluetoothaudiod on macOS | |
sudo kill -9 `pgrep bluetooth` |
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
/* create this as /chrome/userContent.css under Firefox Profile directory */ | |
/* Enable Light/Dark Mode New Tab Background Color */ | |
@media (prefers-color-scheme: dark) { | |
@-moz-document url("about:newtab"), url("about:home") { | |
body { background-color: #222 !important;} | |
} | |
} | |
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
javascript: navigator.clipboard.writeText('https://www.google.com/calendar/event?eid=' + document.getElementById('xDetDlg').dataset.eventid); null; |
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
{/Perl | |
use strict; | |
######## | |
# input a teams join link, extract the important bits, use them to print the meeting options link | |
# {{?Join Link}} is Typinator code to ask for user input | |
######## | |
my $str = '{{?Join Link}}'; | |
my $regex = qr/(?i).+19(?::|%3a)(.+(?:@|%40)thread.+)\/(.+)\?context=%7b%22Tid%22%3a%22(.+)%22%2c%22Oid%22%3a%22(.+)%22%7d/mp; |
macOS has an annoying bug where bluetooth periodically stops working. If you're working via a BT keyboard/trackpad you are forced to wait a minute or two until it resolves on it's own.
Alternative (5 seconds): Have a cable at the ready, plugin your trackpad, restart BT via the macOS Dock.
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 ruby | |
# | |
# Script to normalise an audio file's loudness using ffmpeg | |
# | |
# Usage: normalise-loudness.rb <input.wav> <output.wav> | |
# | |
# License: https://unlicense.org/ | |
# | |
# Requires the 'json' ruby gem: | |
# |
Make a list of your current applications along with the date you last used them.
- Get the relevant metadata attributes for Applications to mimic "Date last opened" in Finder using mdls
- Convert plist xml output to json using yq
- With jq
- select just the most recent date if multiple dates
- sort the results
- ouput the app name and date to csv
OlderNewer