Just for fun, I do not recommend using this
Ever heard of I18n
? Probably. But do you know what it stands for? Internationalization.
There's a few other common ones as well
l10n
localizationk8s
kubernetes
Okay, so now you too want to use it everywhere, obviously. Here's a script that abbreviates its input. (each word).
~/.bin/abbrev
#!/usr/bin/env ruby
abbrev_words = ARGV.to_a.map do |input|
left, *mid, right = input.split("")
"#{left}#{mid.size}#{right}"
end
puts abbrev_words.join(" ")
Examples
❯❯❯ abbrev Internationalization
I18n
❯❯❯ abbrev localization
l10n
❯❯❯ abbrev translation
t9n
❯❯❯ abbrev kubernetes
k8s
❯❯❯ abbrev Github
G4b
A colleague ran into an issue where we had too long cron syslog ids with Nanobox. Couldn't be more than 15 characters
Here's my joke suggestion for how to make it shorter.
❯❯❯ abbrev remind inactive users
r4d i6e u3s
❯❯❯ abbrev delete inactive users
d4e i6e u3s
❯❯❯ abbrev Import arbetsformedlingen ads
I4t a16n a1s