This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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> |
This file contains hidden or 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 type {ReactiveController, ReactiveControllerHost} from 'lit'; | |
/** | |
* A reactive controller that updates a host when slotted content changes and | |
* provides helper methods for checking and getting assigned slot content. | |
*/ | |
export class SlotController implements ReactiveController { | |
private _host: ReactiveControllerHost & Element; | |
private _slotNames?: ReadonlyArray<string>; |
This file contains hidden or 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
/** | |
* Returns the scroll parent of an element along a specified axis and the scroll size and client size. | |
* | |
* @param {HTMLElement} el - The element to find the scroll parent of. | |
* @param {String} [axis='y'] - The axis to find the scroll parent for. | |
* @returns {Object} An object with the following properties: | |
* @property {HTMLElement} scrollParent - The scroll parent element. | |
* @property {Number} scrollParentSize - The size of the scroll parent along the specified axis. | |
* @property {Number} clientParentSize - The size of the scroll parent's client area along the specified axis. | |
*/ |
This file contains hidden or 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
const getObjectType = obj => Object.prototype.toString.call(obj).slice(8, -1); | |
console.log(getObjectType(new Date())); // Date | |
console.log(getObjectType([])); // Array | |
console.log(getObjectType(true)); // Boolean | |
console.log(getObjectType(function() {})); // Function | |
console.log(getObjectType(x => x)); // Function | |
console.log(getObjectType(null)); // Null | |
console.log(getObjectType(37)); // Number | |
console.log(getObjectType(NaN)); // Number |
This file contains hidden or 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 fs from 'fs'; | |
import path from 'path'; | |
const traverseTree = (dir, attribute, cacheTravese = '') => { | |
const files = fs.readdirSync(dir); | |
for (const file of files) { | |
if ( | |
file === 'node_modules' || | |
file.startsWith('.') || | |
file === cacheTravese |
This file contains hidden or 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
export const escapeHTML = (str) => | |
str.replace( | |
/[&<>'"]/g, | |
(character) => | |
({ | |
'&': '&', | |
'<': '<', | |
'>': '>', | |
"'": ''', | |
'"': '"', |