Skip to content

Instantly share code, notes, and snippets.

View prenagha's full-sized avatar

Padraic Renaghan prenagha

View GitHub Profile
@prenagha
prenagha / fake workflow.txt
Last active December 15, 2015 03:58
Google Voice Delete All History
Google Voice provides no easy way to clear your history.
Here is how I did it.
1) Get the Fake app http://fakeapp.com
It lets you write scripts to automate Safari
2) Create a workflow in Fake that has the following steps
Load URL, https://www.google.com/voice/#history
Assert Condition, page title equals : Google Voice - History
@prenagha
prenagha / Chat.applescript
Created January 7, 2014 01:58
Launchbar script to allow you to send an Adium chat message directly from within Launchbar Install: put this script in ~/Library/Application Support/Adium/Actions Invoke Launchbar type "Chat" to find this action, then space to trigger text entry, then "<contact partial name><space>chat message"
-- used via launchbar
-- im_text: contact_partial_name message
handle_string("foobar testing")
on handle_string(im_text)
-- start adium if its not running
if application "Adium" is not running then
tell application "Adium" to activate
-- wait a few seconds to let the accounts login
@prenagha
prenagha / Copy to iPhone.scpt
Last active January 5, 2025 00:39
Launchbar integration applescript for command-c http://danilo.to/command-c/
--
-- Source: Padraic Renaghan [email protected] https://gist.github.com/prenagha/8372844
--
-- launchbar integration applescript for command-c
-- http://danilo.to/command-c/
--
-- set the variable "theDevice" below as needed to the device name you want to send to
-- Put script in Launchbar actions folder
-- ~/Library/Application Support/Launchbar/Actions
--
@prenagha
prenagha / Create Gist.scpt
Created January 13, 2014 15:17
Launchbar action to create public gist
--
-- gist support for launchbar
-- 1. install gist client "sudo gem install gist"
-- https://github.com/defunkt/gist
-- 2. login "gist --login"
--
-- use from launchbar as file action, string/search action, or
-- plain action (will take text from clipboard)
-- then will put gist url as launchbar result
-- from there you can Copy it or hit Enter to open in browser
@prenagha
prenagha / Run in Terminal.scpt
Last active May 27, 2018 00:39
run terminal command and return results directly back to launchbar
--
-- run terminal command and return results directly back to launchbar
-- runs command using applescript which means under /bin/sh
-- switches to user home dir before running script
--
-- take string from LaunchBar and run as command
on handle_string(theText)
try
set cmd to "cd ~ && " & theText
@prenagha
prenagha / TimeMachineMonitor.scpt
Last active December 8, 2023 23:16
Applescript to monitor age of last time machine backup and send alert to notification center and email if too old Set it up in launchd to run daily
--
-- Applescript to monitor age of last time machine backup
-- and send alert to notification center if too old
--
set tmLatest to do shell script "/usr/bin/tmutil latestbackup"
set latest to POSIX file tmLatest
set mod_date to modification date of (info for latest)
set file_age to round (((current date) - mod_date) / days)
log "most recent TM backup " & file_age & " days old"
@prenagha
prenagha / ArqMonitor.scpt
Last active December 3, 2024 10:51
Applescript to monitor age of last arq backupand send alert to notification center and email if too oldHook it up to run via launchd daily
--
-- Applescript to monitor age of last arq backup
-- and send alert to notification center if too old
--
set arqF to (path to current user folder) & "Library:Arq:lastsV2.dat" as string
set latest to arqF as alias
set mod_date to modification date of (info for latest)
set file_age to round (((current date) - mod_date) / days)
log "most recent Arq backup " & file_age & " days old " & arqF
@prenagha
prenagha / lbdist.sh
Last active January 27, 2022 17:30
Launchbar Action package script
#!/bin/bash
#
# code sign and package each launchbar action then push
# to dropbox folder for public distribution
#
# first make sure everything is compiled
# see https://gist.github.com/prenagha/404284fee1b8ff86aec5
~/bin/compile-applescript.sh
if [ $? -ne 0 ]
@prenagha
prenagha / compile-applescript.sh
Created September 8, 2015 00:18
Compile .applescript files to .scpt files. Useful for LaunchBar actions and such.
#!/bin/bash
#
# find all launchbar action .applescript scripts and compile them
#
LBDEV=~/Dev/launchbar
find $LBDEV -type f -name '*.applescript' -print0 | while read -d '' -r APPLESCRIPT
do
echo "Compiling $APPLESCRIPT ..."
SCPT="${APPLESCRIPT%.applescript}.scpt"
/usr/bin/osacompile -o "$SCPT" "$APPLESCRIPT"
@prenagha
prenagha / version-check.js
Last active September 7, 2022 18:03
javascript version id comparison
// compare two versions, return true if local is up to date, false otherwise
// if both versions are in the form of major[.minor][.patch] then the comparison parses and compares as such
// otherwise the versions are treated as strings and normal string compare is done
var VPAT = /^\d+(\.\d+){0,2}$/;
function upToDate(local, remote) {
if (!local || !remote || local.length === 0 || remote.length === 0)
return false;
if (local == remote)