Skip to content

Instantly share code, notes, and snippets.

@dfkoz
dfkoz / gist:5860786
Last active June 30, 2023 12:49
The Honeymailer sends a random photo from Google Drive at a preset interval.
// HOW TO USE THIS SCRIPT:
// 0. Upload your photos to Google Drive.
// 1. Log into Google Drive, and click CREATE -> Script -> Blank Project.
// 2. Delete all of the default code, and paste this code into your project.
// 3. Customize the email parameters below to your liking (note that the quotes around each line are very important.)
// 4. Test the script by selecting Run -> sendRandomPic. You should receive an email with a random picture.
// 5. Click Resources -> Current Project's Triggers, and set up the email to run as often as you would like.
// Name of the folder that contains your photos.
// Leave blank to search your top-level folder.
@mattspitz
mattspitz / gist:3988022
Created October 31, 2012 16:21
Thin-API offline example
import functools
import os
import pickle
import urllib
import urllib2
CACHE_DIR = "/tmp/cached_results"
def cache_on_disk(filename_fn):
""" Takes a function that accepts (self, args, kwargs) and converts it into a reasonable filename representing that function call. """