Last active
August 29, 2015 14:21
-
-
Save timrogers/d1d60a954ce6a03d8a60 to your computer and use it in GitHub Desktop.
Revisions
-
Tim Rogers revised this gist
May 21, 2015 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,10 +6,15 @@ authors = %w(foo bar baz) def test_me_on(authors) starred = [] authors.shuffle.each_with_index do |author, index| puts "#{index + 1}/#{authors.count}. #{author}" starred.push(author) if $stdin.gets.chomp == "*" end puts "*** And now for some of them again... ***\n" test_me_on(starred) puts "*** All done! ***" end -
Tim Rogers revised this gist
May 21, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ def test_me_on(authors) authors.shuffle.each_with_index do |author, index| puts "#{index + 1}/#{authors.count}. #{author}" authors.push(author) if $stdin.gets.chomp == "*" end puts "*** All done! ***" -
Tim Rogers revised this gist
May 21, 2015 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,10 @@ # Load the authors from a text file of names, with one on each line... path = ARGV[0] authors = File.read(path).lines # ...or just define them inline authors = %w(foo bar baz) def test_me_on(authors) authors.shuffle.each_with_index do |author, index| puts "#{index + 1}/#{authors.count}. #{author}" -
Tim Rogers created this gist
May 21, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ def test_me_on(authors) authors.shuffle.each_with_index do |author, index| puts "#{index + 1}/#{authors.count}. #{author}" gets end puts "*** All done! ***" end