Skip to content

Instantly share code, notes, and snippets.

View AdaRoseCannon's full-sized avatar
🏳️‍🌈
so tired...

Ada Rose Cannon AdaRoseCannon

🏳️‍🌈
so tired...
View GitHub Profile
#!/bin/bash
tput smcup
# Turn user input off
stty -echo
display() {
BUFFER=$(
tput clear
@AdaRoseCannon
AdaRoseCannon / HTMLElementPlus.js
Last active March 3, 2023 11:33
HTML Element Plus for Web Components
'use strict';
class HTMLElementPlus extends HTMLElement {
static defaultAttributeValue() {
/* the name of the attribute is parsed in as a parameter */
return;
}
static parseAttributeValue(name, value) {
// This is just the worst don't use it.
function $(...s) {
if (s.length === 0) return document.childNodes;
// Handle it being used as a template tag
const inString = (typeof s[0] === 'string' ? s[0] : String.raw(...s)).trim();
if (inString[0].includes('<')) {
return document.createRange().createContextualFragment(inString);
} else {