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
-- Before we do anything, see if there's even an instance | |
-- of Safari running. | |
tell application "System Events" | |
set numSafari to count (every process whose name is "Safari") | |
end tell | |
if numSafari > 0 then | |
tell application "Safari" | |
set currentTab to current tab of front window | |
set theUrl to URL of currentTab |
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
-- Before we do anything, see if there's even an instance | |
-- of Safari running. | |
tell application "System Events" | |
set numSafari to count (every process whose name is "Safari") | |
end tell | |
if numSafari > 0 then | |
tell application "Safari" | |
set currentTab to current tab of front window | |
set theUrl to URL of currentTab |
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
-- Before we do anything, see if there's even an instance | |
-- of Chrome running. | |
tell application "System Events" | |
set numChrome to count (every process whose name is "Google Chrome") | |
end tell | |
if numChrome > 0 then | |
tell application "Google Chrome" | |
set frontIndex to active tab index of front window | |
set theUrl to URL of tab frontIndex of front window |
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
-- Before we do anything, see if there's even an instance | |
-- of Firefox running. | |
tell application "System Events" | |
set numFF to count (every process whose name is "Firefox") | |
end tell | |
if numFF > 0 then | |
-- Since we have to go over to Firefox to get the info we need, collect | |
-- the name of the current application (so we can return to it). | |
tell application "System Events" |
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
# For the Media Center, use WAN DNS (i.e., Comcast). | |
# ############################################################# | |
iptables -t nat -A PREROUTING -i br0 -s media-center.phil.lan -p tcp --dport 53 -j DNAT --to $(nvram get wan_get_dns | awk -F' ' '{print $1}') | |
iptables -t nat -A PREROUTING -i br0 -s media-center.phil.lan -p udp --dport 53 -j DNAT --to $(nvram get wan_get_dns | awk -F' ' '{print $1}') | |
# For the PS3, use WAN DNS (i.e., Comcast). | |
# ############################################################# | |
iptables -t nat -A PREROUTING -i br0 -s ps3.phil.lan -p tcp --dport 53 -j DNAT --to $(nvram get wan_get_dns | awk -F' ' '{print $1}') | |
iptables -t nat -A PREROUTING -i br0 -s ps3.phil.lan -p udp --dport 53 -j DNAT --to $(nvram get wan_get_dns | awk -F' ' '{print $1}') |
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
tell application "Evernote" | |
set td_email to "[email protected]" | |
set tag_toSend to "toodledo" | |
set tag_complete to "toodledo-complete" | |
set en_notes to find notes "tag:" & tag_toSend & " todo:false" | |
repeat with en_note in en_notes | |
set the_ENML to get ENML content of en_note |
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 -wKU | |
# -*- coding: utf-8 -*- | |
#------------------------------------------------------------------------------------------------------------- | |
# Markdown to Evernote (Modified) | |
# | |
# A modification of Tim Lockridge's Markdown to Evernote Textmate bundle that allows for Evernote checkboxes | |
# to be interpreted correctly. | |
# | |
# Markdown to Evernote copyright Tim Lockridge 2014 <http://timlockridge.com> |
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
tell application "Evernote" | |
activate | |
create note from file theFile notebook {"Personal"} tags {"receipt/statement"} | |
end tell |
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
bp () { | |
if [ "$#" -ne 0 ] || [ "$1" = "-h" ] || [ "$1" = "–help" ] | |
then | |
echo "Usage: $0" >&2 | |
return 1 | |
fi | |
# Fill these out with values you like. | |
local tag_string=“draft” | |
local notebook=“Sentinote” |
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
on hazelProcessFile(theFile) | |
set p to POSIX path of theFile | |
set l to paragraphs of (do shell script "grep '\[ x \]' " & quoted form of p) | |
tell application "OmniFocus" to tell document 1 | |
repeat with v in l | |
set taskName to (do shell script "n="" & v & ""; echo ${n:6}") | |
set taskNote to "Created from nvALT: nvalt://find/" & my encode_text(my remove_extension(my basename(p)), true, false) | |
make new inbox task with properties {name:taskName, note:taskNote} | |
end repeat |