Skip to content

Instantly share code, notes, and snippets.

@tbierwirth
Last active June 24, 2019 04:01
Show Gist options
  • Save tbierwirth/1e99bcacd210f1cc62990a5086056b89 to your computer and use it in GitHub Desktop.
Save tbierwirth/1e99bcacd210f1cc62990a5086056b89 to your computer and use it in GitHub Desktop.

HTML

  1. What is HTML?
  • HTML (Hyper Text Markup Language) is a coding language used to structure and design webpages.
  1. What is an HTML element?
  • Building blocks of an HTML webpage that the browser uses to determines what is displayed and how it is displayed.
  1. What is an HTML attribute?
  • An attribute provides additional information to an element. For example: a link to an image, height/width of an object, or color/font/size of text.
  1. What is the difference between a class and an id? When would you use one vs. the other?
  • An element can only have one unique ID while a class can be used by multiple elemenets
  1. What HTML would you write to create a form for a new dog with a "name" and an "age"?

    <form>
      Name:<br>
      <input type="text">
      <br>
      Age:<br>
      <input type="text">
    </form>
    
  2. What are semantic tags? When would you use them over a div?

  • Semantic tags define their purpose in the name. You would use them over a div when you want the element to have unique styling.
  1. Explain what each of the following HTML tags do and when you would use them:
  • <h1>, <h2>, etc.
    • Headers - Used to display importance or the start of a paragraph. Search engines uses headings for indexing content on a webpage.
  • <p>
    • Paragraph - Holds a paragraph of text. Used when you want to include text content in a page.
  • <body>
    • Body - Defines where the visible content of a page is held. Always used when there is visible content.
  • <a> and the href attribute
    • Links - The <a> tag defines a link and href specifies the link address. Used to link to another page or website.
  • <img> and the src attribute
    • Images - The <img> tag defines an image and the src specifies the source of the image.
  • <div>
    • Divider - Defines a division or section of a page. Used when you want to combine multiple elements with the same styling.
  • <section>
    • Section - Defines a section on a page such as headers and footers.
  • <ul>, <ol>, and <li>
    • Lists - Unordered <ul> or ordered <ol>, each list items starts with <li> and is used for displaying text in listed format.
  • <form>
    • Form - Defines a form to collect user input. Used when you need a user to give some sort of input like text or chosing an option.
  • <input>
    • Input - Defines the type of input being given in a form. Used when you want to specify how a user is giving input (Ex. text or button option).

