Skip to content

Instantly share code, notes, and snippets.

@charliegerard
Last active August 29, 2015 13:56
Show Gist options
  • Save charliegerard/9314675 to your computer and use it in GitHub Desktop.
Save charliegerard/9314675 to your computer and use it in GitHub Desktop.

#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

One to one https://docs.google.com/spreadsheet/ccc?key=0AveaZlVVweobdGdJX2luVzhuSzh1V2NVVm53QnBLOWc&usp=sharing#gid=0

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(' ', '+')}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment