Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35eb436

Browse files
authored
Merge pull request HackYourFuture#4 from remarcmij/master
Enable handing in homework via PR
2 parents fd91749 + 62e9aed commit 35eb436

28 files changed

+475
-326
lines changed

.eslintrc

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true
7+
},
8+
"parserOptions": {
9+
"ecmaVersion": 2017,
10+
"ecmaFeatures": {
11+
"jsx": true
12+
},
13+
"sourceType": "module"
14+
},
15+
"extends": [
16+
"eslint:recommended"
17+
],
18+
"rules": {
19+
"no-const-assign": "warn",
20+
"no-this-before-super": "warn",
21+
"no-undef": "warn",
22+
"no-unreachable": "warn",
23+
"no-unused-vars": "warn",
24+
"constructor-super": "warn",
25+
"valid-typeof": "warn",
26+
"no-var": "warn",
27+
"prefer-const": "warn",
28+
"no-multiple-empty-lines": "warn",
29+
"eol-last": [
30+
"error",
31+
"always"
32+
],
33+
"no-console": "off",
34+
"camelcase": "warn",
35+
"eqeqeq": [
36+
"error",
37+
"always",
38+
{
39+
"null": "ignore"
40+
}
41+
],
42+
"semi": [
43+
"warn",
44+
"always"
45+
]
46+
}
47+
}

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (http://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# Typescript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
.netlify
61+
dist/

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"cSpell.words": [
3+
"Codewars",
4+
"Maartje",
5+
"Maartje's",
6+
"blabla",
7+
"roverjs"
8+
]
9+
}

LICENSE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This work is licensed under the Creative Commons Attribution 4.0 International License.
2+
To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/
3+
or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Here you can find course content and homework for the JavaScript2 module
77

88
|Week|Topic|Read|Homework|
99
|----|-----|----|--------|
10-
|1.|• Capturing user input <br>• Events<br>• [Basic DOM manipulations (img src, innerHTML)](../../../fundamentals/blob/master/fundamentals/DOM_manipulation.md)<br>• Code debugging using the browser <br>• [Code commenting](../../../fundamentals/blob/master/fundamentals/code_commenting.md)<br>• Structuring code files<br>• [Code formatting](../../../fundamentals/blob/master/fundamentals/code_formatting.md) |[Reading Week 1](/Week1/README.md)|[Homework Week 1](/Week1/MAKEME.md)|
10+
|1.|• Capturing user input <br>• Events<br>• [Basic DOM manipulations (img src, innerHTML)](../../../fundamentals/blob/master/fundamentals/DOM_manipulation.md)<br>• Code debugging using the browser <br>• [Code commenting](../../../fundamentals/blob/master/fundamentals/code_commenting.md)<br>• Structuring code files<br>• [Code formatting](../../../fundamentals/blob/master/fundamentals/code_formatting.md)<br>• [Handing in homework via PR](../../..//fundamentals/blob/master/fundamentals/homework_pr.md) |[Reading Week 1](/Week1/README.md)|[Homework Week 1](/Week1/MAKEME.md)|
1111
|2.|• Functions + JSON/Arrays<br>• [Array Manipulations](../../../fundamentals/blob/master/fundamentals/array_manipulation.md)<br>• JSON<br>• [Map and filter](../../../fundamentals/blob/master/fundamentals/map_filter.md)<br>• Arrow functions |[Reading Week 2](/Week2/README.md)|[Homework Week 2](/Week2/MAKEME.md)|
1212
|3.|[Closures](../../../fundamentals/blob/master/fundamentals/scope_closures_this.md) <br>• Callbacks|[Reading Week 3](/Week3/README.md)|[Homework Week 3](/Week3/MAKEME.md)|
1313

@@ -19,3 +19,5 @@ We expect you to __always__ come prepared to the class on Sunday.
1919
A good understanding of all the above mentioned topics. Want to check your Knowledge? Go through the [JavaScript Fundamentals README](../../../fundamentals/blob/master/fundamentals/README.md) and research/ ask for help (Slack!) with the concepts that are not entirely clear.
2020

2121
*The HackYourFuture curriculum is subject to CC BY copyright. This means you can freely use our materials, but just make sure to give us credit for it :)*
22+
23+
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.

