Skip to content

Instantly share code, notes, and snippets.

Karl Horky karlhorky

Block or report user

Report or block karlhorky

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
karlhorky / engine-ua-sniffer.js
Created Jul 10, 2019 — forked from domenic/engine-ua-sniffer.js
Rendering engine UA sniffer
View engine-ua-sniffer.js
// This is a minimal UA sniffer, that only cares about the rendering/JS engine
// name and version, which should be enough to do feature discrimination and
// differential code loading.
// This is distinct from things like
// which distinguish between different branded browsers that use the same rendering
// engine. That sort of distinction is maybe useful for analytics purposes, but
// for differential code loading it is overcomplicated.
// This is meant to demonstrate that UA sniffing is not really that hard if you're
View App.Combobox.js
import React, { useState, useEffect } from "react";
import "./packages/combobox/styles.css";
import {
} from "./packages/combobox/index";
View fetch-with-timeout.js
// Fetch with timeout
// Source:
const networkTimeoutError = new Error('Network request timeout')
function getTimeout({ timeout }) {
if (timeout && timeout.constructor === Promise) {
return timeout
if (typeof timeout === 'number') {
karlhorky /
Last active Jan 21, 2019
CSS is Complex. We can do better.

CSS is Complex. We can do better.

Posted on

Ok, thread time.

CSS is unnecessarily complex. And we can do better.

There have been side conversations here and there, but I want to consolidate the information and opinions here. This will be a running thread, and I'll add to it as new things crop up.

karlhorky /
Last active Dec 15, 2018
Huawei Matebook x Pro PCI-Express 2 lane bandwidth limitations with eGPU

Huawei Matebook x Pro PCI-Express 2 lane bandwidth limitations with eGPU

"In short, with current TB3 overheads, 2 lanes is enough to transfer data to the GPU. If you use a display connected to the external GPU, you'll see almost zero performance difference. If you want to use the internal display of your laptop, 2 lanes is not enough, and you'll need 4 lanes to shuffle the DisplayPort data back."

Full Thread:

Original Reference:

karlhorky / flow-deepreadonly.js
Last active Aug 21, 2018
Flow: DeepReadOnly utility function
View flow-deepreadonly.js
// Source:
// $ReadOnly doesn't recursively apply invariance to nested object types, and there
// doesn't seem to be any way to do this besides making a separate copy of obj A
// that is invariant. I still want the variant A around in case I want to mutate it
// in certain contexts.
// It would be nice to have some way to use an object as if it's fully, deeply
// invariant without needing to declare a separate variant and invariant type for it.
You can’t perform that action at this time.