Skip to content

Instantly share code, notes, and snippets.

View bgrins's full-sized avatar

Brian Grinstead bgrins

View GitHub Profile
@bgrins
bgrins / _ CrUX ranking data from BigQuery _
Last active October 6, 2022 23:16
CrUX ranking in bigquery
https://console.cloud.google.com/bigquery?sq=1095768279152:3d771c7d4d0b4ce7aa31a8846a279904
https://github.com/GoogleChrome/CrUX/tree/main/sql
@bgrins
bgrins / potential-pwas-httparchive.sql
Last active October 6, 2022 17:09
potential-pwas-httparchive
CREATE OR REPLACE TABLE `httparchive-sandbox.test.possible_pwas_mobile` AS
SELECT url, ServiceWorker, manifests FROM
(
SELECT
url,
IF(JSON_EXTRACT(payload, '$._pwa.serviceWorkerHeuristic') = 'true', 1, 0) AS ServiceWorker,
IF(JSON_EXTRACT(payload, '$._pwa.manifests') != '[]' AND JSON_EXTRACT(payload, '$._pwa.manifests') != '{}' AND JSON_EXTRACT(payload, '$._pwa.manifests') != '{}', 1, 0) AS manifests
FROM
`httparchive.pages.2022_06_01_mobile`
<!-- https://giphy.com/gifs/LINEFRIENDS-brown-line-friends-minini-DyQrKMpqkAhNHZ1iWe -->
<div>
<video
style="width: 500px; height: 500px; left: 0px; top: 0px"
alt="Happy Birthday Love GIF by LINE FRIENDS"
src="https://media4.giphy.com/media/DyQrKMpqkAhNHZ1iWe/giphy.mp4?cid=790b7611f0f536eb04d8a026d7d21fa04943af30ef31cfef&amp;rid=giphy.mp4&amp;ct=g"
poster="https://media4.giphy.com/media/DyQrKMpqkAhNHZ1iWe/giphy_s.gif?cid=790b7611f0f536eb04d8a026d7d21fa04943af30ef31cfef&amp;rid=giphy_s.gif&amp;ct=g"
autoplay=""
loop=""
playsinline=""
@bgrins
bgrins / aria-roles-2022.csv
Created June 17, 2022 04:57
from http archive
client total_sites role total_sites_using pct_sites_using
mobile 7940685 button 2581436 0.32508983796737939
desktop 5430532 button 1763537 0.32474479480095136
desktop 5430532 presentation 1350816 0.24874469020714729
mobile 7940685 presentation 1885381 0.23743304261534112
desktop 5430532 dialog 1237176 0.22781856363243969
desktop 5430532 navigation 1200551 0.22107428885420433
mobile 7940685 navigation 1741932 0.21936797644031969
mobile 7940685 dialog 1741422 0.2193037502432095
desktop 5430532 search 1066140 0.196323306814139
[
{ "resource": "https://x-colors.herokuapp.com/api/hex2rgb?value={{dataset.hex}}" }
]
[
{
"resource": "https://api.github.com/graphql",
"method": "POST",
"headers": {
"Authorization": "Bearer {{dataset.bearer}}"
},
"body": "{{dataset.graphql}}"
}
]
export function transform(data, options) {
console.log(data, options);
return data;
}
// Firebase uses XMLHttpRequest instead of `fetch()`, so we need to provide a
// polyfill for it.
import "https://deno.land/x/xhr@0.1.1/mod.ts";
// Firebase for the web by default stores authenticated sessions in
// localStorage. This polyfill will allow us to "extract" the localStorage and
// send it to the client as cookies.
import { installGlobals } from "https://deno.land/x/virtualstorage@0.1.0/mod.ts";
@bgrins
bgrins / mozilla-central-cloc.sh
Last active April 6, 2021 14:57
Mozilla central count lines of code
#!/bin/bash
# these switches turn some bugs into errors
set -o errexit -o pipefail -o noclobber -o nounset
MOZILLA_CENTRAL=$PWD
if [ ! -f $MOZILLA_CENTRAL/test.mozbuild ]; then
echo "Error: this doesn't look like an m-c directory."
exit 1
fi
rg --iglob '!obj*' --iglob '!**/third_party' --iglob '!**/*test*/**' "^.*?gBrowser\.([A-Za-z]*).*?$" . -r '$1' | cut -d':' -f2 | rg . | sort | uniq -c |  sort -r
 283 selectedBrowser
 170 selectedTab
  73 tabContainer
  63 tabs
  61 getTabForBrowser