Skip to content

Commit 6fc0545

Browse files
authored
Merge pull request #17 from microsoft/alfredodeza-patch-1
Update Python and JS lessons based on feedback
2 parents 14259d4 + 5ae2b04 commit 6fc0545

File tree

2 files changed

+12
-14
lines changed
  • 04-Harnessing-GitHub-Copilot-with-JavaScript
  • 05-Harnessing-GitHub-Copilot-with-Python

2 files changed

+12
-14
lines changed

04-Harnessing-GitHub-Copilot-with-JavaScript/README.MD

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const siteProps = {
6464

6565
### 🔎 Step 2: Animate the social media icons with a prompt
6666

67-
An animation can make the social media section more eye-catching. Next, lets ask Copilot’s help to animate the icons. Write the following prompt in the `src/styles.css` file:
67+
An animation can make the social media section more eye-catching. Ask Copilot’s help to animate the icons. Write the following prompt in the `src/styles.css` file:
6868

6969
```css
7070
/* add an amazing animation to the social icons */
@@ -91,11 +91,16 @@ img.socialIcon:hover {
9191
}
9292
```
9393

94-
### 🚀 Step 3: Work with the suggestion
94+
### 🚀 Step 3: Find out how to run the app
95+
Open GitHub Copilot chat by clicking on the chat icon on the left side bar and use the input section to ask the following:
9596

96-
Accept the suggestion by pressing the tab key. If you don't receive the exact same suggestion, then you can either experiment with the suggestion provided or keep typing the CSS code until it matches.
97+
```
98+
@workspace I want to understand how can I run this React application
99+
```
97100

98-
Your site should already be running in your Codespace, and the change will reload onto the page automatically. To see them, hover over one of your social media icons in the footer to see the magic!
101+
The prompts uses `@workspace` which is a special feature of GitHub Copilot chat that allows you to include more context for a more complete answer. Try out other queries using the chat panel for a more interactive workflow.
99102

103+
### Conclusion
104+
Your site should already be running in your Codespace, and the change will reload onto the page automatically. To see them, hover over one of your social media icons in the footer to see the magic!
100105

101-
Congratulations, through the exercise, you haven't only used copilot to generate code but also done it in an interactive and fun way! You can use GitHub Copilot to not only generate code, but write documentation, test your applications and more.
106+
Congratulations, through the exercise, you have use GitHub Copilot to generate code and also done it in an interactive and fun way! You can use GitHub Copilot to not only generate code, but write documentation, test your applications and more.

05-Harnessing-GitHub-Copilot-with-Python/README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,14 @@ Next, generate a new endpoint with GitHub Copilot by adding the comment:
5656
# Create a FastAPI endpoint that accepts a POST request with a JSON body containing a single field called "text" and returns a checksum of the text
5757
```
5858

59-
### 🐍 Step 3: Add necessary imports
59+
### 🐍 Step 3: Explain code
6060

61-
The generated code causes the application to crash. The crash happens because the `base64` and `os` modules aren't imported. Add the following lines to the top of the file:
62-
63-
```python
64-
import base64
65-
import os
66-
```
61+
The `generate()` route creates a pseudo-random token ID using a single line that might be difficult to fully understand. Select the whole function, and then right click on the selection, then select the Copilot menu item, and then the _"Explain This"_ option. The GitHub Copilot chat interface will open to the left and provide you a useful explanation which you can use to interactively ask more questions.
6762

6863
Finally, verify the new endpoint is working by trying it out by going to the `/docs` endpoint and confirming that the endpoint shows up.
6964

70-
7165
🚀 Congratulations, through the exercise, you haven't only used copilot to generate code but also done it in an interactive and fun way! You can use GitHub Copilot to not only generate code, but write documentation, test your applications and more.
7266

73-
7467
## Legal Notices
7568

7669
Microsoft and any contributors grant you a license to the Microsoft documentation and other content

0 commit comments

Comments
 (0)