- Living and Working Abroad
- Working Remote Around the World
- You're Going Where?
- Patagonia?
- That Patagonia
- Argentina and South America
- A world away
- Make amazing friends
- Learn new things every day
- AMAZING food/wine
The internet is just "client sends an HTTP request to the server, which sends back an HTTP response" where client is usually web browser. Sending an HTTP request is like writing to a file that goes across the internet, and reading from a file that came from the internet. So to understand the web, the most important thing is to understand HTTP requests. Then, you can go to Sinatra, and it will be "this is how Sinatra does that underlying thing you already know".
To see the request, go to the terminal and type nc -l 3000
(the number is called a port, it's like an index in an array, you put a program there, then when a web request comes in, it checks the port, finds the program, and hands it the incoming request). The specific number isn't important, as long as its big enough to get past the claimed ones. Now that you have that running, set it on one side of your screen, and set your browser on the other side. Then type `http:/
require 'prime' | |
class Prime | |
def self.fib(n) | |
if n == 0 | |
return 0 | |
end | |
(2..n).reduce([0,1]) do |total, n| | |
total << total[-1] + total[-2] | |
end |
puts "Top Level" | |
puts "self is #{self}" | |
class C | |
puts "Class definition block:" | |
puts "self is #{self}" | |
def self.x | |
puts "Class method C.x:" | |
puts "self is #{self}" |