Skip to content

Instantly share code, notes, and snippets.

View barry1955's full-sized avatar

Barry Steele barry1955

  • Sydney (near the ocean)
View GitHub Profile
anonymous
anonymous / gmailAutoarchive.js
Created January 8, 2017 16:39
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 labelled 'autoarchive'
var label = GmailApp.getUserLabelByName("autoarchive");
var threads = label.getThreads(0, 400);
@timtyrrell
timtyrrell / gist:0640d02bd08cd54f739a
Created April 30, 2015 16:39
Simple re-format for minified Javascript for VIM
" Simple re-format for minified Javascript
command! UnMinify call UnMinify()
function! UnMinify()
%s/{\ze[^\r\n]/{\r/g
%s/){/) {/g
%s/};\?\ze[^\r\n]/\0\r/g
%s/;\ze[^\r\n]/;\r/g
%s/[^\s]\zs[=&|]\+\ze[^\s]/ \0 /g
normal ggVG=
endfunction