Skip to content

Instantly share code, notes, and snippets.

<?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>Label</key>
<string>com.tjluoma.print-three-things</string>
<key>Program</key>
<string>/usr/local/bin/print-three-things.sh</string>
<key>RunAtLoad</key>
<false/>
@tjluoma
tjluoma / print-three-things.sh
Created February 6, 2015 17:17
Converts a given Markdown file to a PDF and then prints it
#!/bin/zsh -f
# Purpose: Convert a Markdown file to a PDF and then print it
#
# From: Tj Luo.ma
# Mail: luomat at gmail dot com
# Web: http://RhymesWithDiploma.com
# Date: 2015-02-05
# This is the `basename` of the script as a variable
NAME="$0:t:r"
@tjluoma
tjluoma / sync.com.tjluoma.cleandesktop.plist
Created February 2, 2015 14:05
Be sure to change /Users/luomat/ to whatever your $HOME directory is. AppleScript from http://apple.stackexchange.com/a/71755/9226
<?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>Label</key>
<string>sync.com.tjluoma.cleandesktop</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/osascript</string>
<string>-e</string>
@tjluoma
tjluoma / FinderShowHideHiddenFiles.scpt
Created February 2, 2015 12:43
This method of showing/hiding Finder files does _not_ require the Finder to be restarted. It was copied directly from http://apple.stackexchange.com/a/168544/9226
-- copied directly from http://apple.stackexchange.com/a/168544/9226
set newHiddenVisiblesState to "YES"
try
set oldHiddenVisiblesState to do shell script "defaults read com.apple.finder AppleShowAllFiles"
if oldHiddenVisiblesState is in {"1", "YES"} then
set newHiddenVisiblesState to "NO"
end if
end try
do shell script "defaults write com.apple.finder AppleShowAllFiles " & newHiddenVisiblesState
@tjluoma
tjluoma / btmm.sh
Created December 4, 2014 01:42
If you use Back To My Mac on your Mac, then you are assigned a unique domain name such as "987654321.members.btmm.icloud.com." That domain is only usable on other Macs which are connected to the same iCloud account. In order to find your BTMM domain, you can use the following commands:
# On the command line (note the single \ before the $NF)
echo show Setup:/Network/BackToMyMac | scutil | awk -F' ' "/$UID/{print \$NF}"
alias btmm='echo show Setup:/Network/BackToMyMac | scutil | awk -F" " "/$UID/{print \$NF}"'
function btmm { echo show Setup:/Network/BackToMyMac | scutil | awk -F" " "/$UID/{print \$NF}" }
BTMM=$(echo show Setup:/Network/BackToMyMac | scutil | awk -F' ' "/$UID/{print \$NF}")
@tjluoma
tjluoma / m2db-notify.sh
Last active August 29, 2015 14:09 — forked from anonymous/m2db-notify.sh
"Move To Dropbox" Notifier. Intended to be used as part of a Service for OS X
FILES="$@"
FILES=`echo "${FILES}" | sed "s#${HOME}/Dropbox/##g"`
COUNT="$#"
if [ "${COUNT}" = "1" ]
then
@tjluoma
tjluoma / com.tjluoma.omnifocus.RemindersImport.plist
Created November 5, 2014 03:59
launchd plist to be used with https://github.com/danielpunkass/RemindersImport. Assumes: 1) /usr/local/bin/RemindersImport is the correct path; 2) your Reminders.app reminders list is "My Reminders List" (edit to suit you). be sure to change "/Users/luomat/" to the proper path to your "/Users/shortname" on your Mac!
<?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>Label</key>
<string>com.tjluoma.omnifocus.RemindersImport</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/RemindersImport</string>
<string>My Reminders List</string>
@tjluoma
tjluoma / vpn-on.scpt
Created October 22, 2014 19:41
Change "VPN-Unlimited-US-Сenter" to whatever the name of your VPN connection is
tell application "System Events"
tell network preferences
set VPNservice to service "VPN-Unlimited-US-Сenter"
set isConnected to connected of current configuration of VPNservice
if not isConnected then
connect VPNservice
end if
end tell
end tell
@tjluoma
tjluoma / te-metarefresh.txt
Created October 13, 2014 13:19
TextExpander to create a basic HTML5 redirect page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>%filltext:name=TITLE:width=30%</title>
<meta http-equiv="refresh" content="%filltext:name=DELAY:default=0:width=3%;
url=%filltext:name=REDIRECT_URL:default=http:width=40%"/>
</head>
<body>
<p>
@tjluoma
tjluoma / com.tjluoma.1password-beta.plist
Created October 11, 2014 21:07
Automatically run /usr/local/bin/di-1passwordbeta.sh every 4 hours
<?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>Label</key>
<string>com.tjluoma.1password-beta</string>
<key>Program</key>
<string>/usr/local/bin/di-1passwordbeta.sh</string>
<key>RunAtLoad</key>
<true/>