Skip to content

Instantly share code, notes, and snippets.

View screenspan's full-sized avatar

Brian Louis Ramirez screenspan

View GitHub Profile
document.addEventListener("DOMContentLoaded", function() {
var lazyImages = []".lazy > source"));
if ("IntersectionObserver" in window) {
console.log("IntersectionObserver is supported. Rock on!");
let lazyImageObserver = new IntersectionObserver(
function(entries, observer) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
let lazyImage =;
screenspan / webpagetest.js
Created March 9, 2020 13:16
Node script for running a test with WebPagetest and writing the results to InfluxDB and to file
// Imports
const WebPageTest = require("webpagetest");
const fs = require("fs");
var download = require("download-file"); // Install download-file
const Influx = require("influx"); // Download and install InfluxDB
const influx = new Influx.InfluxDB({
host: "localhost",
database: "webpagetest",
port: 8086