Created
May 12, 2018 16:05
-
-
Save halferty/7fe37bd473fa0e69dab512b6a65335e2 to your computer and use it in GitHub Desktop.
Make code-comment boxes with hashmark comments (#) or c-style comments (/**/)
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 | |
t=$*[0] | |
e='#'*79 | |
r='#'+' '*77+'#' | |
puts [e,r,t.scan(/.{1,40}/).map{|a|m=r.clone;l=(79-a.size)/2;m[l..(l+a.size-1)]=a;m},r,e].join "\n" |
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 | |
t=$*[0] | |
e='/'+'*'*77+'/' | |
r='/*'+' '*75+'*/' | |
puts [e,r,t.scan(/.{1,40}/).map{|a|m=r.clone;l=(79-a.size)/2;m[l..(l+a.size-1)]=a;m},r,e].join "\n" |
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 | |
t=$*[0];e='/'+'*'*77+'/';r='/*'+' '*75+'*/';puts [e,r,t.scan(/.{1,40}/).map{|a|m=r.clone;l=(79-a.size)/2;m[l..(l+a.size-1)]=a;m},r,e].join "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment