From Stackoverflow
start_text.*?(.|[\n])*?end_text
with start_text
and end_text
being the bounds of your multiline search.
breaking down the regex .*?(.|[\n])*?
:
const domains = document.querySelectorAll('[data-testid="domains/search-item"]'); | |
const tldLength = 2; // edit this value to filter by length greater than the value | |
domains.forEach((domain) => { | |
if (domain.querySelector(".tld-part").textContent.length > tldLength) { | |
const listItem = | |
domain.querySelector(".tld-part").parentElement.parentElement | |
.parentElement; | |
const list = | |
domain.querySelector(".tld-part").parentElement.parentElement |
import { useEffect, useRef } from 'react'; | |
export type UseLongPressOpts = { | |
callback: () => void; | |
delay: number; | |
distanceThreshold?: number; | |
}; | |
export function useLongPress({ callback, delay, distanceThreshold = 40 }: UseLongPressOpts) { | |
const timerRef = useRef<NodeJS.Timeout | void>(); |
From Stackoverflow
start_text.*?(.|[\n])*?end_text
with start_text
and end_text
being the bounds of your multiline search.
breaking down the regex .*?(.|[\n])*?
:
function getRndInteger(min: number, max: number): number { | |
return Math.floor(Math.random() * (max - min) ) + min; | |
} |
function getRandomNumberInc(min: number, max: number): number { | |
return Math.floor(Math.random() * (max - min + 1) ) + min; | |
} |
// https://www.typescriptlang.org/play?#code/C4TwDgpgBAggziAdgYwEoWAVwE6ICrgQA8eUEAHsBIgCZxQAUAdCwIbYDmcAXFK4iACUUALwA+PgIkiAUFCgB6BVACWAMyikAtq2DIAFhHrB9K+nBUdEunNH40o2DDkT1WUAArYA9lrMQAGjJKbFZkYCgAVUYTaFBIKG8NWMcjbwAbADcIBzAfPzgIYXsoTEKoE105TWCqWnpmNk4eSSFRCS9ffyIVRDUIbCixavkAfiiRqF4lROwWJnl1Gp09Q2NTc0trLCdJBycd11aTXo4ydMKgimBQ8IrDVMOoTNZ0zGhokrK4-Sr5eVI12odEY83YXF4-Da4lUfQGE3+UHGkUm02U3jmLFUGgg2WwIBOiDOHG8Rgq3ighnS6SCBxcUAABlCGZN5FCANwyLmsBAoKBqTAoYAqbyIPi85AAMUFyAYwgA3pM6bgKth3pyAL5cgVCkVixCi+BIKUyuVQRWI5Vim7qmRamTxaAAOUNEvQhzgnQKEEl+SNfJEUHdLgIkCIjqS4uN0pQYk5jqgLsQ-rQzlwcFDPvySZToiDafwhHDhEjBuTEpjyDjXITKeD6czvt8ucDdYLmeLkEjPOjMurtbdBYzhCbWhzErzbcOHYjGjLKcrcaAA | |
type AsyncReturnType<T extends (...args: any) => any> = | |
// if T matches this signature and returns a Promise, extract U (the type of the resolved promise) and use that | |
T extends (...args: any) => Promise<infer U> | |
? U | |
: // or... if T matches this signature and returns anything else, extract the return value U and use that | |
T extends |
{"lastUpload":"2020-04-03T17:36:11.603Z","extensionVersion":"v3.4.3"} |
import React, { cloneElement } from 'react'; | |
// import providers | |
import { ExportedProvider } from './path/to/provider'; | |
function ProviderComposer({ contexts, children }) { | |
return contexts.reduceRight( | |
(kids, parent) => | |
cloneElement(parent, { | |
children: kids, |