Skip to content

Instantly share code, notes, and snippets.

@strongriley
strongriley / emailArchiver.js
Last active February 23, 2019 16:04
Auto Archive Email
// Auto-archive email older than X days (so long as not starred)
// Inspirations:
// - https://gist.github.com/anonymous/2cca33d376f7f924fdaa67891ad098cc
// - https://medium.com/@fw3d/auto-archive-emails-in-gmail-after-2-days-1ebf0e076b1c
// NOTE: Must have autoarchive and ttl1 labels already created to use.
var MAX_AGE_DAYS = 14;
var BEFORE_DATE = new Date();
@strongriley
strongriley / export.js
Last active April 1, 2018 14:39
Export Betterment Account Balances
var search = $('h5.SummaryTable-label:contains("Balance")');
var formatDate = function(date) {
return date.toISOString().substring(0, 10);
};
var balances = search.map(function() {
var arr = $(this).parent().parent().find('.u-secondaryHeading').map(function() {
return $(this).text().trim().replace(/(Off|On) Track/, '').trim();
}).get();
var d = new Date();
if ($(this).find('span').size() > 0) {
@strongriley
strongriley / wedding.py
Created July 18, 2016 04:07
Monte Carlo Wedding Simulation
# All invites with 2 guests
%matplotlib inline
from numpy.random import binomial
from numpy import mean, std
import matplotlib.pyplot as plt
from math import sqrt, pow
trial_results = []
invited = 100
guests_per_invite = 2
probability = 0.75
@strongriley
strongriley / highlight.py
Created March 10, 2013 22:01
EAT Club Engineering Test
"""
EAT Club Highlight Programming Challenge
Author: Riley Strong <[email protected]>
Last Updated: 2013-03-09
"""
import re
import sys
import unittest
START_HIGHLIGHT = "[HIGHLIGHT]"
@strongriley
strongriley / top_four.py
Created March 8, 2013 02:01
Evernote Top Four Challenge
"""
Evernote Top Four Challenge
Author: Riley Strong <[email protected]>
Last Updated: 2013-03-07
"""
class TopValues(object):
"""
Distills a list of numbers to the top values (largest integers).