You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,11 @@ In order to successfully complete this module you will need to master the follow
27
27
28
28
This repository consists of 3 essential parts:
29
29
30
-
1.`Reading materials`: this document contains all the required theory you need to know _**while**_ you're coding. It's meant as both study material and as a reference to understand what you're doing.
31
-
2.`Homework`: this document contains the instructions for each week's homework.
32
-
3.`Lesson Plans`: this part is meant for teachers as a reference. However, as a student don't be shy to take a look at it as well!
30
+
1.`README`: this document contains all the required theory you need to understand **before** class. It's also meant as a reference to understand what you're doing while you're coding.
31
+
2.`MAKEME`: this document contains the instructions for each week's homework.
32
+
3.`LESSONPLAN`: this document is meant for teachers as a reference. However, as a student don't be shy to take a look at it as well!
33
33
34
-
After your first class you should start off with checking the `reading materials` for that week. At the beginning that would be the [Week 1 Reading](/Week1/README.md). Study all the concepts and try to get the gist of everything. After, you can get started with the `homework` for that week.
34
+
**Before** the first class of the module you should start off with the [Week 1 Reading](/Week1/README.md). Study all the concepts and try to get the gist of everything. After your first class, you can get started with the [Week 1 Homework](/Week1/MAKEME.md).
35
35
36
36
If you have any questions or if something is not entirely clear ¯\\\_(ツ)\_/¯, please ask/comment on Slack!
Copy file name to clipboardExpand all lines: Week1/MAKEME.md
+44-98Lines changed: 44 additions & 98 deletions
Original file line number
Diff line number
Diff line change
@@ -65,114 +65,60 @@ Enjoy!
65
65
66
66
## **4. PROJECT: Hack Your Repo I**
67
67
68
-
In the following three weeks you are going to write a _Single Page Application_ (SPA) that makes use of the [GitHub API](https://developer.github.com/v3/guides/getting-started/).
68
+
In the following three weeks you are going to write an application that makes use of the [GitHub API](https://developer.github.com/v3/guides/getting-started/). Each week builds on top of the other, just like a real-world application!
69
69
70
-
Figure 1 below shows an example of what your application will look like.
Click on the image to open up a demo of the application!
71
72
72
-

73
-
74
-
This application does 2 things:
73
+
This application, HackYourRepo, does 2 things:
75
74
76
75
1. It makes connection to the GitHub API and retrieves all the repositories found in the [HackYourFuture account](https://www.github.com/hackyourfuture).
77
76
2. It displays those repositories in an alphabetically-ordered list. When a user clicks on any of the repository names it will show more details about it.
78
77
79
-
### Getting an overview
80
-
81
-
For this week you're expected to build upon pre-existing code, found in the folder `homework`. Here's what you'll find:
3. Open the `index.html` file in your browser. You will see an unordered list with the names of the HYF repositories.
121
-
122
-
4. Review the `main()` function in `index.js` and examine how this code fetches the JSON data and calls renders the data as unordered list in the web page.
123
-
124
-
5. Take a look at the API URL:
125
-
78
+
In the course of the next 3 weeks you'll be writing the necessary code to make all of this work!
79
+
80
+
### 4.1 Requirements
81
+
82
+
To get started, make sure you're in the right GIT branch: `week1-[YOURNAME]`. Then, navigate to the `hackyourrepo-app` folder and become familiar with the files there.
83
+
84
+
This week you're required to (1) setup the HTML structure of the application. In addition, you are expected to (2) style the application to make it user-friendly.
85
+
86
+
Here are the requirements for the HTML:
87
+
88
+
- Include 3 `<section>` tags
89
+
- Include a `<select>` tag
90
+
- Use the following placeholder data:
91
+
92
+
```js
93
+
constplaceholderRepos= [
94
+
{
95
+
name:'SampleRepo1',
96
+
description:'This repository is meant to be a sample',
97
+
forks:5,
98
+
updated:'2020-05-27 12:00:00',
99
+
},
100
+
{
101
+
name:'AndAnotherOne',
102
+
description:'Another sample repo! Can you believe it?',
103
+
forks:9,
104
+
updated:'2020-05-27 12:00:00',
105
+
},
106
+
{
107
+
name:'HYF-Is-The-Best',
108
+
description:
109
+
"This repository contains all things HackYourFuture. That's because HYF is amazing!!!!",
This URL is special, as it gives us data in JSON format (Try it out in your browser!). This type of URL is also known as an `endpoint`, an address that we can use to send an HTTP request to in order to get data.
131
-
132
-
- Learn more about endpoints [here](https://smartbear.com/learn/performance-monitoring/api-endpoints/).
133
-
134
-
Note the query string `?per_page=100` in the above URL. If you don't specify this `query string` you will only get the first 30 repositories (the default `per_page` is 30. How do we know? It says so in the [API documentation](https://developer.github.com/v3/#pagination)).
135
-
136
-
> Before using a public API it's always best practice to read the documentation. The developers have written down exactly how to understand and use it!
137
-
138
-
### Week 1 Assignment
139
-
140
-
The assignment for this week is to produce a functional web application that looks similar to Figure 1:
141
-
142
-

143
-
144
-
Here are the basic requirements:
145
-
146
-
1. Make a HTTP Request to the endpoint: https://api.github.com/orgs/HackYourFuture/repos?per_page=100
147
-
2. Display the first 10 items in the HTML file (write JavaScript to add the elements to the DOM)
148
-
3. Show feedback when an error has happened
149
-
150
-
Modify the following files:
151
-
152
-
**1. `index.js`**
153
-
154
-
- Add new functions and modify function `main()` as you see fit.
155
-
- Render network errors to the DOM (see Figure 2 below for an example). Do not use `console.log` as regular users will not see the console output. Instead, create an element that displays the error message in the DOM. Use the predefined `alert-error` class from `style.css` to style your error. It should look like this:
156
-
157
-

158
-
159
-
<small>Figure 2. Rendering of network errors.</small>
160
-
161
-
**2. `style.css`**
162
-
163
-
- Add your own CSS styling. Use `style.css` for all of your CSS rules to style the `index.html`. Make sure your UI is responsive. Try it with Chrome Developer Tools in the browser, using a mobile phone format and a tablet format, portrait and landscape.
164
-
165
-
**You are not allowed to use a CSS library such as Bootstrap.**
166
-
167
-
**Hints:**
168
-
169
-
- To sort the list repositories use [`.sort()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) and [`.localeCompare()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare).
170
115
171
-
- Use CSS media queries, percentage values and [Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) to make the UI responsive.
116
+
Here are the requirements for the CSS:
172
117
173
-
- To force a `404` network error so that you can test the rendering of errors, change the URL to make an invalid GitHub request, e.g. append an `x` to `orgs`: `orgsx`.
118
+
- Make use of `flexbox`
119
+
- Make use of `media-queries` and `calc()` to make the page responsive ([mobile, tablet, desktop](https://tinyurl.com/yc5zmste))
174
120
175
-
Good luck!
121
+
Other than this you can create your own version of the page!
Copy file name to clipboardExpand all lines: Week2/MAKEME.md
+43-1Lines changed: 43 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,49 @@ Let's start this week off with some interactive exercises! Visit the following l
15
15
16
16
## **2. JavaScript exercises**
17
17
18
-
**_No exercises this week_**
18
+
> Inside of your `JavaScript3` fork and inside of the `Week2` folder, create a folder called `homework`. Inside of that folder, create a folder called `js-exercises`. For all the following exercises create a new `.js` file in that folder (3 files in total). Make sure the name of each file reflects its content: for example, the filename for exercise one could be `getName.js`.
19
+
20
+
**Exercise 1: John who?**
21
+
22
+
Take a look at the following function (and try it out in your console):
23
+
24
+
```js
25
+
constgetAnonName= (firstName, callback) => {
26
+
setTimeout(() => {
27
+
if (!firstName)
28
+
returncallback(newError("You didn't pass in a first name!"));
29
+
30
+
constfullName=`${firstName} Doe`;
31
+
32
+
returncallback(fullName);
33
+
}, 2000);
34
+
};
35
+
36
+
getAnonName('John', console.log);
37
+
```
38
+
39
+
Rewrite this function, but replace the callback syntax with the Promise syntax:
40
+
41
+
- Have the `getAnonName` function return a `new Promise` that uses the `firstName` parameter
42
+
- If the Promise `resolves`, pass the full name as an argument to resolve with
43
+
- If the Promise `rejects`, pass an error as the argument to reject with: "You didn't pass in a first name!"
44
+
45
+
**Exercise 2: Is it bigger than 10?**
46
+
47
+
Write a function called `checkDoubleDigits` that:
48
+
49
+
- Takes 1 argument: a number
50
+
- Returns a `new Promise`
51
+
- If the number is bigger than 10, resolve with the string: "The number is bigger than 10!"
52
+
- If the number is smaller than 10, reject with the error: "Error! The number is smaller than 10..."
53
+
54
+
**Exercise 3: Gotta catch 'em all**
55
+
56
+
Let's catch all origin 151 Pokemon in our own little web application!
57
+
58
+
> Inside of your `homework` folder, create another folder called `pokemon-app`. This
0 commit comments