Turn Awk snippets into images worth sharing, without leaving your Mac.
Awk one-liners are shared constantly and almost always as text, where the quoting gets mangled on the way.
Codeshot detects Awk from the code you paste, so there is no language picker to get wrong. Here is the same snippet in three of the 30 themes it ships with, rendered with the app's own stylesheets.
#!/usr/bin/awk -fBEGIN { FS = ","; printf("%-12s %s
", "THEME", "COUNT") }
{ counts[$1]++ }
END {
for (theme in counts)
printf("%-12s %d
", theme, counts[theme])
}
GitHub · dark
#!/usr/bin/awk -fBEGIN { FS = ","; printf("%-12s %s
", "THEME", "COUNT") }
{ counts[$1]++ }
END {
for (theme in counts)
printf("%-12s %d
", theme, counts[theme])
}
Solarized · dark
#!/usr/bin/awk -fBEGIN { FS = ","; printf("%-12s %s
", "THEME", "COUNT") }
{ counts[$1]++ }
END {
for (theme in counts)
printf("%-12s %d
", theme, counts[theme])
}
Tokyo Night · dark
Choosing a theme for Awk
If the snippet is a one-liner, put the plain text in the post as well. An awk program people have to retype from a picture will be retyped wrong.
Getting the size right
Let the image follow your content, or lock it to a ratio — 1:1, 4:3, 3:2, 16:9, 9:16, 2:3, or 3:4 — then export at 1×, 2×, or 3× so it stays sharp on a retina display. Copy it straight to the clipboard with ⌘⇧C, or save with ⌘S.