Last active
August 29, 2015 13:57
-
-
Save mathildathompson/9358020 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #http - tells you to use port 80; | |
| #ftp | |
| #irc | |
| #http = hypertext transfer protocol; | |
| #http://www.cnn.com/latest?q=idiots | |
| # http://www.cnn.com (webserver that it lives on(domain, ip address)) / latest? (this is the path) ?q=idiots (this is the query string) | |
| # This is an example of a path -> get 'hello' (which part of the server we are accessing, which bit of code to execute) | |
| ##HTTP VERBS | |
| #GET | |
| #POST | |
| #A link is a get request, nearly everything that happends on the web is a GET request; | |
| #A get request will return the same result; | |
| #A post is when you want to send data to the server, such as logging into an account; | |
| # 404 - resource not found, the server says you have asked for something that is not found; | |
| # 304 - nothing has changed; | |
| # 200 - resource found; | |
| #When you submit a form with an method 'GET' key value pairs in URL separated by & are put into the params array; | |
| #Using a get in a form is a bad idea, it reveals all of the data in the URL, this is not secure; | |
| # When you send data to the server you need to use a POST request; | |
| # You need to change the http verb in main.rb to a POST | |
| post '/processform' do | |
| end | |
| #If you submit data in a post request the data is still sent to the server, but not not in the URL - much more secure | |
| #Sends the data along as extra data in the header; | |
| #The purpose of a get is to receive data from the server & the purpose of a post is to send data to the server; | |
| #A get request is bookmarkable, a post request is not; | |
| # The URLs to get the contact form and the URL to post the form data into should both be the same, just with different verbs; | |
| get '/contact do | |
| erb :contact | |
| end | |
| post '/contact/ do | |
| erb :thank_you | |
| end | |
| ###CSS POSITIONING | |
| ##Hiding an image | |
| #visibility: hidden; (It still saves place on the page where the image was, you just cant see it); | |
| #display:none; (It is still in the html, but not displayed in the broswer (space where it would be is removed); | |
| ##POSITIONING (tells the browser how to put something on the page) | |
| #Static (You never need to mention this position in real life because it is the default position) | |
| #Absolute (Position the element in relation to its first parent that has position relative (if it has not parent with relative positioning, then it will position in relation to the window)) | |
| #Relative (If a div has position relative, the things inside it will be positioned in relation to this div) | |
| #Fixed (Fixed in position with respect to the window) (You can give position fixed bottom and right values: bottom: 0 right: 0)(Fixed positioning is useful for navigation menus, broken in lots of mobile browsers); | |
| ##Z-INDEX | |
| #Allows you to control the order things are stakced in; | |
| #Remember z-index only works with absolutly positioned elements in the page; | |
| ###MOVIES 3 | |
| ##If the file cant be found in the routes the next place to look is the public folder; | |
| ## Anything that is common to the whole site you put in the layout.erb file; | |
| #RESOURCES | |
| ##https://developer.mozilla.org/en-US/ | |
| #TO DOWNLOAD FILES FROM THE COMMAND LINE | |
| curl https://gist.github.com/mathildathompson/9358020 > normalize.css | |
| - To have a look at normalize.css less normalize.css | |
| #Rebuild movies as a multi page site; | |
| #Add a nav section; | |
| #We want to be able to do a partial search. If I search for Jaws it gives me back the 5 results that fi | |
| #JSON lint checks if the JSON is valid and tidies it up; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment