Skip to content

Instantly share code, notes, and snippets.

View jimmont's full-sized avatar

Jim Montgomery jimmont

View GitHub Profile
jimmont / interactivecontent.js
Created December 13, 2021 18:00
interactive content HTML elements where tab through document gives focus
View interactivecontent.js
needed to manage tab focus (focusin) events leading to the following selector to adjust;
additional info:
and various linked/related in the above (or simply Google a bit)
View deps.bundle.js
(function() {
'use strict';
if (typeof document === 'undefined' || 'adoptedStyleSheets' in document) {
var hasShadyCss = 'ShadyCSS' in window && !ShadyCSS.nativeShadow;
var bootstrapper = document.implementation.createHTMLDocument('');
var closedShadowRootRegistry = new WeakMap();
var _DOMException = typeof DOMException === 'object' ? Error : DOMException;
var defineProperty = Object.defineProperty;
jimmont / uitest.js
Last active September 15, 2021 19:55
async Deno.test() tests
View uitest.js
import puppeteer from '';
import { assert } from '';
async runTests()
discussion of testing API
jimmont / polyfill.Events.js
Created April 27, 2021 20:14
Event related polyfills (for evergreen browsers)
View polyfill.Events.js
if( !('SubmitEvent' in self && 'submitter' in SubmitEvent.prototype) ){
// polyfill SubmitEvent.submitter (a Safari issue as-of 2021)
const submitter = Symbol.for('submitter');
Event[ submitter ] = null;
const submitterSelector = 'input[type=submit], input[type=image], input[type=button], button';
Object.defineProperty(Event.prototype, 'submitter', {
get: function(){
if('submit' === this.type){
jimmont / .dockerignore
Created February 19, 2021 05:17
Deno on Cloud Run
View .dockerignore
# TODO cleanup
jimmont / ReactHTM.html
Created November 16, 2020 07:42
use HTM to reduce work in React apps by removing the need for JSX translation in build processes
View ReactHTM.html
<!doctype html>
<html lang="en">
<meta charset="utf-8" >
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
<title>use HTM to reduce work in React apps</title>
<meta name="description" content="example using HTM with React to replace JSX and reduce work">
jimmont / websockets.js
Created July 27, 2020 00:37
http upgrade websocket
View websockets.js
running with Deno 1.2
deno run --inspect --allow-net ./websockets.js
import { Application, Router, HttpError, send, Status } from "";
import { isWebSocketCloseEvent } from "";
const port = 8123;
const users = new Set();
const app = new Application({state:{users}});
View linkedlist.js
add,remove,length, reverse
class List{
class Node{
jimmont / jsx-template-transformer.js
Last active February 26, 2020 01:20
transform jsx to tagged template literals
View jsx-template-transformer.js
transform JSX to tagged template literals
2019-01-25 initial working draft
jimmont / flat-arbitrary.js
Last active February 22, 2020 18:52
array flat arbitrary
View flat-arbitrary.js
Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4].
Your solution should be a link to a gist on with your implementation.
When writing this code, you can use any language you're comfortable with. The code must be well tested and documented. Please include unit tests and any documentation you feel is necessary. In general, treat the quality of the code as if it was ready to ship to production.
Try to avoid using language defined methods like Ruby's Array#flatten or JavaScript's Array.flat.