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: Week6/MAKEME.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,8 @@ Give feedback on `step 2` of `week 5` to one of your fellow students (do this by
17
17
18
18
## Step 2: Git Homework
19
19
20
+
_Deadline Saturday_
21
+
20
22
[Make these assignments](https://github.com/HackYourFuture/Git/blob/master/Lecture-3.md). For handing in homework follow the Forking workflow that is described in our lecture-3.md file of HackYourFuture’s Git repository (there is also a video that explains this).
21
23
22
24
## Step 3: Read
@@ -36,15 +38,17 @@ _Deadline Wednesday_
36
38
37
39
1\.We saw that we can pass functions as arguments to other functions. Your task is to write a function that takes another function as an argument and runs it.
38
40
39
-
function foo(func) {
41
+
```js
42
+
functionfoo(func) {
40
43
// What to do here?
41
-
}
44
+
}
42
45
43
-
function bar() {
44
-
console.log('Hello, I am bar!');
45
-
}
46
+
functionbar() {
47
+
console.log('Hello, I am bar!');
48
+
}
49
+
```
46
50
47
-
foo(bar);
51
+
foo(bar);
48
52
49
53
2\.We learned a little bit about callbacks in JS. A callback is simply a function passed to another function that gets executed (run) after a potentially long running operation has completed. There is another function called `setTimeout` that will wait a specified period of time and then execute a function. For example:
50
54
@@ -127,6 +131,8 @@ If you are confused please run the code and then consult the Google for "javaScr
127
131
128
132
## Step 5: Scope and Closures
129
133
134
+
_Deadline Saturday_
135
+
130
136
> Let's continue to learn a little more about scope and Closures.
Copy file name to clipboardExpand all lines: Week6/README.md
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,11 @@ In week seven we will discuss the following topics:
8
8
• apply
9
9
• bind
10
10
• Code flow (order of execution)
11
-
• Async VS Sync
11
+
12
12
```
13
13
14
14
### Here are resources that we like you to read as a preparation for the coming lecture:
15
15
16
-
#### Async VS Sync
17
-
- Read about Asynchronous vs. Synchronous programming: http://www.hongkiat.com/blog/synchronous-asynchronous-javascript/
18
-
19
16
#### Closures and async code
20
17
-[Why closures are helpful with async code](http://stackoverflow.com/questions/13343340/calling-an-asynchronous-function-within-a-for-loop-in-javascript)
Copy file name to clipboardExpand all lines: Week7/MAKEME.md
+12-64Lines changed: 12 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,99 +8,47 @@ Topics discussed this week:
8
8
• apply
9
9
• bind
10
10
• Code flow (order of execution)
11
-
• Async VS Sync
12
11
```
13
12
14
13
>[Here](/Week7/README.md) you find the readings you have to complete before the eighth lecture.
15
14
16
-
## Step 1: Give feedback on Step 3 and 4 of last weeks homework.
15
+
## Step 1: Give feedback on Step 4 and 5 of last weeks homework.
17
16
18
17
_Deadline Monday_
19
18
20
19
Give feedback on the SPA (Github API) and git branching homework of one of you fellow students. Please provide the feedback in an issue.
21
20
22
21
## Step 2: Issues
23
22
23
+
_Deadline Monday_
24
+
24
25
- Solve all your Git issues. DO NO CLOSE AN ISSUE WITHOUT AN EXPLANATION OR CODE COMMIT REFERENCING THAT ISSUE.
25
26
26
27
27
-
## Step 3: Fix issues and API
28
+
## Step 3: Fix issues
29
+
30
+
_Deadline Thursday_
28
31
29
-
- Fix the issues from the last week and make sure you explain how you fixed the issue in a comment (or commit message)
32
+
- Fix the issues from the last weeks and make sure you explain how you fixed the issue in a comment (or commit message)
30
33
31
34
## Step 4: Some Challenges
32
35
33
36
_Deadline Saturday_
34
37
35
38
Let's practice working with Objects and Arrays. Go to FreeCodeCamp and complete all challenges under "Object Oriented and Functional Programming" and the _first four challenges_ under "Basic Algorithm Scripting", up until 'Find the longest word in a string.'
36
39
37
-
## Step 5: Async challenge
38
-
39
-
1. Rewrite the code below to Async:
40
-
41
-
```js
42
-
1.
43
-
44
-
let sum =calculateSum(2, 6);
45
-
console.log(sum);
46
-
47
-
2.
48
-
49
-
let results =$.getJSON('http://myapi.com');
50
-
showResults(results);
51
-
52
-
3.
53
-
54
-
let sum =calculateSum(2, 6);
55
-
if (sum >8) {
56
-
console.log('larger than 8');
57
-
}
58
-
59
-
4.
60
-
61
-
let data =$.getJSON('http://myapi.com');
62
-
data =data.map(function (x) { return x *8; });
63
-
64
-
writeDataToFile(data);
65
-
```
66
-
67
-
68
-
## Step 6: Some more JavaScript
69
-
70
-
_Deadline Saturday_
71
-
72
-
Make a website that fetches (= to get) data asynchronously.
73
-
74
-
1. Create a new website with external js file
75
-
76
-
2. Add a button (e.g. 'click me') that when clicked `console.logs` 'you clicked me!'
77
-
78
-
3. Create a function that fetches from [The Github API](https://developer.github.com/v3/). For example from [this page] (https://api.github.com/orgs/HackYourFuture/repos) (the one we used last week). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript)
79
-
80
-
4. Display the data that you get from the Github API on your web page.
81
-
82
-
5. Now link the two together: When you click the button -> get the data from the Github API and display it on your website
83
-
84
-
6. Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/HackYourFuture/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab.
You can see `CommandLine` in the URL. These are called "query parameters" and let us specify in detail what we want from the API. Play around with this. For example you can make two buttons that either get data for a specific repository, JavaScript or Node.js. Or go even more crazy and make users type in a search box 'JavaScript' and then send that to the API by changing the repository.
93
-
94
-
95
-
## Step 7: **Some freeCodeCamp challenges:**
40
+
Also make:
96
41
97
42
1.[Comparisons with the Logical And Operator](https://www.freecodecamp.com/challenges/comparisons-with-the-logical-and-operator)
Copy file name to clipboardExpand all lines: Week8/MAKEME.md
+45-2Lines changed: 45 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,64 @@ Topics discussed this week:
5
5
• Structure for a basic SPA
6
6
• XMLHttpRequests
7
7
• API calls
8
+
• Async VS Sync
8
9
```
9
10
10
11
11
12
>[Here](/Week8/README.md) you find the readings you have to complete before the ninth lecture.
12
13
13
-
## Step 1: Feedback step 4 and 6 week 7
14
+
## Step 1: Feedback
14
15
15
-
Give feedback on the SPA (Github API) and git branching homework of one of you fellow students. Please provide the feedback in an issue.
16
+
_Deadline Monday_
17
+
18
+
Please provide feedback in an issue.
19
+
20
+
_Deadline Monday_
16
21
17
22
## Step 2: FINISH ALL YOUR JAVASCRIPT HOMEWORK
18
23
24
+
_Deadline Saturday_
25
+
19
26
:point_up:
20
27
28
+
## Step 3: Async challenge
29
+
30
+
_Deadline Saturday_
31
+
32
+
1. Rewrite the code below to Async:
33
+
34
+
```js
35
+
1.
36
+
37
+
let sum =calculateSum(2, 6);
38
+
console.log(sum);
39
+
40
+
2.
41
+
42
+
let results =$.getJSON('http://myapi.com');
43
+
showResults(results);
44
+
45
+
3.
46
+
47
+
let sum =calculateSum(2, 6);
48
+
if (sum >8) {
49
+
console.log('larger than 8');
50
+
}
51
+
52
+
4.
53
+
54
+
let data =$.getJSON('http://myapi.com');
55
+
data =data.map(function (x) { return x *8; });
56
+
57
+
writeDataToFile(data);
58
+
```
59
+
60
+
21
61
22
62
## Step 4: SPA :sweat_drops:
63
+
64
+
_Deadline Saturday_
65
+
23
66
You are going to write a SPA (Single Page Application) that uses the [Github API](https://developer.github.com/guides/getting-started/). Make sure that your app uses a logical pattern just like [this codepen](http://codepen.io/Razpudding/pen/MmVpeW).
0 commit comments