Skip to content

Instantly share code, notes, and snippets.

View mkiser's full-sized avatar
💭
😱

Matt Kiser mkiser

💭
😱
View GitHub Profile
javascript:(function(){async function a(){const b=window.location.origin;console.log(`Clearing data for: ${b}`);try{localStorage.clear(),sessionStorage.clear(),console.log("Local & Session Storage cleared.")}catch(c){console.error("Error clearing Local/Session Storage:",c)}try{if(window.indexedDB){const c=await indexedDB.databases();c.forEach(d=>{indexedDB.deleteDatabase(d.name),console.log(`IndexedDB "${d.name}" deleted.`)})}}catch(c){console.error("Error clearing IndexedDB:",c)}try{if("caches"in window){const c=await caches.keys();await Promise.all(c.map(d=>caches.delete(d))),console.log("Cache Storage cleared.")}}catch(c){console.error("Error clearing Cache Storage:",c)}try{document.cookie.split("; ").forEach(c=>{const d=c.indexOf("="),e=d>-1?c.substr(0,d):c;document.cookie=e+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/"})}catch(c){console.error("Error clearing Cookies:",c)}try{if("serviceWorker"in navigator){const c=await navigator.serviceWorker.getRegistrations();await Promise.all(c.map(d=>d.unregiste
function getContextualAddOn(e) {
let card = CardService.newCardBuilder();
// Log the event object
Logger.log("Event object: " + JSON.stringify(e));
// Check if the event object has the threadId
if (e && e.gmail && e.gmail.threadId) {
let threadId = e.gmail.threadId;
@mkiser
mkiser / MailChimp User Unsubscribe Messages to CSV
Last active November 13, 2024 18:45
A Python script for pulling MailChimp unsubscribe messages and saving as a CSV.
import mailchimp_marketing as MailchimpMarketing
from mailchimp_marketing.api_client import ApiClientError
import csv
import os
try:
client = MailchimpMarketing.Client()
client.set_config({
"api_key": "XXX",
"server": "XXX"
curl --request GET \
--url 'https://<XX>.api.mailchimp.com/3.0/lists/<LIST ID>/members/?unique_email_id=<"e=XX">' \
--user 'anystring:<APIKEY>'