Skip to content

Instantly share code, notes, and snippets.

View justinribeiro's full-sized avatar
🌩️
Darkness falls.

Dr. Justin Ribeiro, Ph.D. justinribeiro

🌩️
Darkness falls.
View GitHub Profile
@justinribeiro
justinribeiro / io-schedule-2018.js
Last active April 14, 2018 19:39
Get a console list of your reserved schedule. Use as DevTools snippet. Because friends let friends know where they'll be at I/O (generally).
schedule = '';
sections = document.querySelectorAll(".schedule__grid__content");
sections.forEach(section => {
let time = '';
try {
time = section.querySelector(".schedule__grid__time").textContent;
} catch(e) {
time = section.querySelector('.schedule__grid__date');
if (time) {
@justinribeiro
justinribeiro / tasks.json
Created June 26, 2018 20:45
Running lighthouse-cli inside Visual Studio Code via tasks.json.
{
// Some basic lighthouse testing using docker, lighthouse-cli, jq, tr Note,
// you must search/replace the test url (no var support in tasks.json
// currently)
"version": "2.0.0",
"tasks": [
// NOTE: you don't have to run the container to make this work, you can
// simply change the lighthouse commands as required below to work with your
// setup (I find the container easier)
{
{"userAgent":"Mozilla/6.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3537.0 Safari/537.36","lighthouseVersion":"3.0.3","fetchTime":"2018-08-30T19:07:45.641Z","requestedUrl":"https://ericbidelman.com/","finalUrl":"https://ericbidelman.com/","runWarnings":[],"audits":{"is-on-https":{"id":"is-on-https","title":"Uses 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 many new web platform APIs. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/https).","score":1,"scoreDisplayMode":"binary","rawValue":true,"displayValue":"","details":{"type":"table","headings":[],"items":[]}},"redirects-http":{"id":"redirects-http","title":"Redirects HTTP traffic to HTTPS","description":"If you've already set up HTTPS, make sure that you redirect all
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>A simple responsive container</title>
</head>
<body>
<responsive-container>
@justinribeiro
justinribeiro / font-report-devtools-snippet.md
Created October 18, 2019 15:43
Find font definitions of elements in a page.

Find font defintions for elements within a page with DevTools

This is simple DevTools snippt that uses TreeWalker to find textNodes, and then we parse what font styles are in use on that node with getComputedStyle.

Note, this won't travel the ShadowDOM which is it's own can of worms.

function findTextNodesFor(element){
  let node; 
  const discoveredTextNodes = [];