Skip to content

Instantly share code, notes, and snippets.

View crizzo's full-sized avatar

christopher rizzo crizzo

View GitHub Profile
--
-- open currently active Chrome tab with Safari
-- forked from https://gist.github.com/3151932 and https://gist.github.com/3153606
--
property theURL : ""
tell application "Google Chrome"
set theURL to URL of active tab of window 0
end tell
if appIsRunning("Safari") then
import urllib2, urlparse, sys, webbrowser
itags = {'45': 'webm_720p',
'44': 'webm_480p',
'43': 'webm_360p',
'38': 'mp4_3072p',
'37': 'mp4_1080p',
'36': 'phone_mp4_240p',
'35': 'flv_480p',
'34': 'flv_360p',
@crizzo
crizzo / main.py
Created March 3, 2013 04:15 — forked from brettkelly/main.py
def shareSingleNote(authToken, noteStore, userStore, noteGuid, shardId=None):
"""
Share a single note and return the public URL for the note
"""
if not shardId:
shardId = getUserShardId(authToken, userStore)
if not shardId:
raise SystemExit
try:
# Simple installer script for using the Evernote SDK in Pythonista
#
# This script should be run from the root directory. In order to keep things
# tidy, it installs the module and all its dependencies in a directory named
# 'evernote-sdk'. In order to be able to import it, you have to add that to
# your import path, like this:
#
# import sys
# sys.path.append('evernote-sdk')
#
import urllib2, urlparse, sys, webbrowser
itags = {'45': 'webm_720p',
'44': 'webm_480p',
'43': 'webm_360p',
'38': 'mp4_3072p',
'37': 'mp4_1080p',
'36': 'phone_mp4_240p',
'35': 'flv_480p',
'34': 'flv_360p',
@crizzo
crizzo / rss-subscribers.sh
Created September 25, 2012 17:06
Bash script to parse Apache log for a count of RSS subscribers and email it to you
#!/bin/bash
# Schedule this to run once a day with cron. Doesn't matter what time since it parses yesterday's hits (by default).
# I only tested this on the Marco.org server, which runs CentOS (RHEL). No idea how it'll work on other distributions, but it's pretty basic.
# Required variables:
RSS_URI="/rss"
MAIL_TO="your@email.com"
LOG_FILE="/var/log/httpd/access_log"
@crizzo
crizzo / MailNotifier.applescript
Created February 4, 2012 01:42 — forked from founddrama/MailNotifier.applescript
MailNotifier: for when GrowlMail is overkill
tell application "GrowlHelperApp"
set the allNotificationsList to {"MailNotify"}
set the enabledNotificationsList to {"MailNotify"}
register as application "MailNotifier" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Mail"
end tell
using terms from application "Mail"
on perform mail action with messages theSelectedMessages for rule theRule
repeat with i from 1 to count theSelectedMessages
-- Process the current message
@crizzo
crizzo / Romnitizer
Created January 25, 2012 01:13 — forked from stigsfoot/Romnitizer
How long does it take for Romney to earn what you do in a year
function getDate(time_in_seconds) {
var years = Math.floor(time_in_seconds / (365 * 24 * 60 * 60));
time_in_seconds = time_in_seconds - (years * 365 * 24 * 60 * 60);
var months = Math.floor(time_in_seconds / ((365/12) * 24 * 60 * 60));
time_in_seconds = time_in_seconds - (months * (365/12) * 24 * 60 * 60);
//var months = 0;
var days = Math.floor(time_in_seconds / (24 * 60 * 60));
time_in_seconds = time_in_seconds - (days * 24 * 60 * 60);
var hours = Math.floor(time_in_seconds / (60 * 60));
@crizzo
crizzo / spotify-ichat.sh
Created December 7, 2011 15:13 — forked from damog/spotify-ichat.sh
Spotify to iChat and Adium statuses
#!/bin/bash
# shamelessly taken from: http://webcache.googleusercontent.com/search?q=cache:aUG0MH-OLaEJ:codesnippets.joyent.com/posts/show/1954+spotify+ichat&cd=1&hl=en&ct=clnk&gl=us&source=www.google.com
# messages have this format:
# 'Mon Jul 5 13:25:05 azeef-macbook GrowlHelperApp[46245] <Warning>: Spotify: Do the Buildings and Cops Make You Smile? (Bedroom Walls\nThe 4400) - Priority 0'
# which this script extracts as:
# 'Spotify: Do the Buildings and Cops Make You Smile? (Bedroom Walls'
# 'The 4400)'
# or (a little more abstract):