-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
30,955 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const theBox = document.querySelector('#theBox'); | ||
|
||
const client = new tmi.Client({ | ||
channels: [ 'codinggarden' ] | ||
}); | ||
|
||
client.connect(); | ||
|
||
client.on('message', (channel, tags, message, self) => { | ||
theBox.textContent += '\n' + message; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>My Awesome Web Page</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<div id="theBox" class="my-box"> | ||
|
||
</div> | ||
<script src="tmi.min.js"></script> | ||
<script src="app.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
font-family: sans-serif; | ||
} | ||
|
||
.my-box { | ||
width: 500px; | ||
height: 500px; | ||
background-color: green; | ||
border-radius: 20px; | ||
color: white; | ||
white-space: pre; | ||
word-wrap: break-word; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
console.log(add(2, 2)); | ||
|
||
function add(a, b) { | ||
return a + b; | ||
} | ||
|
||
const add = function(a, b) { | ||
return a + b; | ||
}; | ||
|
||
const add = (a, b) => { | ||
return a + b; | ||
}; | ||
// export const add = (a, b) => a + b; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const jobPostings = require('./data.json'); | ||
|
||
// search actual properties... | ||
function getJobPostingsWithRequirementMatch(...matches) { | ||
// Find all jobs that match... | ||
// return jobPostings.filter((jobPosting) => { | ||
// const employmentRequirements = jobPosting.details.find((detail) => { | ||
// return detail.section === 'Employment requirements'; | ||
// }); | ||
// const matchedDetails = employmentRequirements.details.filter((detail) => { | ||
// return detail.match(new RegExp(match, 'gi')); | ||
// }); | ||
// return matchedDetails.length > 0; | ||
// }); | ||
return [...jobPostings.reduce((allExamples, jobPosting) => { | ||
// ALTERNATE SOLUTION: stringify each object and regex it | ||
// JSON.stringify(jobPosting).match(someRegexp) | ||
const employmentRequirements = jobPosting.details.find((detail) => { | ||
return detail.section === 'Employment requirements'; | ||
}); | ||
const allDetails = employmentRequirements.details.join(' '); | ||
const isMatch = matches.every((match) => allDetails.match(new RegExp(match, 'gi'))); | ||
if (isMatch) { | ||
const examples = jobPosting.details.find((detail) => { | ||
return detail.section === 'Illustrative example(s)'; | ||
}); | ||
examples.details.forEach((example) => allExamples.add(example)); | ||
} | ||
return allExamples; | ||
}, new Set())]; | ||
} | ||
|
||
const matchedPostings = getJobPostingsWithRequirementMatch('degree', 'computer science'); | ||
console.log(matchedPostings); |