Week1/MAKEME.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,37 +54,50 @@ Your fellow students have provided you with feedback in Trello.
5454
- Implement both feedback from Trello and Github.
5555
- Check on one of your fellow students code and issues and see if her or she implemented their feedback correctly. If there are some things that can be improved make an issue suggesting further improvements. If you think that the feedback has been implemented correctly create a issue saying something like: "nice work you can clear your issues".
5656

57-
## Step 2: Reorganize your Github
57+
## Step 2: Reorganize your GitHub
5858

5959
_Deadline Monday_
6060

61-
Your Github should contain two repositories called `hyf-javascript1` and `hyf-javascript2`. Inside the JavaScript repositories you should have three folders, called week1, week2, and week3 (or something similar). Inside these folders you should have the different assignments (a file per exercises). Try and find proper names for the exercises that reflect somehow what is going on in the code. Avoid using spaces in your file names, this makes it harder to "run" you files. Also make sure that all your JavaScript files have a `.js` extension.
61+
Your Github should contain a repository called `hyf-javascript1`. Inside this JavaScript repository you should have three folders, called week1, week2, and week3 (or something similar). Inside these folders you should have the different assignments (a file per exercises). Try and find proper names for the exercises that reflect somehow what is going on in the code. Avoid using spaces in your file names, this makes it harder to "run" you files. Also make sure that all your JavaScript files have a `.js` extension.
6262

6363
## Step 3: Custom DOM manipulation challenge :mortar_board:
6464

6565
_Deadline Saturday_
6666

67-
1. Open a new js file and start by declaring an array that contains 10 strings. These strings should be of book titles you have read (or made up) and be lowercase without spaces or special characters so that you can use these later as Id's. (Example: Harry Potter's - The Chamber of Secrets -> `harry_potter_chamber_secrets`).
67+
> **Preparation**: Fork this repository and use the [Homework Pull Request Workflow](../../../../fundamentals/blob/master/fundamentals/homework_pr.md) to hand in your homework.
6868
69-
2. Create a basic html file called index.html and use it to load the js file, confirm the console.log show the array. (This is for debugging and making sure everything is in order. Delete it later when you're done :))
69+
Modify the (mostly empty) files in the `Week1/homework` folder for this step.
7070

71-
3. Make a function (or functions) that generate a `ul` with `li` elements for each book ID in the array using a for loop.
71+
**3.1** Open the `apps.js` and start by declaring an array that contains 10 strings. These strings should be of book titles you have read (or made up) and be lowercase without spaces so that you can use these later as HTML `id` attributes. (Example: _Harry Potter's - The Chamber of Secrets_ -> `harry_potter_chamber_secrets`). Add a console.log statement to output this array to console. (This is for debugging and making sure everything is in order. Delete it later when you're done :))
7272

73-
4. Make an object containing information for each book. Each item (object) in this object should have the book ID you thought up in point 1 as a key, and it should have at least the following fields: title, language and author.
73+
**3.2** Open the empty `index.html` and add the required HTML to load the `app.js` file. Open `index.html` in the browser and confirm that the `console.log` statement shows the array. (Open the Chrome Developer Tools and inspect the console.)
7474

75-
5. Now change the function you used to display the book ID's in a list to take the actual information about the book from the object and display that. Make sure you choose the right html elements for each piece of info, for instance, a heading for the title.
75+
**3.3** Remove the temporary `console.log` from step 3.1. Make a function (or functions) that generate a `ul` with `li` elements for each book ID in the array using a `for` loop. Make sure that the function names you choose are an accurate reflection of what they do. As a reminder, here are the recommended [Naming Conventions](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/naming_conventions.md).
7676

