View asciiify-the-canvas.js
// works great on about:dino | |
// 1. save this file to your snippets. | |
// 2. load about:dino | |
// 3. evaluate the snippet | |
// 4. hit up arrow to trigger the game. | |
// 5. profit | |
(function() { | |
perfnow = performance.now; |
View localhost_2018-03-12_17-55-45.lighthouse.report.json
{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3358.0 Safari/537.36","environment":{"networkUserAgent":"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36(KHTML, like Gecko) Chrome/66.0.3359.30 Mobile Safari/537.36","hostUserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3358.0 Safari/537.36","benchmarkIndex":1000},"lighthouseVersion":"4.3.1","fetchTime":"2018-03-13T00:55:45.840Z","requestedUrl":"http://localhost:10200/dobetterweb/dbw_tester.html","finalUrl":"http://localhost:10200/dobetterweb/dbw_tester.html","runWarnings":[],"audits":{"is-on-https":{"id":"is-on-https","title":"Does not use HTTPS","description":"All sites should be protected with HTTPS, even ones that don't handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and man |
View thing.js
document.body.innerHTML = 'Paste or drop items onto this page. View results in console.'; | |
function getPayload(item) { | |
const kind = item.kind; | |
switch (kind) { | |
case 'string': return new Promise(res => item.getAsString(res)); | |
case 'file': return Promise.resolve(item.getAsFile()); | |
default: throw new Error('unknown item kind! ' + kind); | |
} |
View generate_report.js
'use strict'; | |
/* eslint-disable */ | |
const fs = require('fs'); | |
const path = require('path'); | |
const ReportGenerator = require('../../lighthouse-core/report/report-generator'); | |
const jsonPath = __dirname + '/../_json/'; |
View eqt.js
// Expected Queueing Time | |
// https://docs.google.com/document/d/1Vgu7-R84Ym3lbfTRi98vpdspRr1UwORB4UV-p9K1FF0/edit | |
// Initial impl by Nicolás Peña (npm), Tim Dresser (tdresser) | |
// Usage: | |
// var eqt = EQT.begin(); | |
// // ... | |
// const {expectedQueueingTime} = EQT.end(); | |
class EQT { | |
constructor() { |
View genesis_public_key
0459bbe48fa3e4591000459ccc8f6a6e0b046f51acbfacd862e9d402b5379d3ff00a6569b94f838772e0362eba4af38f9a856d177b9b8f936615f21cc5607a803e |
View log-the-datatransfer-data.js
document.body.innerHTML = 'Paste or drop items onto this page. View results in console.'; | |
function getPayload(item) { | |
const kind = item.kind; | |
switch (kind) { | |
case 'string': return new Promise(res => item.getAsString(res)); | |
case 'file': return Promise.resolve(item.getAsFile()); | |
default: throw new Error('unknown item kind! ' + kind); | |
} |
View coverage.js
'use strict'; | |
const chromeLauncher = require('chrome-launcher'); | |
const CDP = require('chrome-remote-interface'); | |
const launchChrome = () => | |
chromeLauncher.launch({ | |
chromeFlags: ['--disable-gpu', '--headless'] | |
}); |
View install_mosh_locally.sh
#!/bin/bash | |
# 2017-06 (paulirish): updated for latest sources | |
# and incorporated fixes from my comments here: https://gist.github.com/xiaom/8264691#gistcomment-1648455 | |
# 2015-ish (zmil): this script does absolutely ZERO error checking. however, it worked | |
# for me on a RHEL 6.3 machine on 2012-08-08. clearly, the version numbers | |
# and/or URLs should be made variables. cheers, zmil...@cs.wisc.edu | |
set -x |
View server-timing-demo.js
// see for screenshot: | |
// https://twitter.com/paul_irish/status/829090506084749312 | |
const http = require('http'); | |
function requestHandler(request, response) { | |
const headers = { | |
'Server-Timing': ` | |
sql-1;desc="MySQL lookup Server";dur=100, | |
sql-2;dur=900;desc="MySQL shard Server #1", |
NewerOlder