PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/r4fy.yml

https://github.com/felixgao/chitsheet
YAML | 10 lines | 7 code | 0 blank | 3 comment | 0 complexity | e9fc412af7ddf3d21a85d04a8ade907a MD5 | raw file
  1. ---
  2. r4fy: |-
  3. # double space a file
  4. $ ruby -pe 'puts' < file.txt
  5. # triple space a file
  6. $ ruby -pe '2.times {puts}' < file.txt
  7. # undo double-spacing (w/ and w/o whitespace in lines)
  8. $ ruby -lne 'BEGIN{$/="\n\n"}; puts $_' < file.txt
  9. $ ruby -ne 'BEGIN{$/="\n\n"}; puts $_.chomp' < file.txt
  10. $ ruby -e 'puts STDIN.readlines.to_s.gsub(/\n\n/, "\n")' < file.txt