This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { html, LitElement } from 'lit'; | |
import { styles } from './styles/pe-pe-styles.css.js'; | |
// https://github.com/KonnorRogers/form-associated-helpers/blob/main/exports/mixins/lit-form-associated-mixin.js | |
/** | |
* Creates an object with a getter for properties, allowing for the dynamic creation of properties. | |
* @param {Object} props - The properties to be included in the object. | |
* @returns {Object} An object with a `properties` getter that returns a new objec. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tseslint from 'typescript-eslint'; | |
import html from '@html-eslint/eslint-plugin'; | |
// import htmlParser from '@html-eslint/parser'; | |
import eslintConfigPrettier from 'eslint-config-prettier'; | |
import path from 'node:path'; | |
import { fileURLToPath } from 'node:url'; | |
import js from '@eslint/js'; | |
import { FlatCompat } from '@eslint/eslintrc'; | |
const __filename = fileURLToPath(import.meta.url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Checks if an element should be ignored. | |
* @param {Element} element - The DOM element to check. | |
* @param {Array} [exceptions=['dialog', '[popover]']] - Array of Elements to ignore when checking the element. | |
* @returns {boolean} True if the element should be ignored by a screen reader, false otherwise. | |
*/ | |
const isElementInvisible = (element, exceptions = ['dialog', '[popover]']) => { | |
if (!element || !(element instanceof HTMLElement)) { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.abeautifulsite.net/posts/converting-a-url-object-to-a-plain-object-in-java-script/ | |
const url = new URL('https://api.chucknorris.io/jokes/random'); | |
function urlToPlainObject(url) { | |
const plainObject = {}; | |
for (const key in url) { | |
if (typeof url[key] === 'string') { | |
plainObject[key] = url[key]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ReactiveController, ReactiveControllerHost } from 'lit'; | |
import { | |
createContext, | |
ContextProvider, | |
ContextConsumer, | |
Context, | |
ContextType, | |
} from '@lit/context'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onOpen() { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createMenu('Custom Menu') | |
.addItem('Move Rows with Keyword', 'moveRowsWithKeywordToNewSheet') | |
.addToUi(); | |
} | |
function moveRowsWithKeywordToNewSheet() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var activeSheet = ss.getActiveSheet(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(prototype => { | |
if (typeof prototype.requestSubmit === 'function') { | |
return; | |
} | |
const validateSubmitter = (submitter, form) => { | |
if (!(submitter instanceof HTMLElement)) { | |
throw new TypeError('The submitter element is not of type HTMLElement'); | |
} | |
if (submitter.type !== 'submit') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Check object | |
run: | | |
cat << OBJECT | |
${{ toJson(github.event) }} | |
OBJECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { | |
var style = document.querySelector('#toggle-ytp'); | |
if (style) { | |
style.remove(); | |
} else { | |
var selector = '.ytp-chrome-top,.ytp-chrome-bottom'; | |
style = document.createElement('style'); | |
style.id = 'toggle-ytp'; | |
style.textContent = selector + '{display:none;}'; | |
document.head.appendChild(style); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<script type="module" src="./simple-greeting.js"></script> | |
</head> | |
<body> | |
<simple-greeting name="World"></simple-greeting> | |
</body> |
NewerOlder