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
| # define a full backup of a git repository from one remote server to another one | |
| origin="https://remote-source/repository.git"; | |
| target="https://remote-target/repository.git"; | |
| workDir="temp-directory"; | |
| mkdir $workDir |
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 DEVICES_REGEXP = new RegExp([ | |
| /Android|webOS/, | |
| /|iPhone|iPad|iPod/, | |
| /|BB10|BlackBerry/, | |
| /|IEMobile|Opera Mini/, | |
| /|Mobile|mobile/ | |
| ].map(function(r) {return r.source}).join(''), 'i'); | |
| // output: /Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i |
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 isElementVisible(el, fullVisible) { | |
| // efp - element from point | |
| function efp(x, y) { | |
| return window.document.elementFromPoint(x, y); | |
| } | |
| function getVWidth() { | |
| return window.innerWidth || window.document.documentElement.clientWidth; | |
| } |
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 * as React from 'react'; | |
| export type TFunction = (...args: any[]) => any; | |
| /** | |
| * common code to define useTimeout or useInterval hooks | |
| * | |
| * @param waitFunction | |
| * @param cleanWaitFunction | |
| */ |
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
| // empty sound | |
| const TEST_AUDIO_MP3 = [ | |
| 'data:audio/mpeg;base64', | |
| ',/+MYxAAAAANIAUAAAASEEB/jwOFM/0MM/90b/+RhST//w4NFwOjf', | |
| '///PZu//', | |
| '//9lns5GFDv//l9GlUIEEIAAAgIg8Ir/JGq3/', | |
| '+MYxDsLIj5QMYcoAP0dv9HIjUcH//yYSg+CIbkGP//', | |
| '8w0bLVjUP///3Z0x5QCAv/yLjwtGKTEFNRTMuOTeqqqqqqqqqqqqq/', | |
| '+MYxEkNmdJkUYc4AKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq', | |
| 'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' |
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 * as React from 'react'; | |
| type TFunction = (...args: any[]) => any; | |
| /** | |
| * safe way to use window.setTimeout using a hook to handle it | |
| * | |
| * @param {TFunction} callback to be executed by the timeout | |
| * @param {number} delay time to the execution | |
| * @param {boolean} autorun flag that says if should start running right after call the hook - default true |
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 * as React from 'react'; | |
| export type TFunction = (...args: any[]) => any; | |
| /** | |
| * safe way to use window.setInterval using a hook to handle it | |
| * | |
| * @param {TFunction} callback to be executed on each interval | |
| * @param {number} delay time between the executions | |
| * @param {boolean} autorun flag that says if should start running right after call the hook - default true |
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 * as React from 'react'; | |
| export interface IClickOutsideProps { | |
| onClick: () => void; | |
| /** element to add the click event listener, default selector is body */ | |
| parentTargetQuerySelector?: string; | |
| } | |
| /** | |
| * Function Component to re-use the behavior of click outside |
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 * as React from 'react'; | |
| /** | |
| * extend the React.useState to have the state referente, so it will be possible to use its value | |
| * inside of other callbacks | |
| * | |
| * @param {T} initialValue | |
| * | |
| * @return {[T, React.MutableRefObject<T>, React.Dispatch<React.SetStateAction<T>>]} array | |
| */ |
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 TJSObject = { [key: string]: any }; | |
| type TJSValue = TJSObject | any; | |
| type TArrayFilter<T> = (x: T) => boolean; | |
| const TO_STRING = {}.toString; | |
| const isObjectBasicCheck = <T extends object>(value: any): value is T => value !== null && typeof value === 'object'; |