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
// iterate through | |
Object.entries(myObject).forEach(([key, value]) => { | |
console.log(`${key}: ${value}`) | |
}); | |
// return a new array | |
Object.entries(myObject).map(([key, value]) => { | |
return { | |
key, | |
value |
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
htpasswd -nbBC 10 USER topsecret | |
# USER:$2y$10$vDtCxgJ4DIZ1itAAq6NDkedmaDFHlPdlpLY.EiEa3QBXHnH0oLatW | |
# used with traefik | |
echo $(htpasswd -nb USER topsecret) | sed -e s/\\$/\\$\\$/g | |
# USER:$$apr1$$rjtvYgpl$$urvcY8G0rd9ZpskQc0u28. |
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
# ENCODING PARAMS (AOMENC): | |
--cpu-used=4 --end-usage=q --tile-columns=1 --tile-rows=1 | |
--bit-depth=10 --lag-in-frames=28 --threads=2 | |
--enable-dist-wtd-comp=0 --enable-qm=1 --quant-b-adapt=3 | |
--mv-cost-upd-freq=2 --enable-chroma-deltaq=1 | |
--enable-fwd-kf=1 | |
# av1an docker SDR 1080p (pre=6,cq=25,denoise=0,grain=15): | |
docker run --privileged -v "$(pwd):/videos" --user $(id -u):$(id -g) -it --rm masterofzen/av1an:master --encoder aom -s ./movie-scenes.json -c mkvmerge -m lsmash -k --workers 6 -a " -an " --video-params " --bit-depth=10 --cpu-used=6 --cq-level=25 --end-usage=q --lag-in-frames=48 --enable-fwd-kf=1 --aq-mode=1 --deltaq-mode=1 --enable-chroma-deltaq=1 --quant-b-adapt=1 --enable-qm=1 --min-q=1 --enable-keyframe-filtering=2 --arnr-strength=1 --arnr-maxframes=4 --disable-trellis-quant=0 --disable-kf --threads=64 --sharpness=3 --enable-dnl-denoising=0 --denoise-noise-level=15" -i "movie.1080.mkv" -o "movie-aom-pre6-cq25-sharp3-den0-gr15-kff2.mkv" |
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
# run specific method in a file | |
pytest app_folder/file.py -k "method keyword" | |
# enable debugger | |
pytest app_folder/file.py -k "method keyword" --pdb | |
# check for setup errors (wrong imports, etc) | |
pytest --setup-only |
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
# /etc/gdm/custom.conf | |
[daemon] | |
WaylandEnable=false | |
AutomaticLoginEnable=true | |
AutomaticLogin=$USERNAME |
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
sudo rm -rf $(xcode-select -print-path) | |
xcode-select --install | |
/usr/sbin/pkgutil --packages | grep CL | |
sudo npm install -g node-gyp |
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
# https://github.com/pyenv/pyenv/issues/108 | |
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.6.8 |
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
# BUILD FAILED (OS X 10.14.5 using python-build ...) | |
# zipimport.ZipImportError: can't decompress data; zlib not available | |
brew install zlib | |
export LDFLAGS="-L/usr/local/opt/zlib/lib" | |
export CPPFLAGS="-I/usr/local/opt/zlib/include" | |
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig" | |
export KEEP_BUILD_PATH=true |
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
# VirtualBox | |
# 1. add network adapter | |
# 2. select: host-only | |
# 3. select: vboxnet0 | |
# centos | |
cd /etc/sysconfig/network-scripts/ | |
cp ifcfg-enp0s3 ifcfg-enp0s8 |
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
array1.length === array2.length && array1.sort().every(function(value, index) { return value === array2.sort()[index]}); |
NewerOlder