Inspect a website like a string in Ruby
1 2 unset -f inspect_url 3 4 function inspect_url() { 5 /usr/bin/curl -L -s --max-time 10 "${@}" | ruby -n -e 'p $_.to_s' 6 return 0 7 } 8 9 inspect_url http://www.ruby-forum.com
13495 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
1 2 unset -f inspect_url 3 4 function inspect_url() { 5 /usr/bin/curl -L -s --max-time 10 "${@}" | ruby -n -e 'p $_.to_s' 6 return 0 7 } 8 9 inspect_url http://www.ruby-forum.com
1 2 import inspect 3 4 def info(): 5 loc = inspect.currentframe(1).f_locals # its locals 6 glob = inspect.currentframe(1).f_globals # its globals 7 fct = inspect.currentframe(1).f_code.co_name #calling function