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
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)
(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
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)
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
# 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
<!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
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}});
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
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
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.