Skip to content

Instantly share code, notes, and snippets.

View gmailAutoarchiveReaded.js
//version with unread check and nested labels
function gmailAutoarchive() {
var delayDays = 1; // will only impact emails more than 24h old
var maxDate = new Date();
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time?
// Get all the threads labelled 'label_child2'
var threads = GmailApp.search("in:inbox label:label_parent-label_child1-label_child2");
@KamiinBlack
KamiinBlack / Eyeballing-This.md
Created Oct 17, 2018 — forked from zcaceres/Eyeballing-This.md
Understanding Binding and 'this' in Javascript
View Eyeballing-This.md

How to Eyeball Your ‘This’ Context in Javascript

The early programmer struggles with the Javascript keyword this. But understanding your this context is easier than it seems.

This is all about where a function is invoked. Often, early programmers worry about where the function was declared. Perhaps the function was declared in a specific file or a particular object. Surely this changes it's this!

Nope.

To understand this, we need to see where it is invoked. Nothing else matters, with one exception which we'll cover in a moment.

You can’t perform that action at this time.