Skip to content

Instantly share code, notes, and snippets.

@napcs
Last active July 20, 2016 16:01
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 napcs/a0d4197a8c4ef1ba9dbda55aa2086c03 to your computer and use it in GitHub Desktop.
Save napcs/a0d4197a8c4ef1ba9dbda55aa2086c03 to your computer and use it in GitHub Desktop.
copyedit script - shuffles file contents to help look for errors without being clouded by context.
# Shuffles file contents to help you find errors without being blinded by context.
# Displays original line number and the line text to help you fix errors.
# usage: ce.rb path/to/file
file = ARGV[0]
File.readlines(file)
.collect.with_index {|line, i| {line: i + 1, text: line} }
.shuffle.each {|line| puts "#{line[:line]}\t#{line[:text]}" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment