Skip to content

Instantly share code, notes, and snippets.

import os, subprocess
desc = []
c_line = "man 1 %s | col -b > /tmp/man.txt"
s_line = "cat /tmp/man.txt | sed -n -e \"/^NAME/,/^SYNOPSIS/ p\" | grep -v -e \"^[A-Z]\""
dirs = ["/usr/bin/", "/usr/sbin/"]
for dir in dirs:
    for f in os.listdir(dir):
@macolyte
macolyte / Evernote Quick Search.scpt
Created December 13, 2011 13:28
Evernote Quick Search LaunchBar Action
on handle_string(search_query)
tell application "Evernote"
open collection window with query string (search_query as text)
activate
end tell
end handle_string
@macolyte
macolyte / evernote_daily_log.scpt
Created November 30, 2011 02:33
Evernote Log LaunchBar Action
on handle_string(the_text)
set time_string to do shell script "date '+%H:%M:%S'"
set date_string to do shell script "date '+%Y-%m-%d'"
set message to "<p><b>" & time_string & "</b> | " & the_text & "</p>"
tell application "Evernote"
set matches to find notes (date_string as text) & " notebook:Log"
if (count of matches) is 1 then
set the_note to item 1 of matches
@macolyte
macolyte / chrome-image.scpt
Created November 25, 2011 18:04
Grab Amazon Cover Image - Chrome
set theURL to "http://images.amazon.com/images/P/" & (the clipboard) & ".01.LZZZZZZZ.jpg"
tell application "Google Chrome"
set URL of last tab of window 1 totheURL
end tell
@macolyte
macolyte / safari-image.scpt
Created November 25, 2011 18:02
Grab Amazon Cover Image - Safari
set theURL to "http://images.amazon.com/images/P/" & (the clipboard) & ".01.LZZZZZZZ.jpg"
tell application "Safari"
set URL of current tab to theURL
end tell
@macolyte
macolyte / import_to_evernote.scpt
Created November 15, 2011 00:12
Import files into Evernote
on open dropped_item
set file_list to items of dropped_item
repeat with a_file in file_list
tell application "Finder" to set c_date to creation date of a_file
tell application "Evernote" to create note from file a_file notebook Text_Notes created c_date
end repeat
end open
@macolyte
macolyte / get_cover_images.py
Created September 19, 2011 21:56
Batch download cover images from Amazon
#!/usr/bin/python
import shlex, subprocess
import os, os.path
import sys
import time
import argparse
FILE_NAME = 'amazon.txt'
IMAGE_PATH = '~/Documents/BookImages/'
@macolyte
macolyte / OpenInMarked.scpt
Created September 19, 2011 20:45
Open Byword markdown file in Marked
tell application "Byword"
set theDocument to file of document of window 1
end tell
tell application "Marked"
open theDocument
end tell