Skip to content

Instantly share code, notes, and snippets.

@coleww
Last active August 29, 2015 14:05
Show Gist options
  • Save coleww/3771e718dc4778c40a0f to your computer and use it in GitHub Desktop.
Save coleww/3771e718dc4778c40a0f to your computer and use it in GitHub Desktop.
$.get() in Ruby
require 'open-uri'
def get url, callback
Thread.new { callback[open url, &-> (u) { u.read }] }
end
get 'http://colewillsea.com', (method :puts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment