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
#!/bin/bash | |
set -euxo pipefail | |
MB=100 | |
NUMSECTORS=$((MB * 1024 * 1024 / 512)) # A sector is 512 bytes. | |
# "hdiutil attach" outputs extra spaces/tabs. They must be removed. | |
MYDEV="$(hdiutil attach -nomount "ram://$NUMSECTORS" | sed 's/[ \t]*$//')" |
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
#!/bin/bash | |
set -euxo pipefail | |
# These parameters are taken from: | |
# https://developers.google.com/assistant/tools/audio-loudness | |
TARGET_LUFS=-16 | |
TP=-1.5 | |
LRA=11 |
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
#!/usr/bin/env ruby | |
require 'date' | |
require 'json' | |
# cstimer data format: | |
# | |
# { | |
# "session1": [Solve, ...], | |
# "session2": [Solve, ...], |
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
vim9script | |
# "A is 0" in legacy Vim script is an idiom to compare values which might be | |
# different types. This is especially useful to check the existence of a key | |
# in a dictionary and to use its value if that key exists. For example: | |
# | |
# let Hook = get(g:config, 'hook', 0) | |
# if Hook is 0 | |
# return | |
# endif |
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
i='input.psd[1]' | |
magick -background None -gravity Center -virtual-pixel Edge \ | |
"$i" -colorspace RGB \ | |
\( -clone 0 -resize "1242x2208^" -blur 0x16 -extent 1242x2208 \) \ | |
\( -size 1242x2208 xc:#000C \) \ | |
\( -clone 0 -resize "1242x$((2208 - 276 - 60))^" -gravity South -extent 1242x2208+0-276 \) \ | |
-delete 0 \ | |
-flatten \ | |
,home.png | |
magick -background None -gravity Center -virtual-pixel Edge \ |
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
#!/bin/bash | |
set -euo pipefail | |
trap "rm -f ,$$,*" EXIT | |
border=3 | |
colors=256 | |
delay=8 | |
frames=24 |
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
#!/bin/bash | |
set -euo pipefail | |
trap "rm -f ,$$,*" EXIT | |
border=4 | |
colors=256 | |
delay=6 | |
frames=30 |
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
# Tweaked http://www.imagemagick.org/Usage/thumbnails/#rounded_border | |
convert -size 500x500 -alpha transparent xc:none -fill none -stroke black -strokewidth 4 -draw 'roundrectangle 1,1 498,498 12,12' ,border.png | |
convert -size 500x500 -alpha transparent xc:white -fill black -stroke transparent -strokewidth 4 -draw 'roundrectangle 0,0 499,499 12,12' ,mask.png | |
convert -background black src.jpg -resize '500^x500^' -gravity center -extent 500x500 -alpha set \ | |
,mask.png -compose DstIn -composite \ | |
,border.png -compose Over -composite \ | |
bordered.jpg |
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
convert m.png -gravity west -resize 3840x2160 -extent 10x ,left.png | |
convert m.png -gravity east -resize 3840x2160 -extent 40x ,right.png | |
convert \ | |
\( ,left.png -gravity west -resize '2160x2160!' -blur 0x20 \) \ | |
\( m.png -gravity center -resize '3840x2160' \) \ | |
\( ,right.png -gravity east -resize '2160x2160!' -blur 0x20 \) \ | |
+append ,base.png | |
convert ,base.png -gravity center -extent 3840x2160 -quality 90 ,t.jpg |
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
font=~/Library/Fonts/MyFavoriteFont.ttf | |
icon=apple-touch-icon.png | |
convert \ | |
-background transparent \ | |
-size 980x640 \ | |
\( \ | |
-background transparent -fill white \ | |
-font "$font" \ | |
-gravity center \ |
NewerOlder