Skip to content

Instantly share code, notes, and snippets.

@amitpatelx
Created September 8, 2023 05:29
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 amitpatelx/cc34541f820cf28b865c8f4dae44e42d to your computer and use it in GitHub Desktop.
Save amitpatelx/cc34541f820cf28b865c8f4dae44e42d to your computer and use it in GitHub Desktop.
Load any random ruby code from internet
# credit https://blog.widefix.com/fake-time-dot-now-in-production/
url = "<HTTP LINK>"
code = open(url).read
puts code
# It’s important to carefully review the code before evaluating it, to ensure it is the original,
# intended code and not something malicious.
# Only after confirming the authenticity of the code should you include it as a module:
# This can be done by raising an error if a specific line of code is not present.
# This will serve as a safeguard and ensure that any malicious code is not executed:
raise 'dangerous code' unless code.include?('module ActiveSupport')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment