none
(default)layout
,paint
,style
- the easy ones.content
=== these three- bonus benefit of
contain: layout
-- anypos:fixed
children will be relative to it.
size
- harder. the element must define its own size, can't rely on laying out its children.strict
===content + size
inline-size
- dunno? size but for display:inline-ish things?
This file contains hidden or 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 fish | |
# depends on FZF. also.. fish i guess. but AI could port it to zsh/bash ez. | |
# just run it and it'll prompt for application. | |
# (Trap defined lower down…) | |
# Select application and get bounds of it. | |
set -l app_list (osascript -e 'tell application "System Events" to get the name of every application process whose background only = false') | |
# commas to newlines and over to fzf for selection |
This file contains hidden or 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
// export data from miro board frames | |
// super specific to my usecase but should be adaptable if you're a JS person.. i'll leave the details to you | |
// (frame filtering, grouping and filtering items, colors into categories, etc) | |
// i run this in devtools snippets personally | |
globalThis.items = globalThis.items ?? null; | |
// thx https://github.com/jolle/miro-export | |
items = await window.miro.board.get(); |
This file contains hidden or 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
{ style: 'unit', unit: 'millisecond', unitDisplay: 'narrow' } | |
┌─────────┬───────────┬─────────────────┬─────────────────┬───────┐ | |
│ (index) │ locale │ text │ browser │ same │ | |
├─────────┼───────────┼─────────────────┼─────────────────┼───────┤ | |
│ 0 │ 'af' │ '123,5 ms.' │ '123,5 ms.' │ true │ | |
│ 1 │ 'am' │ '123.5 ሚሴ' │ '123.5 ሚሴ' │ true │ | |
│ 2 │ 'ar' │ '١٢٣٫٥ ملي ث' │ '123.5 ملي ث' │ false │ | |
│ 3 │ 'as' │ '১২৩.৫ মিঃ ছেঃ' │ '123.5ms' │ false │ | |
│ 4 │ 'az' │ '123,5 msan' │ '123.5ms' │ false │ |
This file contains hidden or 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
// Log all DOM mutations to console. | |
// Modern interpretation of https://github.com/kdzwinel/DOMListenerExtension | |
observer = new MutationObserver(onMutation); | |
observerSettings = { | |
subtree: true, | |
childList: true, | |
attributes: true, | |
attributeOldValue: true, |
This file contains hidden or 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
/** | |
* To use: | |
* Export a Recording panel recording as JSON. Run this: | |
* node generate-pptr-lh-script-from-json.mjs yourjson.json | |
* It'll save a `yourjson.json.pptr.js` | |
* That script is dependent on: | |
* lighthouse@9.5.0-dev.20221024 | |
* puppeteer@19.4.1 | |
* Run that script. It'll save a `flow.report.html`. View that. | |
* It's one of these: https://web.dev/lighthouse-user-flows/ |
This file contains hidden or 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 is pretty quick and rough.. but it works | |
// script.google.com | |
// settings to allow editing the appscript.json | |
// set these two files | |
// then hit Run with function 'run' | |
const all = {}; | |
function run() { |
This file contains hidden or 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
'use strict'; | |
import fs from 'fs'; | |
import puppeteer from 'puppeteer'; | |
import {navigation} from 'lighthouse/lighthouse-core/fraggle-rock/api.js'; | |
// Run Lighthouse headlessly, just Performance | |
(async function() { | |
const browser = await puppeteer.launch({headless: true}); |
This file contains hidden or 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
// 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; |
This file contains hidden or 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
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); | |
} |
NewerOlder