A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
function rext () { | |
if [ $# -lt 3 ]; then | |
echo 1>&2 "$0 needs 3 arguments as DIR SOURCE_EXT DEST_EXT" | |
else | |
for file in "$1"/*.$2; do | |
mv "$file" "${file%.$2}.$3" | |
done | |
fi | |
} |
If you're OK in having a node-esm
executable, please consider this solution.
#!/usr/bin/env sh
# the /usr/local/bin/node-esm executable
input_file=$1
shift
exec node --input-type=module - $@ <$input_file