Skip to content

Instantly share code, notes, and snippets.

@vicke4
vicke4 / batch-process.js
Created October 7, 2020 08:34
Utility functions for Google Apps Script to prevent "Argument too large" error
/**
* Function that gets data from or sets data to the property / cache.
*
* @param {String} storage property / cache (required).
* @param {String} key to be used to get data stored in the property / cache (required).
* @param {String} scope of the storage. valid scopes - user, script, document (required).
* @param {String} dataType of the property / cache, possible values: json, bool, string (required when action is set).
* @param {String} action to be performed, get / set the property / cache (required if the action is set).
* @param {String} value if action === 'set', value to be set. (required if the action is set)
@vicke4
vicke4 / twitter-poll-result.js
Last active November 19, 2022 14:42
Bookmarklet to view Twitter poll result without voting
/**
* Used https://www.odditysoftware.com/page-webtools16.htm to remove comments and minify the code to use it as a bookmarklet
*/
(
function () {
/* Exiting if the webpage is not Twitter or a valid tweet */
if (window.location.origin !== 'https://twitter.com' || window.location.pathname.split('/').length !== 4) return alert('This is not a valid Twitter poll!');
alert('Please wait this can take up to 30 seconds. Select OK or close to get started. If this is a valid poll, you will get the result when it is ready...:)');