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.querySelector('vk-video-player').store.actions.internal.downloadVideo(); | |
| })(); |
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
| # removing FigmaAgent.app | |
| rm -fr ~/Library/Application\ Support/Figma/FigmaAgent.app | |
| # creating a dummy file | |
| touch ~/Library/Application\ Support/Figma/FigmaAgent.app | |
| # make the file undeletable | |
| sudo chflags -R schg ~/Library/Application\ Support/Figma/FigmaAgent.app | |
| # Now Figma will not be able to override that file when it wants to update it. |
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
| sudo nano /etc/pam.d/sudo | |
| # add to top of the file: | |
| auth sufficient pam_tid.so |
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 { ObjectStr } from '@src/types'; | |
| import { ALLOWED_METHODS } from './requestKeys'; | |
| export type BackendError = { | |
| status: number | |
| error: string | |
| name?: string | |
| attributes?: ObjectStr | |
| } |
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 cloneDeep from 'lodash/cloneDeep'; | |
| const replaceNull = (value) => (value === '') ? null : value; | |
| const proxyHandler = { | |
| get(target, key, receiver) { | |
| const value = Reflect.get(target, key, receiver); | |
| const nullifiedValue = replaceNull(value); |
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 useOnScreen = (ref: ObjectRef, rootMargin: number = 0) => { | |
| const ioSupported = 'IntersectionObserver' in window | |
| const [visible, setVisible] = useState(false) | |
| /* fallback for browsers with no IntersectionObserver support */ | |
| useOnScreenFallback({ ref, ioSupported, setVisible }) | |
| useEffect(() => { | |
| if (!ioSupported) { | |
| return |
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
| { | |
| "moscow": [ | |
| { | |
| "country": "Россия", | |
| "region": "Московская", | |
| "region_type_full": "область" | |
| }, { | |
| "country": "Россия", | |
| "region": "Москва", | |
| "region_type_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
| // @flow | |
| export type PromiseHandler = { | |
| promise: Promise<*>, | |
| cancel: () => void, | |
| } | |
| export default function makeCancelable(promise: Promise<*>): PromiseHandler { | |
| let hasCanceled = false |
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
| [ | |
| { "alpha2": "AB", "name": "Абхазия", "numeric": "999" }, | |
| { "alpha2": "AU", "name": "Австралия", "numeric": "36" }, | |
| { "alpha2": "AT", "name": "Австрия", "numeric": "40" }, | |
| { "alpha2": "AZ", "name": "Азербайджан", "numeric": "31" }, | |
| { "alpha2": "AL", "name": "Албания", "numeric": "8" }, | |
| { "alpha2": "DZ", "name": "Алжир", "numeric": "12" }, | |
| { "alpha2": "AS", "name": "Американское Самоа", "numeric": "16" }, | |
| { "alpha2": "AI", "name": "Ангилья", "numeric": "660" }, | |
| { "alpha2": "AO", "name": "Ангола", "numeric": "24" }, |
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 comparatorF = (element, needle) => element - needle | |
| const binarySearch = (list, needle, comparator = comparatorF) => { | |
| if (!needle || !list) return null | |
| let min = 0 | |
| let max = list.length - 1 | |
| while (min <= max) { | |
| const mid = Math.floor(min + (max - min) / 2) |
NewerOlder