Skip to content

Instantly share code, notes, and snippets.

@redperadot
Created July 31, 2014 19:51
Show Gist options
  • Save redperadot/e6231470ff78b5aea494 to your computer and use it in GitHub Desktop.
Save redperadot/e6231470ff78b5aea494 to your computer and use it in GitHub Desktop.
A simple script to play vt100 animations.
#!/usr/bin/env ruby
#
# vtplayer.rb - A simple script to play vt100 animations.
# Made with ❤︎ by redperadot@darkgem.net - v0.1
#
# Some places to find vt100 animations:
# http://artscene.textfiles.com/vt100/
# http://www.scovetta.com/archives/textfiles/art
require 'open-uri'
Signal.trap("INT") { puts; exit 0 }
abort("[Error] Need a file to play. Give the path of a remote or local file as an argument.") if ARGV[0].nil?
path = ARGV[0]
file = ( path[0,4] == 'http' ? open(path).read : IO.read(path) )
$stdout.sync = true
file.each_char do |char|
print char
sleep 0.0005
end
puts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment