#Week 2 - Day 6
Ruby has open classes. You can modify them at any time anywhere in your code.
"Monkey Patching".
Giving a default value is giving a value after: def method(argument=default value).
####How the Internet works?
99 bottles exercise : (https://gist.github.com/wofockham/e6fa9547f5f0001c7a8c) HappiTails: https://gist.github.com/wofockham/1cbb5fb3fcf592a42431 MTA LAb: https://gist.github.com/wofockham/952456677b929de04497 Stock Exchange: https://gist.github.com/wofockham/139e2e52c7ebedf28abf Arrays & Hashes: https://gist.github.com/wofockham/6ae8484378ed60538756 Calculator: https://github.com/wofockham/wdi-4/blob/master/01-ruby/calcit.rb Nix's notes: https://gist.github.com/nizmox/9198327
ifconfig in Terminal
python -m SimpleHTTPServer
http://www.evolutionoftheweb.com/
"Don't break the web"
####Sinatra
sinatra is a DSL to describe in an easy way how a server should work.
sinatrarb.com - Read the readme file and documentation file.
telnet www.google.com 80
Shows all the ruby processes that are running: ps aux | grep rub than you can kill this program
omdpapi.com for homework
in irb write in my code require 'httparty' title = params[:movie_title] url ="http://www.omdbapi.com/?t=#{title}"
response = HTTParty.get url
require 'JSON' movie = JSON(response) movie['key']
Include at least title and poster.
if movie has space in the title = url = "http://www.omdbapi.com/?t=#{title.gsub(' ', '+')}"