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 characters
# Step 1: write a gist with a file named __script__.rb | |
# Step 2: copy and paste the function def below into Rails console | |
# Step 3: run `eval_gist("the-gist-id-from-the-url")` | |
# Step 4: GOTO Step 3 | |
def eval_gist(token, gist_id) | |
uri = URI("https://api.github.com/gists/#{gist_id}") | |
req = Net::HTTP::Get.new(uri) | |
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http| | |
resp = http.request(req) |