Skip to content

Instantly share code, notes, and snippets.

@JonathanWThom
Last active September 18, 2018 05:30
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 JonathanWThom/e7db87cd962ba6cb454d4163ff988152 to your computer and use it in GitHub Desktop.
Save JonathanWThom/e7db87cd962ba6cb454d4163ff988152 to your computer and use it in GitHub Desktop.
Read current file, write current file's contents to current file, and execute again. Gets out of hand quickly.
# You'll probably want to Ctrl+C out of this one pretty quickly.
File.open($0, "r+") do |f|
content = f.read
puts content
f << content
f.close
sleep 5
system "ruby", $0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment