Skip to content

Instantly share code, notes, and snippets.

View dsottimano's full-sized avatar

Dave dsottimano

View GitHub Profile
@dsottimano
dsottimano / gist:20a50daded2128b4c86acb430cecba67
Created November 3, 2019 10:01
Google slides - change font for every slide using apps script
//script adapted by @dsottimano
//original from: https://stackoverflow.com/questions/52569689/clear-text-formatting-in-slides-using-apps-script
//credit to https://stackoverflow.com/users/7108653/tanaike
function onOpen() {
SlidesApp.getUi()
.createMenu('Custom Menu')
.addItem('Change Master Font', 'changeFont')
.addToUi();
@dsottimano
dsottimano / gist:e3e6294f80cb1cbb526d1defed322850
Last active January 5, 2024 20:01
Tech seo boost 2019 - Dave Sottimano - Apps script demo
//serpApiKey from serpapi.com
var GLOBAL_VARIABLES = {
serpApiKey : "add your api key"
}
/*
/***************************
/BEGIN PRESENTATION SCRIPTS
@dsottimano
dsottimano / gist:b7432b226187a953734c318db3742fa1
Last active May 23, 2023 18:10
URL Parser for Apps Script
//functions to parse URLs adapted for easy usage in apps script
//past the code below in the tools > script editor of any google sheet
//call the PARSE_URI() formula directly from a cell
// PARSE_URI 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
//adapted for apps script by @dsottimano
// ==UserScript==
// @name seo
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include https://*
// @include http://*
// @grant GM_addStyle
// @grant GM_notification
WITH calendar AS (
SELECT
date,
EXTRACT(DAYOFWEEK FROM date) day_of_week,
EXTRACT(MONTH FROM date) month,
EXTRACT(YEAR FROM date) year
FROM UNNEST(GENERATE_DATE_ARRAY('2000-01-01', '2020-12-31')) AS date
),
date_spine AS (
SELECT * FROM calendar
/**
* Recursively deletes specified keys from an object and its nested objects.
* @param {object} obj - The object to delete keys from.
* @param {string[]} keysToDelete - An array of keys to delete.
*/
function deleteKeysRecursive(obj, keysToDelete) {
for (let key in obj) {
if (keysToDelete.includes(key)) {
delete obj[key];
} else if (typeof obj[key] === 'object') {
def parsepath(string):
try:
string = str(string)
if string[0] == "/":
country = ''
language = ''
category = ''
category_flag = False
split_string = string.split("/")
@dsottimano
dsottimano / 30 second beat code
Last active September 3, 2020 04:19
Beating the apps script custom function 30 second time limit. Alpha? Beta? :P
//David Sottimano
//@dsottimano on Twitter for feedback please!
//lets set up our queue runner to run every 1 minutes
function onOpen() {
ScriptApp.newTrigger('queueRunner')
.timeBased()
.everyMinutes(1)
.create();
"use strict";
let exports = {}
Object.defineProperty(exports, "__esModule", { value: true });
class CPT {
constructor() {
this.alphabet = new Set();
this.root = new PredictionTree();
this.II = {};
this.LT = {};
this.data = [];
function REMOVE_SPECIFIC_QUERY(url,queriesToRemove) {
try {
if (!url) return "Error: Missing parameter. To Fix: Ensure you have both parameters set";
if (url.map) url.map(u=> REMOVE_QUERY(u))
else {
let result = "?hello=hi&ga=123"
//if (!result.includes("&")) return url.replace("?" + result,"");
result = result.split("&")
queriesToRemove = queriesToRemove.split(",")