Skip to content

Instantly share code, notes, and snippets.

View bachya's full-sized avatar

Aaron Bach bachya

View GitHub Profile
@bachya
bachya / Modified Markdown to Evernote.rb
Created September 5, 2014 16:28
Modified version of Tim Lockridge's Markdown to Evernote that allows for checkboxes
#!/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>
@bachya
bachya / Evernote Checkboxes to Toodledo.scpt
Created September 5, 2014 17:25
Send Evernote checkboxes to Toodledo
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
@bachya
bachya / DD-WRT DNS Router.sh
Created September 5, 2014 17:28
iptables rules to re-route specific hosts to certain DNS servers in DD-WRT
# 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}')
@bachya
bachya / Dynamic Markdown Links from Firefox.scpt
Last active August 29, 2015 14:06
For use in TextExpander or aText. Grabs the current tab in Firefox and returns a Markdown link with the current title and URL.
@bachya
bachya / Static Markdown Links from Chrome.scpt
Last active August 29, 2015 14:06
For use in TextExpander or aText. Grabs the current tab in Chrome and returns a Markdown link with the correct URL and a prompt to enter the link text.
@bachya
bachya / Dynamic Markdown Links from Safari.scpt
Last active August 29, 2015 14:06
For use in TextExpander or aText. Grabs the current tab in Safari and returns a Markdown link with the current title and URL.
@bachya
bachya / Static Markdown Links from Safari.scpt
Last active August 29, 2015 14:06
For use in TextExpander or aText. Grabs the current tab in Safari and returns a Markdown link with the correct URL and a prompt to enter the link text.
@bachya
bachya / Static Markdown Links from Firefox.scpt
Last active August 29, 2015 14:06
For use in TextExpander or aText. Grabs the current tab in Firefox and returns a Markdown link with the correct URL and a prompt to enter the link text.
@bachya
bachya / Better Gist Shortcode.sh
Last active August 29, 2015 14:06
aText snippet that takes a gist ID or URL from the clipboard and creates a Wordpress shortcode/link pair
GIST_ID=$(echo "【clipboard】" | sed -Ee 's/https?:\/\/gist\.github\.com\/[^\/]+\///')
echo "[gist ${GIST_ID} /]" \
"<div class=\"no_js\">" \
"<a name=\"${GIST_ID}\"></a>" \
"<a href=\"#${GIST_ID}\">Click here to see the Gist.</a>" \
"</div>"
@bachya
bachya / Spillo Bookmarks to CSV.scpt
Created September 9, 2014 21:09
Exports bookmarks from Spillo into CSV format
-- Build a CSV string of all the bookmark data:
set bookmarkCsv to {"url,title,desc,date,unread,private,tagged"}
tell application "Spillo"
repeat with b in bookmarks
set theUrl to url of b
set theTitle to title of b
set theDesc to desc of b
set theDate to date of b
set unreadStatus to unread of b
set privateStatus to private of b