Skip to content

Instantly share code, notes, and snippets.

Domenic Denicola domenic

Block or report user

Report or block domenic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
domenic /
Created Oct 5, 2017
FTL implies causality violation

(From a friend one mine; I'm just hosting this here.)

Issue 1: Relativity of Simultaneousness:

Your buddy Einstein is riding the interstellar express train. All the lights are off, but just as it passes your observation platform, he turns on a lamp in the middle of the train. You and he have taken bets on which end of the train, front or back, will light up first. As expected, your video cameras on the platform record the rear of the train lighting up first, since, as the light spreads out from the original location of the lamp, the rear of the train moves slightly closer to the source, while the front end is moving away. However, Einstein reports that his equipment shows both ends lit up simultaneously.

Both of you are correct. In your reference frame the events "light reaches front of train" and "light reaches rear of train" are not simultaneous, even though in Einstein's they are are.

Issue 2: Superluminal Travel

domenic / overconstrainederror.js
Created Sep 29, 2017
OverconstrainedError in V8 extras
View overconstrainederror.js
(function (global, binding, v8) {
const captureStackTrace = global.Error.captureStackTrace;
const defineProperty = global.Object.defineProperty;
const setPrototypeOf = global.Object.setPrototypeOf;
const Error = global.Error;
function OverconstrainedError(constraint, message = undefined) {
const obj = new Error();
// This complicated dance is necessary to emulate
domenic / call-graph.svg
Last active Aug 28, 2017
Exponential module call graph
View call-graph.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
domenic / to-run-2.yaml
Last active Aug 20, 2017
New jsdom WPT manifest format
View to-run-2.yaml
DIR: dom/collections
HTMLCollection-as-proto-length-get-throws.html: [fail,]
HTMLCollection-supported-property-indices.html: [fail, Named versus indexed properties trickiness]
HTMLCollection-supported-property-names.html: [fail, Names vs. ids priority and effect on enumeration order]
domstringmap-supported-property-names.html: [fail, DOMStringMap not implemented]
DIR: dom/events
domenic / promise-finally-observability.js
Last active Aug 12, 2017
Promise.prototype.finally observability
View promise-finally-observability.js
// Current spec
function finally(onFinally) {
let C = SpeciesConstructor(this);
return this.then(
x => new C(r => r(onFinally())).then(() => x),
e => new C(r => r(onFinally())).then(() => { throw e; })
// Proposed, but rejected (potentially because of a miscommunication) spec
domenic /
Created Jun 7, 2017
Async generator next vs. return


async function* f() {
  const x = Promise.resolve(1);
  const y = Promise.resolve(2);
  const fromX = yield x;
  return y;
domenic / URL.js
Created Mar 2, 2017
Generated URL.js with webidl2js
View URL.js
"use strict";
const conversions = require("webidl-conversions");
const utils = require("./utils.js");
const Impl = require(".//URL-impl.js");
const impl = utils.implSymbol;
function URL(url) {
if (!this || this[impl] || !(this instanceof URL)) {
domenic / 1-service-worker.js
Created Feb 14, 2017
Service worker stream transferring 2
View 1-service-worker.js
"use strict";
const worker = new Worker("worker.js");
self.onfetch = e => {
e.respondWith(new Promise(resolve => {
const guid = generateGUID();
worker.addEventListener("message", function messageListener({ data: { readableStream, messageId } }) {
if (messageId !== guid) {
domenic / 1-service-worker.js
Last active Jun 4, 2019
Service worker stream transferring
View 1-service-worker.js
"use strict";
const worker = new Worker("worker.js");
self.onfetch = e => {
const transform = new TransformStream(); // creates an identity transform
e.respondWith(new Response(transform.readable));
// Give the worker the writable end. An identity transform stream will just shuffle
// bytes written there into transform.readable.
domenic /
Created Feb 10, 2017
Redirecting GitHub pages after a repository move

Redirecting GitHub Pages after a repository move

The problem

You have a repository, call it alice/repo. You would like to transfer it to the user bob, so it will become bob/repo.

However, you make heavy use of the GitHub Pages feature, so that people are often accessing GitHub will helpfully redirect all of your repository stuff hosted on after the move, but will not redirect the GitHub Pages hosted on

The solution

You can’t perform that action at this time.