Skip to content

Commit

Permalink
Merge branch 'main' into enum (#29099)
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-garwood committed Dec 11, 2024
2 parents d9af9ec + a765642 commit c08edb2
Show file tree
Hide file tree
Showing 32 changed files with 131 additions and 110 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/markdownlint-lessons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- '**.md'
- '!*'
- '!**/project_*'
- '!**/project-*'
- '!archive/**'
- '!templates/**'
- '!markdownlint/docs/**'
Expand All @@ -23,6 +24,7 @@ jobs:
**.md
!*
!**/project_*
!**/project-*
!archive/**
!templates/**
!markdownlint/docs/**
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/markdownlint-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
paths:
- '**/project_*.md'
- '**/project-*.md'
- '!*'
- '!archive/**'
- '!templates/**'
Expand All @@ -20,6 +21,7 @@ jobs:
with:
files: |
**/project_*.md
**/project-*.md
!*
!archive/**
!templates/**
Expand Down
7 changes: 4 additions & 3 deletions databases/databases/databases_and_sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ Now we're getting into the fun stuff. Aggregate functions like `COUNT` which re
SELECT users.id, users.name, COUNT(posts.id) AS posts_written
FROM users
JOIN posts ON users.id = posts.user_id
GROUP BY users.id;
GROUP BY users.id, users.name;
```

Note that grouping by `users.name` in addition to `users.id` improves clarity and aligns with best practices by explicitly including all selected non-aggregated columns in the `GROUP BY` clause, though it might not be strictly necessary for most databases.
See [W3Schools' browser-based SQL playground](http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_groupby) for an interactive visual.

The last nifty trick is if you want to only display a subset of your data. In a normal situation, you'd use a `WHERE` clause to narrow it down. But if you've used an aggregate function like `COUNT` (say to get the count of posts written for each user in the example above), `WHERE` won't work anymore. <span id='having-function'>So to conditionally retrieve records based on aggregate functions, you use the `HAVING` function, which is essentially the `WHERE` for aggregates</span>. So say you only want to display users who have written more than 10 posts:
Expand All @@ -112,8 +113,8 @@ The last nifty trick is if you want to only display a subset of your data. In a
SELECT users.id, users.name, COUNT(posts.id) AS posts_written
FROM users
JOIN posts ON users.id = posts.user_id
GROUP BY users.id
HAVING posts_written >= 10;
GROUP BY users.id, users.name
HAVING COUNT(posts.id) >= 10;
```

Try going back to [W3Schools' browser-based SQL playground](http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_groupby) and joining the `Customers` and the `Orders` tables to get the number of orders in each country and adding the line `HAVING COUNT(*) > 10;` after `GROUP BY` (and delete the extra semicolon in the previous line).
Expand Down
3 changes: 2 additions & 1 deletion foundations/introduction/join_the_odin_community.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ Sometimes there are misunderstandings and interactions go poorly. You are a volu
- **If you wouldn't say it out loud don't type it:** Plain and simple.
- **Ping (@user) with a purpose:** Only @ another user when it is necessary. Include your question or comment in the message. Wait until they reply before pinging again.
- **Don't 'bomb' chats:** Don't send multiple messages in a row; type out your whole message, then push send.
- **Don't exclude anyone:** These are public chats; if someone joins in on a conversation, include them!
- **Don't exclude anyone:** These are public chats; if someone joins in on a conversation, include them! The exception to this is when someone is helping a learner. Those need to be 1:1 conversations to not confuse the learner.
- **Don't disappear right after asking for help on code:** If you're posting a question, make sure you have time to stick around and discuss it with those trying to help!
- **Take some time to observe the server before jumping in:** This helps you understand how our community interacts and communicates.

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ You can find a more complete list with explanations of each event on [W3Schools

Manipulating web pages is the primary benefit of the JavaScript language! These techniques are things that you are likely to be messing with *every day* as a front-end developer, so let's practice!

1. Complete [MDN's Active Learning sections on DOM manipulation](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Manipulating_documents#active_learning_a_dynamic_shopping_list) to test your skills!
1. Complete [MDN's Active Learning sections on DOM manipulation](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Manipulating_documents#active_learning_basic_dom_manipulation) to test your skills!
1. Read the following sections from JavaScript Tutorial's series on the DOM to get a broader idea of how events can be used in your pages. Note that some of the methods like `getElementById` are older and see less use today.

As you read, remember that the general ideas can be applied to any event, not only the ones used in examples - but information specific to a certain event type can always be found by checking documentation.
Expand Down
2 changes: 1 addition & 1 deletion foundations/javascript_basics/object_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ increaseCounterPrimitive(primitive);

Take a moment and guess what will happen to `object` and what will happen to `primitive` after we make the function calls.

If you answered that the object counter would increase by 1, and the primitive counter wouldn't change, you're correct. Remember that the parameter `objectCounter` contains a *reference* to the same object as the `object` variable we gave it, while `primitiveCounter` contains only a copy of the primitive value only.
If you answered that the object counter would increase by 1, and the primitive counter wouldn't change, you're correct. Remember that the parameter `objectCounter` contains a *reference* to the same object as the `object` variable we gave it, while `primitiveCounter` only contains a copy of the primitive value.

<div class="lesson-note" markdown="1">

Expand Down
1 change: 1 addition & 0 deletions foundations/javascript_basics/project_calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Here are some use cases (expectations about your project):
- Pressing `=` before entering all of the numbers or an operator could cause problems!
- Pressing "clear" should wipe out any existing data. Make sure the user is really starting fresh after pressing "clear".
- Display a snarky error message if the user tries to divide by 0... and don't let it crash your calculator!
- Make sure that your calculator only runs an operation when supplied with two numbers and an operator by the user. Example: you enter a number (`2`), followed by an operator button (`+`). You press the operator button (`+`) a second consecutive time. Your calculator should not evaluate this as (`2 + 2`) and should not display the result (`4`). If consecutive operator buttons are pressed, your calculator should not run any evaluations, it should only take the last operator entered to be used for the next operation.

#### Extra credit

Expand Down
2 changes: 1 addition & 1 deletion foundations/javascript_basics/variables_and_operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Save and open this file up in a web browser and then open up the browser's conso
1. Click on "Inspect" or "Inspect Element" to open the Developer Tools.
1. Find and select the "Console" tab, where you should see the output of our `console.log` statement.

**Tip:** You can use [Live Preview extension in Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server) to automatically update the browser when you save your file instead of having to manually refresh the page to see any changes when you edit your code. Try edit the text to say something different!
**Tip:** You can use [Live Preview extension in Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server) to automatically update the browser when you save your file instead of having to manually refresh the page to see any changes when you edit your code. Try editing the text to say something different!

`console.log()` is the command to print something to the developer console in your browser. You can use this to print the results from any of the following articles and exercises to the console. We encourage you to code along with all of the examples in this and future lessons.

Expand Down
2 changes: 1 addition & 1 deletion getting_hired/applying_and_interviewing/applying.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The point here is really just to make sure you understand that it's a really ann

### Resume versions

If you're applying to several different types of positions, tailor your resume for the specific type of opportunity. Just remember that, if you're submitting it virtually, they can see the title.
If you're applying to several different types of positions, tailor your resume for the specific type of opportunity. Just remember that, if you're submitting it virtually, they can see the title. It's generally a good idea to set the file name of your resume to your name. This has the additional benefit of a recruiter seeing your name and remembering it.

It's also important to note that if you're not gaining traction getting responses with a certain resume, don't be afraid to switch it up. Keep track of the changes and see which version performs better than the others.

Expand Down
19 changes: 9 additions & 10 deletions git/intermediate_git/a_deeper_look_at_git.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ It is **very important** to take a look at all of this before progressing any fu

This section contains a general overview of topics that you will learn in this lesson.

- History-changing Git commands
- Different ways of changing history
- Using remotes to change history
- Dangers of history-changing operations
- Best practices of history-changing operations
- Pointers
- History-changing Git commands.
- Different ways of changing history.
- Using remotes to change history.
- Dangers of history-changing operations.
- Best practices of history-changing operations.
- Pointers.

### Changing history

Expand Down Expand Up @@ -142,7 +142,6 @@ You might be feeling overwhelmed at this point, so let's recap what we've learne
<div class="lesson-content__panel" markdown="1">

1. Read the chapter on [Rebasing covered by git-scm](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) for an even deeper dive into Rebasing.

1. Read the chapter on [Reset covered by git-scm](https://git-scm.com/book/en/v2/Git-Tools-Reset-Demystified) for a deeper dive into `git reset`.

</div>
Expand All @@ -151,9 +150,9 @@ You might be feeling overwhelmed at this point, so let's recap what we've learne

The following questions are an opportunity to reflect on key topics in this lesson. If you can't answer a question, click on it to review the material, but keep in mind you are not expected to memorize or master this knowledge.

- [Explain what it means for branches to be pointers.](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell)
- [How can you amend your last commit?](https://git-scm.com/book/en/v2/Git-Basics-Undoing-Things)
- [What are some different ways to rewrite history?](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History)
- [How can you amend your last commit?](#changing-the-last-commit)
- [What are some different ways to rewrite history?](#changing-multiple-commits)
- [What does it mean for branches to be pointers?](#branches-are-pointers)

### Additional resources

Expand Down
5 changes: 0 additions & 5 deletions git/intermediate_git/working_with_remotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ If you haven't updated your local branch, and you're attempting to `git push` a
You might perform a brief query and find the command `git push --force`. This command overwrites the remote repository with your own local history. So what would happen if we used this while working with others? Well, let's see what would happen when we're working with ourselves. Type the following commands into your terminal, and when the interactive rebase tool pops up remove our commit for `Create fourth file`:

```bash

git push origin main
git rebase -i --root
git push --force
git log

```

Huh, that's interesting. We can’t find our fourth file on our local system. Let's check our GitHub repository to see if it's there.
Expand All @@ -35,18 +33,15 @@ Oh no, we just destroyed it! In this scenario, the danger - you could potential
Let's consider a different scenario:

```bash

touch test4.md
git add test4.md && git commit -m "Create fifth file"
git push origin main
git log

```

We look at our commit message and realize *oops*, we made a mistake. We want to undo this commit and are once again tempted to just force the push. But wait, remember, this is a **very dangerous command**. If we're ever considering using it, always check if it's appropriate and if we can use a safer command instead. If we're collaborating with others and want to *undo* a commit we just made, we can instead use `git revert`!

```bash

git revert HEAD
git push origin main
```
Expand Down
2 changes: 1 addition & 1 deletion intermediate_html_css/grid/introduction_to_grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ For two-dimensional layouts, you learned a little bit about `flex-wrap`, which a

Remember how much fun you had solving the card layout in this exercise?

[![flex-exercise-desired-outcome.png](https://i.postimg.cc/vZ81HMkB/flex-exercise-desired-outcome.png)](https://github.com/TheOdinProject/css-exercises/tree/main/flex/07-flex-layout-2)
[![flex-exercise-desired-outcome.png](https://i.postimg.cc/vZ81HMkB/flex-exercise-desired-outcome.png)](https://github.com/TheOdinProject/css-exercises/tree/main/foundations/flex/07-flex-layout-2)

We know that was a frustrating one, but it's part of the point. While Flexbox allows you to build a layout of rows and columns together, it isn’t always easy.

Expand Down
Loading

0 comments on commit c08edb2

Please sign in to comment.