Skip to content

Instantly share code, notes, and snippets.

View bgrins's full-sized avatar

Brian Grinstead bgrins

View GitHub Profile
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/[email protected]/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/[email protected]/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

*Verifiable *code

Verifiable code

#!/bin/bash
# this 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello!</title>
<meta charset="utf-8">
</head>
<body>
<script>
customElements.define("moz-outer", class extends HTMLElement {
constructor() {
MOZILLA_CENTRAL=~/Code/mozilla-central
if [ ! -f $MOZILLA_CENTRAL/test.mozbuild ]; then
echo "Error: this doesn't look like an m-c directory."
exit 1
fi
# Generate a list of directories to ignore using the built in list
# plus files ignored by VCS, plus other whitelisted ones here.
THIRD_PARTY_LIST="$(sed 's/^/\//' $MOZILLA_CENTRAL/tools/rewriting/ThirdPartyPaths.txt)"
GIT_IGNORE_LIST="$(sed '/^#/d;/^$/d' $MOZILLA_CENTRAL/.gitignore)"
Last:
8 xul:window
xul:hbox
xul:spacer
xul:resizer
[ '../../gecko/layout/reftests/xul/resizer-bottomstart-rtl.xul',
'../../gecko/layout/reftests/xul/resizer-bottomleft-rtl.xul',
'../../gecko/layout/reftests/xul/resizer-bottomend-rtl.xul',
'../../gecko/layout/reftests/xul/resizer-bottomright-rtl.xul',