Skip to content

Instantly share code, notes, and snippets.

View joshbeitler's full-sized avatar
⌨️
Typing...

Josh Beitler joshbeitler

⌨️
Typing...
View GitHub Profile
require 'net/http'
require 'uri'
def download(url)
Thread.new do
thread = Thread.current
body = thread[:body] = []
url = URI.parse url
Net::HTTP.new(url.host, url.port).request_get(url.path) do |response|