~/Downloads/ffmpeg -i ~/Downloads/input.mp4 -an -crf 28 -movflags faststart ~/Downloads/output.mp4
This file contains 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
export const debounceThrottle = <T extends any[]>(func: (...args: T) => any, { debounce = 0, throttle = 0 } = {}) => { | |
let debounceId: any = null; | |
let throttleId: any = null; | |
let lastArgs: T | null = null; | |
const run = () => { | |
const argsToCall = lastArgs; | |
lastArgs = null; |
This file contains 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 { useRef, useEffect, useCallback, useLayoutEffect } from 'react'; | |
const useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect; | |
export const useOutsideClick = (onOutsideClick: EventListener) => { | |
const clickedRef = useRef(false); | |
const onMouseDownOrTouchStart = useCallback(() => { | |
clickedRef.current = true; | |
}, []); | |
const outsideClickRef = useRef<EventListener | null>(null); |
This file contains 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 { decode } from 'blurhash'; | |
// source of code below https://github.com/wheany/js-png-encoder/blob/master/generatepng.js | |
const DEFLATE_METHOD = String.fromCharCode(0x78, 0x01); | |
const CRC_TABLE: number[] = []; | |
const SIGNATURE = String.fromCharCode(137, 80, 78, 71, 13, 10, 26, 10); | |
const NO_FILTER = String.fromCharCode(0); | |
const makeCrcTable = () => { | |
let c; |
This function sum all numbers in string with this format:
2000 - apples
4000 - oranges
1000 - potatos
let sumNumbers = (value) => value.split('\n').map((el) => el.split(' ')).flat().reduce((res, el) => !isNaN(+el) ? res + +el : res, 0);
This file contains 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
// it's color parser snippet for https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/ | |
// temp0 - tbody with colors | |
// returns tuple with [light css variables string, dark css variables string] - values can be copied to your css | |
Array.from(temp0) | |
.filter((node) => node.nodeName === 'TR') | |
.map((node) => { | |
const [lightNode, darkNode, nameNode] = Array.from(node.childNodes) | |
.filter((node) => node.nodeName === 'TD') | |
.slice(0, 3); |
-
nvidia (manually)
enable repo in software center
sudo dnf update --refresh sudo dnf install gcc kernel-headers kernel-devel akmod-nvidia xorg-x11-drv-nvidia xorg-x11-drv-nvidia-libs xorg-x11-drv-nvidia-libs.i686
wait 5-10 minutes
-
git
- setup
git config --global user.email [email protected] git config --global user.name "Oleg Grishechkin" git config --global core.editor "webstorm -w"
- libreoffice
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt install libreoffice
sudo apt install libreoffice-kde5
- openvpn
This file contains 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
alias go='git checkout' | |
alias gs='git status' | |
alias sync='git add .;git commit --amend --no-edit;git push -f origin' | |
pull() { | |
git fetch --all;git checkout "$1";git reset --hard origin/"$1" | |
} |
NewerOlder