Last active
February 22, 2021 16:43
-
-
Save cabo/c3c98a20a119ad1df5bdfa3dd5ed4325 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -Ku -pi.bak | |
$_.sub!(/^(.*?h')([A-Fa-f0-9]{67,})'/) { # 67!!! 1 byte slop, should be 65 | |
prefix = $1 | |
indent = " " * prefix.size | |
parts = $2.scan(/.{1,64}/) | |
"#{prefix}#{parts.join("\n#{indent}")}'" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment