Skip to content

Instantly share code, notes, and snippets.

@cabo
Last active February 22, 2021 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cabo/c3c98a20a119ad1df5bdfa3dd5ed4325 to your computer and use it in GitHub Desktop.
Save cabo/c3c98a20a119ad1df5bdfa3dd5ed4325 to your computer and use it in GitHub Desktop.
#!/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