Skip to content

Instantly share code, notes, and snippets.

@jlhernando
jlhernando / lazyimages_demos_test.js
Created October 1, 2019 14:47 — forked from ebidel/lazyimages_demos_test.js
Testing lazy loaded image libraries
/**
* Copyright 2018 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jlhernando
jlhernando / decode URL Apps Script
Created April 6, 2022 10:21
Decode URLs in Google Sheets creating a custom fucntion in Apps Script
/* Both these funcitons will work fine */
// As a function declaration
function DECODE(url) {
return decodeURI(url)
}
// Or as an arrow function
const DECODEURL = (url) => decodeURI(url)
@jlhernando
jlhernando / gist:81d92f444575421eeb9aadb8d464484c
Created January 11, 2024 10:49
Scraping Coverage Numbers NodeJS Playwright
// Scrape top coverage numbers
const topNum = await page
.evaluate(
([url, selector]) => {
const raw = Array.from(document.querySelectorAll(selector), (el) => Number(el.title.replace(/,/g, '')));
const lastUpdated = document.querySelector('div[jslog]').childNodes[1].textContent.trim();
const report = {
property: url,
error: 0,
warning: 0,