Skip to content

Instantly share code, notes, and snippets.

@fabianem
fabianem / Code.gs
Last active April 28, 2025 18:56
Google Apps Script to count emails by sender in batches
// Google Apps Script for counting emails by sender in batches. Stopps and resumes after 5mins of processing to avoid reaching script runtime limit.
// 1. Allow required permissions
// 2. Add gmail service to project
// 3. Fill <your-email> in `runProcessor` function and adjust query if needed
// 4. Run function `runProcessor`
// 5. Result will be saved in a new spreadsheet
// Based on ideas from https://stackoverflow.com/a/59222719/5162536 and
// https://medium.com/geekculture/bypassing-the-maximum-script-runtime-in-google-apps-script-e510aa9ae6da
@d-neri
d-neri / Code.gs
Last active May 5, 2025 15:59
Google Apps Script - Gmail count emails by sender
// Execute the "run" function below after setting up the appropriate APIs
// Original credit: https://stackoverflow.com/a/59222719/501042
function sender_list_paged(token) {
var dt = new Date().getTime();
var ss = SpreadsheetApp.create('Gmail count emails by sender ' + dt);
var sh = ss.getActiveSheet()
sh.clear();
sh.appendRow(['Email Address', 'Count']);
var token = token || null;
var query = "in:inbox is:unread";
@unrevised6419
unrevised6419 / bookmarks-to-notion.js
Last active March 26, 2025 04:06
Export bookmarks to Notion as a Database
(function bookmarksExportToCsv() {
/**
* 1. Export bookmarks from browser (supported any Chromium based browsers and Safari) (chrome://bookmarks)
* 2. Open exported html file again in the browser
* 3. Copy paste this entire file in console, and execute it (hit enter)
* 4. You will be prompted to save a CSV file. Save it.
* 5. Open Notion. Click Import -> CSV
* 6. Select saved CSV file. Wait for import
* 7. You have a new database with all your bookmarks
*/