HTML
- The head element contains metadata, or information about the webpage.
- The meta tags tell browsers important information about the webpage and how to display it, and is critical for search engine optimization.
- The body element represents the visible content shown to the user.
- The heading tags are ordered from h1 to h6, from largest to smallest.
- List tags can either be ordered (numbered) or unordered (bulleted).
- List item tags each represent a new item in the list, and are nested within list tags.
- "Semantic" HTML tags describe the content they contain, such as:
<header>
<section>
<footer>
CSS
- CSS selectors point to the HTML elements you want to style.
- The declaration block contains one or more declarations separated by semicolons.Each declaration includes a CSS property name and a value, separated by a colon.
- Multiple CSS declarations are separated with semicolons, and declaration blocks are surrounded by curly braces.
- The CSS Box Model is a box that wraps around every HTML element. It consists of: content, padding, borders and margins.
- "Content" is the content of the box, where text and images appear.
- "Padding" is transparent space around the content.
- The "border" goes around the padding and the content.
- The "margin" is transparent space outside the border.
Git
cd <directory>
navigates to the specified directory inside the currently selected directory.
cd ..
backs out of currently selected directory.
mkdir <directory>
creates a new directory.
git init
initalizes a Git repo inside the directory we are currently in. Make sure you are in the root directory of the project you wish to initialize!
git clone <url>
fetches repo from hosted location via URL.
git status
checks what branch we are currently on and reports any files that are tracked/untracked.
git add -A:
adds all changes in the current working branch to the staging area.
git commit -m <describe changes here>
commits all staged changes to the repo. "-m" adds a commit message.
git branch
lists your branches, with an asterisk (*) to denote the currently active branch.
git branch <branch name>
creates a new branch at the current commit.
git merge <branch>
merges the specified branch into the current branch.
git log
shows the commit history for the currently-active branch.
git checkout -b <branch-name>
creates a new branch (-b) and switches to it (checkout).
git push origin <branch-name>
pushes local changes to an existing branch in the repo.
git pull origin <branch-name>
pulls the most recent build from the repo to local machine.
- It is important to always do a git pull to make sure that you have the latest version of the project on your local computer before you start to work. Otherwise, you might be working on outdated code!
git stash
saves modified and staged changes to a temporary staging area, in order to avoid losing work.
- GitHub's Git Cheat Sheet
JavaScript
- A variable is a named container that allows us to store data in our code.
- Control flow is the order in which a computer executes code in a script.
- JavaScript uses the keywords
var
, let
and const
to declare variables.
- Variables can hold different data types: strings, numbers, booleans, arrays, and objects.
- The equality operator (
==
) checks whether its two values are equal, returning a boolean result. It attempts to convert and compare values of different data types.
- The strict equality (
===
) operator checks whether two values are equal and of the same data type, and returns a boolean result (true/false).
- Functions are the building blocks of JavaScript. They allow you to store a piece of code that does a single task, and then reuse that code later using a short command, rather than retyping the code.
- Code after double slashes // or between /* and */ is treated as a comment. Comments are for human eyes only and are ignored by browsers and compilers. Comments are used explain the code's design and functionality, either to yourself or to your collaborators.