Skip to content

Instantly share code, notes, and snippets.

@LorenDavie
LorenDavie / GMail Auto archive
Created March 23, 2019 14:58
for script.google.com, automatically archive non-starred, read emails in your inbox that are more than two days old
function gmailAutoarchive() {
var delayDays = 2; // will only impact emails more than 48h old
var maxDate = new Date();
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time?
// Get all the threads
var threads = GmailApp.getInboxThreads(0, 400);
// messages that are read, older than the threshold and not starred can be archived
I wonder why no one has ever thought of this before?
@LorenDavie
LorenDavie / keybase.md
Created March 7, 2014 15:18
keybase.md

Keybase proof

I hereby claim:

  • I am LorenDavie on github.
  • I am lorendavie (https://keybase.io/lorendavie) on keybase.
  • I have a public key whose fingerprint is 0557 9AEE 11CE 5778 3B43 5518 B256 88BA 4029 DFE0

To claim this, I am signing this object:

@LorenDavie
LorenDavie / gist:4145581
Created November 25, 2012 21:58
Axilent API Usage from Django
# from the whiskey engine example
# uses the Sharrock RPC client (https://github.com/Axilent/sharrock). Created by us, but open source, not specific to the Axilent API.
from sharrock.client import HttpClient, ResourceClient
# some things in the API are modeled as RESTful resources and use the ResourceClient, others are straight RPC and use the HttpClient
axl = HttpClient('%s/api' % settings.AXILENT_ENDPOINT,'axilent.content','beta3',auth_user=settings.AXILENT_API_KEY)
content_resource = ResourceClient('%s/api/resource' % settings.AXILENT_ENDPOINT,'axilent.content','beta3','content',auth_user=settings.AXILENT_API_KEY)
# Featured Whiskey