Introductions/Icebreaker
Introduction to web development tools (Atom and your browser)
Getting started with your first CSE 154 Git Repository (CP1)
Review HTML
Fitz has OHs tomorrow from 3:30 - 4:20pm (right after lecture) in CSE 218
If you are runnning into any issues, have unanswered questions or need any other help you are encouraged to stop by.
<ta>Hello world!</ta>
These slides are here for reference to help you set up your environment. There are three main steps you need to complete in order to work on assignments:
You will want to make a directory to store all of your work for this class. This will make it easy to keep track of your repositories.
Once you have Git set up, you will clone your assignment repositories into it to work on them.
To get started with your first website, you need 1) a text editor like Atom and 2) a browser.
You should have Atom installed on your machine. This is what we will be supporting for developing websites over the quarter. Note: if you prefer another editor such as Sublime, VSCode, Vim, etc. you may use it but TA's will not be expected to help with these. Atom has some useful packages you can install, as covered in the tutorial.
Students are expected to use the Chrome browser for this class due to its web development features, as well as accessibility tools that are not supported on other browsers. Note that when browsing the web, you need Internet access. But when writing HTML webpages, you don't!
Writing HTML and CSS with an editor is similar to writing Java in an IDE like jGrasp or Eclipse, or writing Python on the command line or your Python IDE of choice. Conveniently, we don't need to compile HTML/CSS, and to "run" the code, we just open the HTML page on the browser.
If you prefer another text editor like VisualStudio, Vim, or Emacs, these all work as well (but we won't go into the details for each).
Finally, you will want to get git installed on your computer. You can choose between Git in atom, or Git on the command line. As you follow through the relevant guide in the walkthrough, accept and clone your creative project 1 into the directory you set up and you will be ready to work on it!
If you use outside resources on creative projects - be it images, code templates, or just for inspiration - you should cite it.
You can cite your sources in the source code by placing a comment with the source above the code/resource, but it is even better practice to cite your sources on the page in a footer.
A failure to cite sources can constitute plagiarism, so if in doubt, please cite!
<!-- Retrieved from https://imgur.com/bleg -->
<img src="puppy.png" alt="A cute pupper" />
Remember to read Wednesday's reading (this overview of HTML) if you haven't yet!
Note: These are required to keep up with the course and are a replacement to a course textbook.
There are many different types of HTML tags used to structure web pages (we can't possibly cover all of them within class). We've consolidated a handy slide deck with examples of common tags you should know , but you can find a comprehensive list on MDN (it's a great bookmark page for reference this quarter!)
To familiarize ourselves with HTML, let's use the slide deck linked on the previous slide to give HTML structure to this text file.
<h1>THE RUBIK'S CUBE</h1>
<p>
The Rubik's Cube is one of the most fascinating physical puzzles ever made.
While simple in it's design, they are <em>tough</em> to solve!
</p>
<h2>Here are three great things about the Rubik's Cube:</h2>
<ol>
<li>
Speed-solving a Rubik's Cube is a fun goal to strive towards,
and you can even participate in competitions!
</li>
<li>The Rubik's Cube comes in a variety of shapes and sizes:
<ul>
<li>The 2x2 Rubik's Cube is perfect for introducing puzzles to kids!</li>
<li>The 3x3 Rubik's Cube is a classic, and has a lot of depth</li>
<li>The largest solved Rubik's Cube was 17x17, solved in 7.5 hours!</li>
</ul>
</li>
<li>Novel Rubik's Cube designs make for great desk-toppers!</li>
</ol>
<p>
If you want to learn how to solve a Rubik's Cube, go to
<a href="https://www.rubiks.com/how-to-solve-rubiks-cube">this link</a>!
</p>
New to the bash terminal? It's just like a text-based alternative to your computer's file-finder GUI, but with a ton of features to edit and run different programs in the same location. Here are some tips for getting around the command line! To learn more, use the handy "down" feature of these slides :)
"list" files & directories
ls
"change directory" - changes directory to the given path (relative to the current working directory)
cd [folder-name]
cd [folder-name]
The current working directory refers to the directory your command line is currently targeting.
Any command line commands (including git commands) will apply to the current working directory.
It is often helpful to use ls
to check where your current directory is.
ls
cd
to navigate your filesystem in the command linecd
cd can be used with relative paths (assuming "folder-name" is a child of the current working directory)...
cd [folder-name]
...or with absolute paths
cd C:\windows\system32
cd ~/Documents/cse154/cp1-html-css/
Can use cd to move up one directory
cd ..
Copy the URL of the repository on GitLab
Use ls
and cd
to navigate to the directory where you want to store your Git repositories (e.g. cse154/assignments/), then type:
git clone [repository-path]
This creates a copy of the repository in your current working directory. You will one have repository per assignment.
The following commands need to be executed inside the repository folder that you cloned every time you want to update the repository online.
Click each link or press the down key to learn more about each step!
git add [filename]
Specifies changed files for the next commit.
To add multiple specific files:
git add [file1] [file2] [etc...]
To add everything in the current directory:
git add .
git commit -m "descriptive message"
Commits your added changes with a descriptive commit message (local to your computer until next push)
git push origin master
Updates your online Git repository with all of your committed changes (internet required)
Command | Description |
---|---|
git clone [link to repository] | Download a local copy of a Git repository |
git add [filename] | Proposes changes to be committed |
git commit -m "message" | Commits changes locally with a descriptive message |
git push | Pushes to remote (online) repository |