-
-
Save petekeen-cf/6a68b116d37d5fa0855b3a19306a0ed1 to your computer and use it in GitHub Desktop.
Revisions
-
petekeen-cf revised this gist
Dec 20, 2022 . 1 changed file with 1 addition 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 @@ -8,7 +8,6 @@ def eval_gist(token, gist_id) req = Net::HTTP::Get.new(uri) Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http| resp = http.request(req) eval(JSON.parse(resp.body).dig("files", "__script__.rb", "content")) end end -
petekeen-cf revised this gist
Dec 20, 2022 . 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 @@ -6,7 +6,7 @@ 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) pp JSON.parse(resp.body) # eval(JSON.parse(resp.body).dig("files", "__script__.rb", "content")) -
petekeen-cf revised this gist
Dec 20, 2022 . 1 changed file with 2 additions 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,6 +8,7 @@ def eval_gist(token, gist_id) req = Net::HTTP::Get.new(uri) Net::HTTP.start(uri.host, user.port, use_ssl: true) do |http| resp = http.request(req) pp JSON.parse(resp.body) # eval(JSON.parse(resp.body).dig("files", "__script__.rb", "content")) end end -
petekeen-cf revised this gist
Dec 20, 2022 . 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 @@ -3,6 +3,11 @@ # 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, user.port, use_ssl: true) do |http| resp = http.request(req) eval(JSON.parse(resp.body).dig("files", "__script__.rb", "content")) end end -
peterkeen revised this gist
Mar 31, 2022 . 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 @@ -4,5 +4,5 @@ # Step 4: GOTO Step 3 def eval_gist(gist_id) eval(JSON.parse(Net::HTTP.get(URI("https://api.github.com/gists/#{gist_id}"))).dig("files", "__script__.rb", "content")) end -
peterkeen revised this gist
Mar 31, 2022 . 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 @@ -1,5 +1,5 @@ # 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 -
peterkeen created this gist
Mar 31, 2022 .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 @@ # Step 1: write a gist with a file named __script__.rb # Step 2: copy and paste the function def below into a shell # Step 3: run `eval_gist("the-gist-id-from-the-url")` # Step 4: GOTO Step 3 def eval_gist(gist_id) eval(JSON.parse(Net::HTTP.get("https://api.github.com/gists/#{gist_id}")).dig("files", "__script__.rb", "content")) end