-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
A little hack to show a QRCode on the terminal with two pixels per terminal row.
julia> pixel_char(x) = all(x) ? '█' : x[1] ? '▀' : x[2] ? '▄' : ' '
julia> qr_string(d) = join((String(pixel_char.(eachcol(d[i:i+1,:]))) for i in 1:2:d.dims[1]-1), "\n")
julia> qrcode("http://julialang.org") |> qr_string |> print
█▀▀▀▀▀█ ▄ ▀▄ ▄█ █▀▀▀▀▀█
█ ███ █ █▀█▄█▄▀▄█ █ ███ █
█ ▀▀▀ █ █▄▄█▄▀ ▄ █ ▀▀▀ █
▀▀▀▀▀▀▀ █ ▀▄▀ ▀▄█ ▀▀▀▀▀▀▀
▀▄▄▄ ▄▀ █▀▀ █▀██ ▀▀▄▄███
▄█▄▀▄ ▀▀ ▄▄▄▀▀██▄▀▄█ █ ▀█
█▄██▀▄▀█▀█▄▀▄█▀▄█ ▀▄ ▄▀
█ ▀█▀▄▀█▄▀ ▄██▀█▄▄ ▀▀▄▀█
▀ ▀▀ ▀▀█ ▄ ▀ ▀▀█▀▀▀█ █
█▀▀▀▀▀█ ██▄▀▀█▄█ ▀ █▀ █
█ ███ █ ██▀▄▄ ▀███▀▀█▀██
█ ▀▀▀ █ ▀▄ ▄█▀ █ ▄█▄ ▀ █
▀▀▀▀▀▀▀ ▀▀ ▀▀▀ ▀ ▀ ▀ ▀ RexWzhRexWzh
Metadata
Metadata
Assignees
Labels
No labels