Skip to content

Instantly share code, notes, and snippets.

@tjluoma
tjluoma / com.tjluoma.KeyboardMaestroEngine.plist
Created October 30, 2012 14:34
Keep Keyboard Maestro's 'engine' (helper) alive unless you quit it
<?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>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
@tjluoma
tjluoma / com.apple.Boot.plist
Created April 2, 2012 19:46
Enable the "Apple MacBook Air SuperDrive" on any Mac
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Kernel Flags</key>
<string>mbasd=1</string>
</dict>
</plist>
@tjluoma
tjluoma / skitch-edits.html
Created September 21, 2012 13:10
Skitch 1.0.7 and preventing the Mac App Store from prompting you to upgrade to 2.0
<h1>
Stop the App Store upgrade prompt</h1>
<p>
Fortunately I saved my copy of Skitch (version 1.0.12) after hearing <a href="http://twitter.com/danielpunkass">Daniel Jalkut</a> (developer at <a href="http://www.red-sweater.com/">Red Sweater Software</a> best known for <a href="http://www.red-sweater.com/marsedit/">MarsEdit</a> and <a href="http://www.red-sweater.com/fastscripts/">FastScripts</a>) mention that a brief stint with Skitch 2.0 had sent him back to Skitch version 1.</p>
<p>
The only problem is that the Mac App Store app kept telling me that Skitch needs to be updated. I even went into my Purchases list and '&quot;hid&quot; Skitch, but still the App Store kept telling me that it wanted to update Skitch.</p>
<p>
I seem to have found a solution, which was to quit Skitch.app, and then locate the app in /Applications/ using the Finder. Once there, I control-clicked on the app and chose &quot;Show Package Contents&quot;:</p>
<p style="text-align:center">
<img alt="" border="0" height="143" src="htt
@tjluoma
tjluoma / ExportKindle.js
Last active January 26, 2021 18:27 — forked from jkubecki/ExportKindle.js
Amazon Kindle Export
// The following data should be run in the console while viewing the page https://read.amazon.com/
// It will export a CSV file called "download" which can (and should) be renamed with a .csv extension
// https://gist.github.com/jkubecki/d61d3e953ed5c8379075b5ddd8a95f22
// including change recommended by @nexnovati
// https://gist.github.com/jkubecki/d61d3e953ed5c8379075b5ddd8a95f22#gistcomment-3439531
// works as of 2021-01-26 with Google Chrome 88.0.4324.96
var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024);
getAmazonCsv = function() {
@tjluoma
tjluoma / mdpdfpagecount.sh
Created December 24, 2019 04:23
Use `mdls` on macOS to get the number of pages in PDF files
#!/usr/bin/env zsh -f
# Purpose: count PDF pages with a variety of tools
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2019-12-23
NAME="$0:t:r"
if [[ -e "$HOME/.path" ]]
@tjluoma
tjluoma / rename-files-by-filetype.sh
Created October 4, 2019 04:47
use 'file' command to make sure files have the proper (expected) extension
#!/usr/bin/env zsh -f
# Purpose: use 'file' command to make sure image files have proper extension
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2019-10-04
NAME="$0:t:r"
if [[ -e "$HOME/.path" ]]
tell application "Safari"
set vURL to URL of current tab of window 1
end tell
tell application "Google Chrome"
if windows ≠ {} then
make new tab at the end of window 1 with properties {URL:vURL}
else
make new window
set URL of (active tab of window 1) to vURL
@tjluoma
tjluoma / gist:bfb9f452b8c469e77227a674615f4f55
Created November 27, 2020 23:31
try various fixes for recent problems with Mac App Store on Mojave: “We could not complete your purchase” / “cancelled”
#!/usr/bin/env zsh -f
# Purpose: Try to get the Mac App Store on Mojave to let Mac App Store apps update without "cancelled" message
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2020-11-25
PATH='/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin'
pgrep -x 'App Store' && killall 'App Store'
#!/usr/bin/env zsh -f
# Purpose: This script will email all PDFs from one folder to a designated recipient
#
# Note: this script uses 'emate' which is a part of MailMate.app (https://freron.com)
# and assumes that the app is already properly configured to send email.
# change this to the email address you want to send the files to
MAIL_TO='admin@notreal.com'
# this is the folder where the PDFs will be sent from
@tjluoma
tjluoma / di-skypecallrecorder.sh
Last active October 10, 2020 20:12
If you customize one line in this script, it will download and install / update Skype Call Recorder.
#!/usr/bin/env zsh -f
# Purpose: Download and install the latest version of Skype Call Recorder
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2018-08-22
# you MUST customize this URL to be your URL from ECamm
# it ends with your email address (URL encoded) and a 6 digit personal code