CSS

  1. What is CSS?
  • CSS (Cascading Style Sheets) describe how HTML elements are styled and displayed.
  1. What is a CSS selector? How do you use the ID selector? The class selector?
  • Selectors are used to specify which element(s) to be styled based on their name, id or class. To use the ID selector, prepend the id of the element with a hash (#). To use the class selector, prepend the name of the class with a period (.).
  1. What are the three ways to include CSS in your HTML documents? What are the pros and cons of each?
  • External Style Sheet: If you want your entire website to have the same style, this is a good method for doing that. It's all-or-nothing though and therefore you can not have uniquely styled elements unless you mix in other style sheets.
  • Internal Style Sheet: Used for styling one page and the code goes within the <head> of the HTML for that page. Allows for unique styling of pages but requires the code to be written for every page.
  • Inline Style: Used to style a single element. Useful if you want an element to be styled uniquely from other elements but requires more coding and you lose the advantages of a style sheet.
  1. What is the Box Model? Describe each component of the Box Model.
  • The CSS Box Model is the concept of a 'box' containing each HTML element (margin, borders, padding and the content of a page).
    • Margin - The outermost section of a page and is transparent.
    • Border - Within the margins, a border that surround the padding and content. Can be visible or transparent.
    • Padding - An area surrounding the content, within the borders and is transparent.
    • Content - Where all of the visible content for a page lives (text, images, etc.)

SQL

Jumpstart Lab Tutorial

  1. What is a database?
  • A structured collection of information.
  1. What is SQL?
  • SQL (Structured Query Language) is a programming language designed for interacting with databases.
  1. What is SQLite3?
  • A SQL-based database system that is good for local development but not advised to be used in production.
  1. What is a Table?
  • A structured collection of data that has rows and columns and holds values.
  1. What is a primary key?
  • A unique key that points to a value.
  1. What is a foreign key?
  • A key that acts as a reference to a value in a different table
  1. Explain what each of the following SQL commands do:
  • insert: Adds data into a table
  • select: Retrieves data from a table
  • where: Filters a select with given parameters
  • order by: Order the table alphabetically (default ascending)
  • inner join: Combine two or more tables

PG Exercises

  1. How can you limit which columns you select from a table?
  • SELECT 'column_name'
  1. How can you limit which rows you select from a table?
  • LIMIT 'number_of_rows'
  1. How can you give a selected column a different name in your output?
  • SELECT AS 'new_name'
  1. How can you sort your output from a SQL statement?
  • ORDER BY 'column_name'
  1. What is joining? When do you need to join?
  • A join query is one that accesses multiple rows of the same or different tables at one time. Used when you are associating one piece of data to another.
  1. What is an aggregate function?
  • A function that performs a calculation on a set of rows yet returns a single result.
  1. List three aggregate functions and what they do.
  • COUNT(): Returns the number of values
  • SUM(): Returns the sum of all values
  • MAX(): Returns the maximum value
  1. What does the group statement do?
  • GROUP BY separates the rows returned from a SELECT into specific groups.
  1. How does the group statement relate to aggregates?
  • For each GROUP you can apply an aggregate function.

Rack Tutorial

https://immense-citadel-98340.herokuapp.com/

  1. What is HTTP?
  • HTTP (HyperText Transfer Protocol) is a protocol used to transfer information (packets) over the internet between servers and clients.
  1. What is an HTTP Method (also known as an HTTP Verb)?
  • Indicates the desired action of the protocol. Ex. GET retrieve a page.
  1. What is an HTTP request?
  • A request sent to a server hosting a website for information on the page.
  1. Describe the three parts of the HTTP request line.
  • Request-Line: The HTTP Method being used
  • Headers: Additional information about the request passed to the server from the client
  • Body: Optional HTTP message data
  1. Describe the HTTP request headers.
  • Key/value pairs of information on the client provided to the server. Ex. browser being used and/or operating system.
  1. Describe the HTTP request body.
  • The body is optional for a HTTP request but it is used to explain the request being sent.
  1. What is an HTTP response?
  • A response is sent from the server to the client after a HTTP request has been made by the client.
  1. Describe the three parts of the HTTP status line.
  • Status-Line: Indicates the protocol the server is using, an HTTP status code and a short message relative to the status code.
  • Headers: Additional information about the response provided to the client
  • Body: The information (webpage) requested
  1. Describe the HTTP response headers.
  • Key/value pairs of information provided to the client like Content-Type or date of the response.
  1. Describe the HTTP response body.
  • The content that is delivered to the client's request, typically HTML, CSS or JavaScript (a webpage).
  1. What is a Web Framework?
  • Software designed to build and deploy web applications to the internet.
  1. What is a status code?
  • A numeric code indicating if the request was successfully completed or if there was an error.
  1. What does it mean to deploy your application?
  • To make the developed application available to clients via the internet.

Rails Tutorial: Task Manager

https://github.com/tbierwirth/task_manager

  1. Define CRUD.
  • Create, Read, Update and Delete. The four basic functions of an application or database.
  1. Define MVC.
  • Model View Controller (MVC) is an architectual pattern used to design and develop web applications.
  1. What three files would you need to create/modify for a Rails application to respond to a GET request to /tasks, assuming you have a Task model.
  • The controller.rb file, the config/routes.rb file and the views/index.html.erb file.
  1. What are params? Where do they come from?
  • An object created by Rails using information given from the parameters. Inherited from ApplicationController.
  1. Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task?
  • We need a post route to create a new task and a patch route to edit a task. post and patch do two different things.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment