Skip to content

Instantly share code, notes, and snippets.

@hitode909

hitode909/a.rb Secret

Last active February 16, 2017 11:19
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 hitode909/591cea20bb5c2af5b4162edf48d0d512 to your computer and use it in GitHub Desktop.
Save hitode909/591cea20bb5c2af5b4162edf48d0d512 to your computer and use it in GitHub Desktop.
`git grep --name-only -P '^ +//' -- src/js/`.split(/\n/).each{|path| source=open(path).read; open(path, 'w'){|f| f.write source.gsub(/^( +)\/\//){|space| ' '*(space.length/2-1) +'//'} } }
`git grep --name-only -P '^ +/\*' -- src/js/`.split(/\n/).each{|path| source=open(path).read; open(path, 'w'){|f| f.write source.gsub(/^( +)\/\*/){|space| ' '*(space.length/2-1) +'/*'} } }
`git grep --name-only -P '^ +\\*' -- src/js/`.split(/\n/).each{|path| source=open(path).read; open(path, 'w'){|f| f.write source.gsub(/^( +)\*/){|space| ' '*(space.length/2-1) +' *'} } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment