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> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> | |
| <title>Backbone.js example</title> | |
| <link rel="stylesheet" type="text/css" href="css/sunny/jqueryui.min.css"/> | |
| </head> | |
| <body> | |
| <!-- "slider" is a jquery slider --> | |
| <div id="slider"></div> |
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 doAwait = async <T>(promise: Promise<T>): Promise<[undefined, T] | [Error, undefined]> => { | |
| try { | |
| const data = await promise; | |
| return [undefined, data]; | |
| } catch (error) { | |
| return [error as Error, undefined]; | |
| } | |
| }; |
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
| type TryCatchProps<T> = { | |
| tryFn: () => T; | |
| catchFn: (error: unknown) => T; | |
| } | |
| function tryCatch<T>({ tryFn, catchFn }: TryCatchProps<T>): T { | |
| try { | |
| return tryFn(); | |
| } catch (error) { | |
| return catchFn(error); |
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
| [ | |
| ...document | |
| .getElementById( | |
| "checkbox-form-component-profileEditFormElement-SKILL-AND-ASSOCIATION-skill-ACoAAER-oMoBZ2Gj7DeLnyDhqW4wgvSDFHT2VJ4-1-associations-positionUrns" | |
| ) | |
| .querySelectorAll("label[data-test-text-selectable-option__label]"), | |
| ].map((item) => item.click()); |
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
| // log out your caches and entries | |
| (await caches.keys()).map(async (cacheName) => { | |
| console.log(cacheName); | |
| const cache = await caches.open(cacheName); | |
| console.log(await cache.keys()); | |
| }); | |
| // get all caches, and entries, and merge them into one array | |
| (await Promise.all((await caches.keys()).map(async (cacheName) => await (await caches.open(cacheName)).keys()))).flat() |
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
| await init("data:application/wasm;base64,AGFzbQEAAAAB0gIkYAR/f39/AX9gBX9/f39/AX9gA39/fwBgA39/fwF/YAh/f39/f39/fwF/YAV/f39/fgF/YAF/AGABfwF/YAJ/fwF/YAJ/fwBgBn9/f39/fwF/YAAAYAd/f39/f39/AX9gC39/f39/f39/f39/AX9gBX9/f39/AGAEf39/fwBgBn9/f39/fwBgB39/f39/f38AYAp/f39/f39/f39/AX9gCn9/f39/f39/fn8Bf2AJf39/f39/f39/AX9gAAF/YAJ/fAF/YAN/f38BfmAQf39/f39/f39/f39/f39/fwF/YA5/f39/f39/f39/f39/fwF/YAR/f39/AX5gAn9/AX5gEX9/f39/f39/f39/f39/f39/AX9gC39/f39/f39/f39/AGAMf39/f39/f39/f39/AX9gAn5+AX5gA35/fwF+YAF/AX5gBX9/f35/AX9gAn98AAIfBQFhAWEABgFhAWIACwFhAWMACwFhAWQAFgFhAWUABwOsAqoCAQMPAwMDAwMGAggKCgIBAgcICAYDBAgCAAAABwEKAgAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAIPChAKAhEAAgMDAgoAAAAGFwINGA0AAwIKDAcJDhQZEAYaCAMIEgcICBsACgMCAwMBBgAAAAAAAAwDCAkLDg8BAQYGAwAcAB0HDA0DAA0BDB4NBAMKBREFBQUFBQUFBQUFBQUFBQUTExMHCwIGBAMABwcBAQECEQAABB8IBhAJCQkJAxISDgECDAcCDgIADiAhIgAAAQoCAQEBAQcVBwICAgIICwsGBiMADBUBAQEBAQEBAQEHAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQQEBAQEBAQEBAQEBAQFAXABPj4FBwEBggKAgAIGCAF/AUGg1wQLB1IRAWYCAAFnAJEBAWgAiQIBaQDyAQFqAP |
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
| find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; |
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
| echo -e '<playercorefactory> | |
| <players> | |
| <player name="iina" type="ExternalPlayer" audio="false" video="true"> | |
| <filename>/Applications/IINA.app/Contents/MacOS/IINA</filename> | |
| </player> | |
| <player name="VLC" type="ExternalPlayer" audio="false" video="true"> | |
| <filename>/Applications/VLC.app/Contents/MacOS/VLC</filename> | |
| <args>--video-on-top --play-and-exit</args> | |
| <hidexbmc>true</hidexbmc> | |
| </player> |
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
| /** | |
| * Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt(). | |
| * (c) Chris Veness MIT Licence | |
| * | |
| * @param {String} plaintext - Plaintext to be encrypted. | |
| * @param {String} password - Password to use to encrypt plaintext. | |
| * @returns {String} Encrypted ciphertext. | |
| * | |
| * @example | |
| * const ciphertext = await aesGcmEncrypt('my secret text', 'pw'); |
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 el = document.querySelector("h1"); | |
| const threshold = 50; | |
| const between = (x, min, max) => x >= min && x <= max; | |
| const getElBoundingBox = (el, threshold = 0) => { | |
| const elPos = el.getBoundingClientRect(); | |
| return { | |
| top: elPos.top - threshold, |
NewerOlder