77-
6. Beautify your html page with css, add sources and alts to each of the images.
77+
**3.4** Make an object (_not an array!_) containing information for each book. Each property of this object should be another (i.e., nested) object with the book ID you thought up in step 3.1 as a key, and at least the following properties: `title`, `language` and `author`.
78+
79+
**3.5** Now change the function from step 3.3 that you used to display the book ID's in a list to take the actual information about the book from the object and display that. Make sure you choose the correct HTML elements for each piece of info, for instance, a heading for the title.
80+
81+
**3.6** Beautify your html page with css (use the `style.css` file for that), add sources and alts to each of the images.
7882

79-
7. Download book covers for each book, construct a new Object which has as keys the bookId's again, and as value the path to the image source (e.g. `{"harry_potter_blabla": "./img/harry_potter_blabla.jpg", ...}`). Now loop over these entries (_hint: `Object.keys(objectName)` gives you an array containing the keys_). Then write a function which places an image at the corresponding `li` element. Remember that Objects are not ordered, so you cannot guarantee that the first key is the first `li` element. (_Hint: you could give each `li` item an `id` tag by modifying the function you made before_)
83+
**3.7** Find and download book covers for each book and construct a new object which has as keys the book IDs again, and as value the path to the image source (e.g. `{ harry_potter_blabla: './img/harry_potter_blabla.jpg', ... }`).
8084

81-
```
82-
How to hand in your homework:
83-
• Upload your homework in your "hyf-javascript2" Github repository. Make sure to create a new folder "week1" first.
84-
• Upload your homework files inside the week1 folder and write a description for this “commit”.
85-
• Your hyf-javascript2/week1 should now contain an index.html, main.css and a script.js file (and the images folder)
86-
• Place the link to your repository folder in Trello.
87-
```
85+
Loop over these entries (_hint: `Object.keys(objectName)` gives you an array containing the keys_). Then write a function which places an image at the corresponding `li` element. Remember that objects are not ordered, so you cannot guarantee that the first key is the first `li` element. (_Hint: you could give each `li` item an `id` tag by modifying the function you made before._)
86+
87+
88+
### How to hand in your homework:
89+
90+
Go over your homework one last time:
91+
92+
- Does every file run without errors and with the correct results when you run them with Node?
93+
- Does every file start with `'use strict';`?
94+
- Have you used `const` and `let` and avoided `var`?
95+
- Do the variable, function and argument names you created follow the [Naming Conventions](../../../../fundamentals/blob/master/fundamentals/naming_conventions.md)?
96+
- Is your code well-formatted (see [Code Formatting](../../../../fundamentals/blob/master/fundamentals/naming_conventions.md))?
97+
98+
If the answer is 'yes' to all preceding questions you are ready to follow these instructions:
99+
100+
- [Handing in homework](../../../../fundamentals/blob/master/fundamentals/homework_pr.md)
88101

89102
## Step 4: **FreeCodeCamp challenges:**
90103

@@ -116,13 +129,4 @@ it’s a great way to really practice JavaScript a lot in various problems.
116129

117130
Please note, there are various challenges all sorted on difficultly called KIU. Kiu 8 is the easiest, Kiu 1 is the hardest, we expect you to do challenges around level 8, 7 maybe.
118131

119-
enjoy!
120-
121-
:octocat:
122-
```
123-
How to hand in your homework:
124-
• Create a new repository "hyf-javascript2". Also create a new folder "week1" inside this repository.
125-
• Upload your homework files inside the week1 folder and write a description for this “commit”.
126-
• Your hyf-javascript2/week1 should now contain the files of your homework.
127-
• Place the link to your repository folder in Trello.
128-
```
132+
Enjoy!

Week1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ In week one we will discuss the following topics:
1010
• Structuring code files
1111
```
1212

13-
- Chrome DevTools [Debugging](https://developers.google.com/web/tools/chrome-devtools/?utm_source=dcc&utm_medium=redirect&utm_campaign=2016q3)
13+
- Chrome DevTools [Debugging](https://developers.google.com/web/tools/chrome-devtools/)
1414

1515
### A Refresher from some previous covered topics:
1616

Week1/code_examples/Closures (class 10).md

Lines changed: 0 additions & 70 deletions
This file was deleted.

Week1/code_examples/closure1.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

Week1/code_examples/closure2.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

Week1/code_examples/equal.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)