This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------- | |
// --- GLOBAL CONFIGURATION --- | |
// ---------------------------- | |
// Define the list of Gmail folders (labels) to be cleaned. | |
// These names must exactly match your Gmail labels (e.g., "Trash", "Spam", "My Custom Label"). | |
// To specify a custom label that is nested under another custom label in Gmail, you use a | |
// forward slash '/' as a separator, just like you would see it displayed in the Gmail web interface. | |
// | |
// For example, if you have: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Trigger function that updates just one cell 'MySheet:$A$1`. | |
// | |
// Why? So that it triggers a refresh! | |
// | |
// How? Thats the fun part, if you add dependent cells to a | |
// user formula it causes a refresh. | |
// | |
// You can tell the spreadsheet which cells the function is | |
// dependent on by passing them to the formula at the end of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Utility function to remove empty values from an array | |
* | |
* @param {array} arr - The array to clean. | |
* | |
* @return {array} - An array with no empty values. | |
**/ | |
function removeEmptyCells(arr) { | |
return arr.filter(v => v && v != "") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Helper function that retrieves the JSON data from google finance | |
// and handles all the error processing involved. | |
// | |
function getYahooF(symbol, range="1d") { | |
const baseUrl = "https://query1.finance.yahoo.com/v8/finance/chart/"; | |
const maxRetries = 5; // Maximum number of retry attempts | |
let attempt = 0; | |
while (attempt < maxRetries) { |