Skip to content

Instantly share code, notes, and snippets.

@matstc
Created January 9, 2024 08:59
Show Gist options
  • Save matstc/d2bf1a7fe53555ea554382d01ae1ae4e to your computer and use it in GitHub Desktop.
Save matstc/d2bf1a7fe53555ea554382d01ae1ae4e to your computer and use it in GitHub Desktop.
Convert letters to squared equivalents and numbers to circled equivalents
#!/usr/bin/env ruby
#
# Adds a border around all the arguments passed to this script.
#
# Example:
#
# $ borderify hello you
# => πŸ„·β€―πŸ„΄β€―πŸ„»β€―πŸ„»β€―πŸ„Ύβ€― β€―πŸ…ˆβ€―πŸ„Ύβ€―πŸ…„
LOOKUP_TABLE = {
a: "πŸ„°",
b: "πŸ„±",
c: "πŸ„²",
d: "πŸ„³",
e: "πŸ„΄",
f: "πŸ„΅",
g: "πŸ„Ά",
h: "πŸ„·",
i: "πŸ„Έ",
j: "πŸ„Ή",
k: "πŸ„Ί",
l: "πŸ„»",
m: "πŸ„Ό",
n: "πŸ„½",
o: "πŸ„Ύ",
p: "πŸ„Ώ",
q: "πŸ…€",
r: "πŸ…",
s: "πŸ…‚",
t: "πŸ…ƒ",
u: "πŸ…„",
v: "πŸ……",
w: "πŸ…†",
x: "πŸ…‡",
y: "πŸ…ˆ",
z: "πŸ…‰",
"0": "β“ͺ",
"1": "β‘ ",
"2": "β‘‘",
"3": "β‘’",
"4": "β‘£",
"5": "β‘€",
"6": "β‘₯",
"7": "⑦",
"8": "⑧",
"9": "⑨",
}.freeze
print(
ARGV.join(" ")
.chars
.map { LOOKUP_TABLE[_1.downcase.to_sym] || _1 }
.join("\u202f") # no break thin space
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment