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/python | |
import sqlite3 | |
import os | |
import sys | |
from applescript import asrun | |
from subprocess import Popen, PIPE | |
import shutil | |
import requests | |
import json |
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/python | |
from icalendar import Calendar | |
import sys | |
import copy | |
from datetime import timedelta | |
for ics in sys.argv[1:]: | |
# Open the ics file and extract the event and alarm. | |
cal = Calendar.from_ical(open(ics).read()) |
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/python | |
from plistlib import readPlist | |
from os import environ | |
from cgi import escape | |
# OPML template with header and footer. | |
opml = '''<?xml version="1.0"?> | |
<opml version="1.1"> | |
<head> |
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
set remindersOpen to application "Reminders" is running | |
set monthAgo to (current date) - (30 * days) | |
tell application "Reminders" | |
set myLists to name of every list | |
repeat with thisList in myLists | |
tell list thisList | |
delete (every reminder whose completion date is less than monthAgo) | |
end tell | |
end repeat |
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
#!/bin/bash | |
# Toggle the visibility of Desktop icons. | |
# Desktop icons are visible if the CreateDesktop setting is missing or | |
# if it exists and is set to 1, true, yes, or on (case insensitive). | |
# Desktop icons are hidden if the CreateDesktop setting exists and | |
# is set to any value other than 1, true, yes, or on. | |
# The $icons variable is the value of CreateDesktop if it exists or is |
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 python | |
# coding=utf8 | |
import feedparser as fp | |
import time | |
from datetime import datetime, timedelta | |
import pytz | |
subscriptions = [ | |
'http://1.usa.gov/1O9yJFp', |
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 python | |
# coding=utf8 | |
import feedparser as fp | |
import time | |
from datetime import datetime, timedelta | |
import pytz | |
subscriptions = [ | |
'http://feedpress.me/512pixels', |
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
var oneday = 60*60*24*1000; | |
var today = new Date(); | |
var wToday = today.getDay(); | |
var away = 1 - wToday; | |
if (away <= 0) { away += 7; } | |
var nextMonday = new Date(today.getTime() + away*oneday ) | |
var theFriday = new Date(nextMonday.getTime() + 4*oneday) | |
nextMonday.toDateString() + ' to ' + theFriday.toDateString(); |
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
set myTag to "thingy" | |
tell application "Safari" to set theURL to the URL of the front document | |
set cmd to "echo '" & theURL & "' | perl -pe 's#^.*/(?:dp|gp/product)/([^/?]+).*$#$1#'" | |
set itemID to do shell script cmd | |
set aLink to "http://www.amazon.com/gp/product/" & itemID & "?tag=" & myTag |
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
import Image | |
import photos, speech, console | |
speech.say('left image?', '', .18) | |
s1 = photos.pick_image() | |
speech.say('right image?', '', .18) | |
s2 = photos.pick_image() | |
w = s1.size[0] + s2.size[0] + 60 | |
h = max(s1.size[1], s2.size[1]) + 40 |
NewerOlder