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
-- | |
-- 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 |
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/ruby | |
VERSION = 1.6 | |
require 'net/https' | |
require 'rubygems' | |
require 'json' | |
require 'cgi' | |
# set to true to force inline links | |
inline = false |
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 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', |
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
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: |
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
# 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') | |
# |
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 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', |
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 | |
# 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" |
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 "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 |
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
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)); |
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 | |
# 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): |
NewerOlder