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 NEW_CHARMAP = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20!\"#$%&'{([])}*+-.\\/0123456789:;,<=>?@EeAaUuOoIiFfGgHhJjLl|WwMmNnBbDdTtPpQqRrKkCcSsZzVvXxYy^_`~"; | |
function get_new_char_code(old_char_code){ | |
return NEW_CHARMAP.indexOf(String.fromCharCode(old_char_code)); | |
} | |
function get_old_char_code(new_char_code){ | |
return NEW_CHARMAP.charCodeAt(new_char_code); | |
} | |
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
// Credit to Michal Mocny (https://twitter.com/mmocny) | |
// | |
// Copy and paste this into the console and click around to see all interactions, whether they would pass INP, | |
// and if you expand the entry you'll see the debug breakdown information. | |
// | |
// This is basically the same as the Core Web Vitals extension does: https://web.dev/debug-cwvs-with-web-vitals-extension/ | |
const valueToRating = (score) => score <= 200 ? 'good' : score <= 500 ? 'needs-improvement' : 'poor'; | |
const COLOR_GOOD = '#0CCE6A'; |
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
// Credit to Michal Mocny (https://twitter.com/mmocny) | |
let worstInp = 0; | |
const observer = new PerformanceObserver((list, obs, options) => { | |
for (let entry of list.getEntries()) { | |
if (!entry.interactionId) continue; | |
entry.renderTime = entry.startTime + entry.duration; | |
worstInp = Math.max(entry.duration, worstInp); | |
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 i = document.querySelector('input.waterfall-transparency'); | |
let up = true; | |
i.value = parseFloat(i.min); | |
i.dispatchEvent(new Event('change')); | |
function animate() { | |
const curr = parseFloat(i.value); | |
const max = parseFloat(i.max); | |
const min = parseFloat(i.min); | |
const step = parseFloat(i.step); | |
i.value = up ? curr + step : curr - step; |
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
#! /usr/bin/env ruby | |
require 'time' | |
def usage | |
puts "USAGE: ./record-timelapse every 10 displays 1,2" | |
end | |
if ARGV[0] != "every" || ARGV[2] != "displays" | |
usage |
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
// This script checks if a page is bfcache eligible and prints reasons if it isn't. | |
// It can be easily modified to check multiple pages. | |
// Chrome crbug: https://bugs.chromium.org/p/chromium/issues/detail?id=1312486 | |
// Puppeteer issue: https://github.com/puppeteer/puppeteer/issues/8182 | |
const puppeteer = require('puppeteer'); | |
(async () => { | |
// Configuring and launching the browser |
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
/* | |
* Mando pasadiapositivas (siguiente y anterior) por | |
* bluetooth, usando dos botones del Lolin32 (ESP32) | |
*/ | |
#include <Bounce2.h> | |
#include <BleKeyboard.h> | |
#define PREV_GPIO 4 | |
#define NEXT_GPIO 23 |
Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.
Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.
The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.
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 INDEX: u8 = 0x0; | |
const RUN_8: u8 = 0x40; | |
const RUN_16: u8 = 0x60; | |
const DIFF_8: u8 = 0x80; | |
const DIFF_16: u8 = 0xc0; | |
const DIFF_24: u8 = 0xe0; | |
const COLOR: u8 = 0xf0; | |
const MASK_2: u8 = 0xc0; | |
const MASK_3: u8 = 0xe0; |
NewerOlder