Skip to content

Instantly share code, notes, and snippets.

View nateswart's full-sized avatar

nateswart nateswart

View GitHub Profile
-- Globals
global books_db
global annotations_db
-- Customize for your machine
set books_db to "~/Library/Containers/com.apple.iBooksX/Data/Documents/BKLibrary/BKLibrary-1-091020131601.sqlite"
set annotations_db to "~/Library/Containers/com.apple.iBooksX/Data/Documents/AEAnnotation/AEAnnotation_v10312011_1727_local.sqlite"
-------------------------------------------------------
set as_tid to AppleScript's text item delimiters
#!/usr/bin/env ruby
# Get passed in arguments
projectName = ARGV[0]
drupalVersion = ARGV[1]
vmRepo = 'https://github.com/geerlingguy/drupal-vm.git'
baseDirectory = '/#{Dir.home}/Sites/'
vmDirectory = baseDirectory + projectName + '_vm/'
@nateswart
nateswart / gist:9611571
Last active August 29, 2015 13:57
Alfred work-flow "Rest"
tell application "Messages"
log out service "<work-account1>"
log out service "<work-account2>"
end tell
tell application "Mail"
set enabled of account "<work-account>" to false
end tell
tell application "OmniFocus"
@nateswart
nateswart / gist:9611551
Last active August 29, 2015 13:57
Alfred workflow "Work"
tell application "Messages"
log in service "<work-account1>"
log in service "<work-account2>"
end tell
tell application "Mail"
set enabled of account "<work-account>" to true
end tell
tell application "OmniFocus"
#!/usr/bin/osascript
on run
tell application "Reminders"
set theList to "Automation"
repeat with i from 1 to (count of every reminder of list theList)
set theReminder to reminder i of list theList
set reminderName to the name of theReminder
set reminderId to the id of theReminder
if theReminder is not completed then
tell application "Finder" to get folder of (path to me) as Unicode text
@nateswart
nateswart / com.nateofnine.FlaggedEmailToReminder.plist
Created January 9, 2014 03:54
plist to run this AppleScript every minute via launchd
<?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>Disabled</key>
<false/>
<key>Label</key>
<string>com.nateofnine.FlaggedMailToReminders</string>
<key>Program</key>
<string>/usr/bin/osascript</string>
@nateswart
nateswart / flagged_email_to_reminders.scpt
Last active April 2, 2020 22:43
Create Reminders tasks from flagged emails in Mail.app on OSX Mavericks using Gmail accounts.
#!/usr/bin/osascript
on run
-- This script is designed to work with Gmail and OSX Mavericks
-- Make sure Mail.app is actually running
if not (application "Mail" is running) then
return
end if
@nateswart
nateswart / refresh_blog.lcp
Created January 7, 2014 19:33
Launch center pro action to kick off refresh blog action
drafts://x-callback-url/create?text=%23Automation%0A
Refresh%20blog&action=&x-success=launchpro:&key=xxx
@nateswart
nateswart / refresh_blog.scpt
Created January 7, 2014 18:40
Refresh a Jekyll blog and rsync it
tell application "Terminal"
activate
do script "cd YOUR_JEKYLL_DIR && jekyll build && rsync -avzr --delete YOUR_JEKYLL_DIR/_site/ -e ssh YOUR_USER@YOUR_SERVER:/PATH_TO_WEB_ROOT/ && exit"
end tell