Skip to content

Commit 75a1fb9

Browse files
authored
Merge pull request HackYourFuture#1 from vincentsels/update-homework
Updated homework
2 parents 7c83fd6 + 193436c commit 75a1fb9

16 files changed

Lines changed: 355 additions & 1177 deletions
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"extends": ["airbnb", "prettier"],
3-
"plugins": ["prettier"],
2+
"extends": [
3+
"airbnb"
4+
],
45
"env": {
56
"browser": true
67
},
78
"rules": {
8-
"prettier/prettier": ["error"],
99
"class-methods-use-this": "off",
1010
"strict": "off",
1111
"no-plusplus": "off",
@@ -17,4 +17,4 @@
1717
}
1818
]
1919
}
20-
}
20+
}

Week1/MAKEME.md

Lines changed: 69 additions & 159 deletions
Large diffs are not rendered by default.
49 KB
Loading

homework/App.js

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

homework/Contributor.js

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

homework/Repository.js

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

homework/Util.js

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

homework/hyf.png

-6.81 KB
Binary file not shown.

homework/index.html

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +0,0 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
4-
<head>
5-
<meta charset="UTF-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
7-
<meta name="theme-color" content="#000000">
8-
<meta name="apple-mobile-web-app-capable" content="yes">
9-
<meta name="mobile-web-app-capable" content="yes">
10-
<meta name="format-detection" content="telephone=no">
11-
<link rel="apple-touch-icon" href="./hyf.png">
12-
<link rel="shortcut icon" type="image/png" href="./hyf.png" />
13-
<title>HYF-GITHUB</title>
14-
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
15-
<link rel="stylesheet" href="./style.css">
16-
</head>
17-
18-
<body>
19-
<div id="root"></div>
20-
<script src="./index.js"></script>
21-
</body>
22-
23-
</html>

homework/index.js

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +0,0 @@
1-
'use strict';
2-
3-
{
4-
function fetchJSON(url, cb) {
5-
const xhr = new XMLHttpRequest();
6-
xhr.open('GET', url);
7-
xhr.responseType = 'json';
8-
xhr.onload = () => {
9-
if (xhr.status < 400) {
10-
cb(null, xhr.response);
11-
} else {
12-
cb(new Error(`Network error: ${xhr.status} - ${xhr.statusText}`));
13-
}
14-
};
15-
xhr.onerror = () => cb(new Error('Network request failed'));
16-
xhr.send();
17-
}
18-
19-
function createAndAppend(name, parent, options = {}) {
20-
const elem = document.createElement(name);
21-
parent.appendChild(elem);
22-
Object.keys(options).forEach(key => {
23-
const value = options[key];
24-
if (key === 'text') {
25-
elem.textContent = value;
26-
} else {
27-
elem.setAttribute(key, value);
28-
}
29-
});
30-
return elem;
31-
}
32-
33-
function main(url) {
34-
fetchJSON(url, (err, data) => {
35-
const root = document.getElementById('root');
36-
if (err) {
37-
createAndAppend('div', root, { text: err.message, class: 'alert-error' });
38-
} else {
39-
createAndAppend('pre', root, { text: JSON.stringify(data, null, 2) });
40-
}
41-
});
42-
}
43-
44-
const HYF_REPOS_URL = 'https://api.github.com/orgs/HackYourFuture/repos?per_page=100';
45-
46-
window.onload = () => main(HYF_REPOS_URL);
47-
}

0 commit comments

Comments
 (0)