Skip to content

Instantly share code, notes, and snippets.

View dgp1130's full-sized avatar

Douglas Parker dgp1130

View GitHub Profile
dgp1130 / output.txt
Created June 13, 2024 00:30
Angular CLI Node Test Runner Example Failure
Running test "tests/web-test-runner/basic" (1 of 1)...
Executing: `/usr/local/google/home/douglasparker/.cache/bazel/_bazel_douglasparker/fd23369152ca483d39c1138566f81234/execroot/angular_cli/bazel-out/k8-fastbuild/bin/tests/legacy-cli/ "--test" "/usr/local/google/home/douglasparker/.cache/bazel/_bazel_douglasparker/fd23369152ca483d39c1138566f81234/execroot/angular_cli/bazel-out/k8-fastbuild/bin/tests/legacy-cli/"`
TAP version 13
# ==========================================================================================
# Running `npm "install" "@web/test-runner" "--save-dev"` [silent]...
# CWD: /usr/local/google/home/douglasparker/Temp/angular-cli-e2e-SHplZN/e2e-test/test-project
# ==========================================================================================
# Running `ng "test"`...
# CWD: /usr/local/google/home/douglasparker/Temp/angular-cli-e
dgp1130 /
Last active December 7, 2023 06:14
HydroActive Class vs Functional Syntax Optimizations

HydroActive Class vs Functional Syntax Optimizations

This attempts to analyze the optimziation behavior in V8 when using HydroActive class and functional components to try to quantify the performance difference. It uses a local build of d8 and follows advice in An Introduction to Speculative Optimization in V8

functional.js and class.js contain simplified implementations of defining custom element methods with the two designs. functional.output and class.output contain the output of running d8 on each file.

This file has been truncated, but you can view the full file.
dgp1130 / pquery.bzl
Last active June 5, 2022 14:07
Bazel Starlark query providers for target
"""Starlark script to nicely format providers of a target.
bazel cquery --output starlark --starlark:file ${PATH_TO_THIS_FILE} //path/to/pkg:target
If you get "ERROR: --starlark:file :: Unrecognized option: --starlark:file", make sure you are
using `bazel cquery` **not** `bazel query`.
If you get "Error: Starlark computation cancelled: too many steps", you can try adding
`--max_computation_steps=9223372036854775807` to raise the limit to its maximum value.
dgp1130 / dom.js
Last active March 8, 2022 05:27
HTML Fragments
* Parse a network response as an HTML document fragment, then returns each
* top-level element.
export async function parseDomFragment(res) {
// Parse a fully rendered document fragment from the network response.
const html = await res.text();
const contentType = res.headers.get('Content-Type');
if (!contentType)
throw new Error('Response has no Content-Type.');
dgp1130 / LICENSE
Last active June 23, 2023 00:47
Better type inference of `querySelector()` via inferred Template Literal Types
Copyright (c) 2023 Douglas Parker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
async function renderPromise(promise) {
if (promise.isResolved()) {
} else {
const value = await promise;
dgp1130 / data.json
Created May 30, 2020 02:38
Lists all open bugs in the Angular CLI repo
"userName": "<github-username>",
"pat": "<personal-access-token-generated-from-github>"
dgp1130 /
Created April 30, 2020 04:04
Prototype Browser Extension Protocol Buffer Service

Prototype Browser Extension Protobuf Service

Gist can't have subdirectories, but this contains two packages.

All the files named protoc-plugin__* should actually be protoc-plugin/*.


(cd protoc-plugin/ &amp;&amp; npm run build) &amp;&amp; npm run build
dgp1130 / file.js
Last active August 7, 2016 07:42
Karma Babel Preprocessor cannot parse ES6 lambda syntax () -> {};
window.temp = "world";
let test = "hello";
window.test = test;
var { one, two } = { one: 1, two: 2 }; = one;
window.two = two; = function (bar = "bar") {