Skip to content

Instantly share code, notes, and snippets.

@grahamhelton
Created May 31, 2025 00:28
Show Gist options
  • Save grahamhelton/632f2ce55ffbe8ba1e42694f563cbd22 to your computer and use it in GitHub Desktop.
Save grahamhelton/632f2ce55ffbe8ba1e42694f563cbd22 to your computer and use it in GitHub Desktop.
Alias to remove emojis from a file
alias remove-emojis='python3 -c "
import sys, unicodedata
with open(sys.argv[1], \"r\", encoding=\"utf-8\") as f:
text = f.read()
result = \"\".join(c for c in text if unicodedata.category(c) not in [\"So\", \"Sk\"])
print(result, end=\"\")
"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment