chrome://inspect/#service-workers
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
| /* | |
| The above example, array.sort(), is not accurate, it will favor some numbers over the others. | |
| The most popular correct method, is called the Fisher Yates shuffle, and was introduced in data science as early as 1938! | |
| In JavaScript the method can be translated to this: | |
| */ | |
| const points = [40, 100, 1, 5, 25, 10]; |
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
| /* | |
| Write a script that creates an array with 10000 random words between 3 and 5 characters, | |
| and returns the number of words that are palindromes in that array. Notes: You'll need to | |
| return just the number of words. | |
| */ | |
| const alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]; | |
| const charLimit = [3,4,5]; | |
| const randomWords = []; | |
| const palindromeWords = []; |
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
| git for-each-ref --format '%(refname:short)' refs/heads | grep -v "master\|stg1\|stg2\|stg3" | xargs git branch -D |
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 { useEffect, useState, useRef } from 'react' | |
| export default function useOnScreen(ref?: any) { | |
| const observerRef = useRef<IntersectionObserver | null>(null) | |
| const [isOnScreen, setIsOnScreen] = useState(false) | |
| useEffect(() => { | |
| observerRef.current = new IntersectionObserver(([entry]) => | |
| setIsOnScreen(entry.isIntersecting) | |
| ) |
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 { useEffect, useState } from 'react' | |
| export default function useReziseWindow() { | |
| const [windowWidth, setWindowWidth] = useState<number | null>() | |
| useEffect(() => { | |
| const onResize = () => { | |
| setWindowWidth(window?.innerWidth) | |
| } |
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
| version: '3.1' | |
| services: | |
| mongo: | |
| image: mongo:4.4-bionic | |
| # restart: always | |
| container_name: mongodb | |
| environment: | |
| MONGO_INITDB_ROOT_USERNAME: admin |
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
| { | |
| "editor.formatOnSave": false, | |
| "editor.codeActionsOnSave": { | |
| "source.fixAll.eslint": true | |
| }, | |
| "editor.detectIndentation": false, | |
| "files.insertFinalNewline": true, | |
| "editor.tabSize": 2, | |
| "editor.insertSpaces": true, | |
| "editor.autoIndent": "full" |
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 { Dispatch, AnyAction } from 'redux'; | |
| import type { ActionCreatorWithPreparedPayload } from './createAction'; | |
| import type { ThunkDispatch } from 'redux-thunk'; | |
| import type { FallbackIfUnknown, IsAny, IsUnknown } from './tsHelpers'; | |
| export declare type BaseThunkAPI<S, E, D extends Dispatch = Dispatch, RejectedValue = undefined, RejectedMeta = unknown, FulfilledMeta = unknown> = { | |
| dispatch: D; | |
| getState: () => S; | |
| extra: E; | |
| requestId: string; | |
| signal: AbortSignal; |
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 FetchRequest = { | |
| url: string; | |
| method?: "GET" | "POST"; | |
| body?: object; | |
| headers?: { | |
| [key: string]: string; | |
| }; | |
| }; | |
| type Error = { |