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 getLastResource(time, regex) { | |
let entries = performance.getEntriesByType('resource') | |
let last = null; | |
for(let i = 0; i < entries.length; i++) { | |
let e = entries[i]; | |
if(regex && !e.name.match(regex)) continue; | |
if(e.responseEnd < time) last = e; | |
} | |
return last; | |
} |
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
const puppeteer = require('puppeteer'); | |
const { createCanvas, loadImage } = require('canvas') | |
const mustache = require('mustache') | |
var fs = require('fs'); | |
const fsExtra = require('fs-extra') | |
let MAX_URLS = 50; | |
let TEMPLATE = fs.readFileSync('template.html', 'utf8'); |
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
let po = new PerformanceObserver((list) => { | |
for (const entry of list.getEntries()) { | |
console.log(entry); | |
} | |
}); | |
po.observe({type: 'layout-shift', buffered: true}); | |
let po2 = new PerformanceObserver((list) => { | |
for (const entry of list.getEntries()) { |
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
const puppeteer = require('puppeteer'); | |
const devices = require('puppeteer/DeviceDescriptors'); | |
var fs = require('fs'); | |
const mergeImg = require('merge-img'); | |
const ampToolboxCacheUrl = require('amp-toolbox-cache-url').createCacheUrl; | |
const Good3G = { | |
'offline': false, | |
'downloadThroughput': 1.5 * 1024 * 1024 / 8, | |
'uploadThroughput': 750 * 1024 / 8, |
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
const puppeteer = require('puppeteer'); | |
const devices = require('puppeteer/DeviceDescriptors'); | |
var fs = require('fs'); | |
const mergeImg = require('merge-img'); | |
const ampToolboxCacheUrl = require('amp-toolbox-cache-url').createCacheUrl; | |
const Good3G = { | |
'offline': false, | |
'downloadThroughput': 1.5 * 1024 * 1024 / 8, | |
'uploadThroughput': 750 * 1024 / 8, |
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
const puppeteer = require('puppeteer'); | |
const devices = require('puppeteer/DeviceDescriptors'); | |
const Good3G = { | |
'offline': false, | |
'downloadThroughput': 1.5 * 1024 * 1024 / 8, | |
'uploadThroughput': 750 * 1024 / 8, | |
'latency': 40 | |
}; | |
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
#include <WiFi.h> | |
#include <ArduinoJson.h> | |
#include <HTTPClient.h> | |
#include <FastLED.h> | |
// Adjust these as you see need | |
const char* ssid = ""; | |
const char* password = ""; | |
const String URL = "https://www.spiegel.de"; | |
const String targetMetric = "first-contentful-paint"; |
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
// Idea and some code stemming from https://michaljanaszek.com/blog/test-website-performance-with-puppeteer#cacheAndServiceWorker | |
const puppeteer = require('puppeteer'); | |
const devices = require('puppeteer/DeviceDescriptors'); | |
const {URL} = require('url'); | |
var fs = require('fs'); | |
var sw_scope; | |
let NETWORK_PRESETS = { | |
'GPRS': { | |
'offline': false, |
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
#include <WiFi.h> | |
#include <M5StickC.h> | |
int team = 0; | |
String teamnames[2] = { "Human", "Zombie"}; | |
int zombieTeam = 1; | |
int humanTeam = 0; | |
int colors[2] = { GREEN, RED}; | |
int hideTime = 30; // in seconds |
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
const puppeteer = require('puppeteer'); | |
const devices = require('puppeteer/DeviceDescriptors'); | |
const Good3G = { | |
'offline': false, | |
'downloadThroughput': 1.5 * 1024 * 1024 / 8, | |
'uploadThroughput': 750 * 1024 / 8, | |
'latency': 40 | |
}; | |