This file contains 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
/** | |
* Returns a table of ngrams and their importance | |
* | |
* @param {"cars are the best"} textArray REQUIRED The corpus you want statistics from | |
* @param {"3"} numberOccurances OPTIONAL Show results with at least X occurrences. Default is 2 | |
* @param {"4"} numberOfWords OPTIONAL Show statistics for one to X words. Default is 5 | |
* @param {"false"} removeStopWords OPTIONAL true or false. False by default | |
* @customfunction | |
*/ |
This file contains 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
/** | |
* Substitute multiple words or characters at once | |
* @param {"@,hello,test"} params REQUIRED The words you want to remove separated by commas "," | |
* @param {"a1"} text REQUIRED The string you want to subsitute from | |
* @param {"-"} replacement OPTIONAL The replacement string. Default is blank space | |
* @return Returns combination of protocols + www subdomains | |
* @customfunction | |
*/ | |
function SUBSTITUTE_ALL(params, text,replacement) { | |
This file contains 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
//this is where you put in your api keys! | |
//serpApiKey from serpapi.com | |
//proxyCrawlToken & proxyCrawlJavascriptToken from proxycrawl.com | |
var GLOBAL_VARIABLES = { | |
serpApiKey : "", | |
proxyCrawlToken: "", | |
proxyCrawlJavascriptToken: "" | |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<script src="index.js"></script> | |
</head> | |
<body> |
This file contains 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
//note: users of this script need a valid api key from serpapi.com | |
//the key must be included in the object below as the serpApiKey value. For non-programmers, please ensure that your API is within quotes ("") | |
var GLOBAL_VARIABLES = { | |
serpApiKey: "" | |
} | |
/** | |
* Returns serpapi data for organic results |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
</head> | |
<body> | |
<div class="container"> | |
<p style="color:red;">Sorry about the email change at the last minute, Google and Gmail decided to block this message as spam, so I can't send it to you. Yeah, I'm changing providers ;)</p> | |
<p>Thanks for watching my MozCon presentation! Even though it was only 30 minutes, it took me years for me to get to this point. | |
I’m really excited to share concepts that should help you cut out boring tasks and focus on more important things.</p> |
This file contains 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
console.log([...new Set(new URL('https://www.amazon.com/SanDisk-128GB-microSDXC-Memory-Adapter/dp/B073JYC4XM/memory').pathname.toLowerCase().split(/-|\//gi).filter(Boolean))]) | |
//output handles dupes for casing and removes falsy values | |
//[ 'sandisk','128gb','microsdxc','memory','adapter','dp','b073jyc4xm' ] | |
This file contains 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
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(",") | |
This file contains 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
"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 = []; |
This file contains 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
//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(); |
OlderNewer