Skip to content

Instantly share code, notes, and snippets.

@emrecan-s
emrecan-s / Code.gs
Last active April 7, 2022 13:58 — forked from abfo/Code.gs
How to monitor page index status using the Google Search Console API and Apps Script in a Google Sheet. For instructions on how to configure this script please see https://ithoughthecamewithyou.com/post/monitor-page-index-status-with-google-sheets-apps-script-and-the-google-search-console-api
/*Steps to Run
1-) Open appscripts and than go to project settings, enable show "appsscript.json" manifest file in editor
2-)Go to Editor and open appsscript.json replace it with following
{
"timeZone": "America/New_York",
"exceptionLogging": "STACKDRIVER",
"oauthScopes": ["https://www.googleapis.com/auth/script.external_request", "https://www.googleapis.com/auth/webmasters", "https://www.googleapis.com/auth/spreadsheets.currentonly", "https://www.googleapis.com/auth/script.send_mail"],
"runtimeVersion": "V8"
}
@emrecan-s
emrecan-s / gist:d62f34f642e0cc3a4a024ae066e42641
Last active April 12, 2021 08:48
Collect CLS cumulative Layout Shift after scrolling.
//Credit https://addyosmani.com/blog/puppeteer-recipes/
const puppeteer = require('puppeteer');
const devices = puppeteer.devices
const scrollPageToBottom = require ('puppeteer-autoscroll-down')
const Good3G = {
'offline': false,
'downloadThroughput': 2 * 1024 * 1024 / 8,
@emrecan-s
emrecan-s / Check array.js
Last active February 10, 2020 23:43
Returns the smallest positive integer (greater than 0) that does not occur in Array.
//Sample Arrays
const A = [1, 3, 6, 4, 1, 2];
const B = [-1 - 10, 0, 2, 3, 5];
const C = [1, 2, 3, 500];
function solution(test) {
//Remove duplicates
let unique = [...new Set(test)];
//Sort from lowest value
let sorted = unique.sort();