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 toMagicArray = x => (Array.isArray(x) ? x : x.split(',')).filter(y => y); | |
// input: '56' output: ['56'] | |
// input: ['56', '6'] output: ['56', '6'] | |
// input: 56,6,3 output: ['56', '6', '3'] |
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
version: '3' | |
services: | |
redis: | |
image: 'bitnami/redis:latest' | |
ports: | |
- 6379:6379 | |
environment: | |
- REDIS_PASSWORD=password | |
- ALLOW_EMPTY_PASSWORD=yes |
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
#! usr/bin/bash | |
## execute: bash resize.sh /path/to/files | |
for f in "$1"/*.{jpg,png}; do | |
[ -f "$f" ] || continue #skip in case f is not a regular file. | |
base=$(basename "$f") | |
echo "Converting $1/${base%.*}.${base##*.}" | |
convert "$f" -resize 1920x1322 -gravity center -background white -extent 1600x1102 "$1/${base%.*}.${base##*.}" |