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
const str = '2m20s' | |
const seconds = str.split(/(\d+\D)/ig).filter(n => n).map(s => s.split(/(\d+)/).filter(n => n)).reduce((acc, curr) => { | |
let sec = acc | |
if (curr[1] === 's') { | |
sec += parseInt(curr[0]) | |
} | |
if (curr[1] === 'm') { | |
sec += parseInt(curr[0]) * 60 | |
} |
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
#ref: https://serverfault.com/questions/750902/how-to-use-lets-encrypt-dns-challenge-validation | |
sudo certbot -d domain --manual --agree-tos --preferred-challenges dns certonly |
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
ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.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
ffmpeg -i input.mp3 -codec:a libmp3lame -qscale:a 5 output.mp3 |
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
{ | |
"editor.fontSize": 11, | |
"editor.fontFamily": "'Source Code Pro', Menlo, Monaco, 'Courier New', monospace", | |
"editor.tabSize": 2, | |
"files.exclude": { | |
"**/.vscode": true, | |
"**/.storybook-dist": true, | |
"**/.cache": true, | |
"node_modules": true, | |
"**/.git": 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
gifsicle -d 12 -U input.gif `seq -f "#%g" 0 4 82` -O2 -o output.gif | |
# ^ timing ^ output | |
# ^ input file ^ start frame, every other, end frame |
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
# Ref: https://guides.wp-bullet.com/batch-optimize-jpg-lossy-linux-command-line-with-jpeg-recompress/ | |
# Run a quality check against each image, then compress using the best settings | |
brew install mozjpeg | |
find [path/to/images] -type f -iname '*.jpg' -exec jpeg-recompress --quality medium --min 60 --method smallfry \{} \{} \; | |
# Remove metadata from images | |
brew install exiftool | |
find [path/to/images] -type f -iname "*.jpg" -exec exiftool -overwrite_original -all= \{} \; |
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
find . -name "*.t1" -exec rename 's/\.t1$/.t2/' '{}' \; |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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
{ | |
"binary_file_patterns": | |
[ | |
"*.jpg", | |
"*.jpeg", | |
"*.png", | |
"*.gif", | |
"*.ttf", | |
"*.tga", | |
"*.dds", |
NewerOlder