Skip to content

Instantly share code, notes, and snippets.

View mcshakes's full-sized avatar

Mac McCarthy mcshakes

View GitHub Profile
HOW IT WORKS:
- When mostFrequentWord is invoked, it takes a bunch of text as an argument.
- This text goes throught the separate helper function getTokens, where it is saved as the variable "words".
(i) Within getTokens, it is lowercased, and split along normal sentence punctuation. (see observation 1).
(ii) It is then sorted alphabetically and stored in array.
- wordFrequencies is declared as empty hash object.
- Then we iterate through the words array:
(i) if words exist within the wordFrequencies already, add to the counter with ++.
Make Student REPORTS:
https://repl.it/@mcshakes/Make-student-reports-drill
Enroll in Summer School:
https://repl.it/@mcshakes/Enroll-in-summer-school-drill
Find By ID:
OBJECT CREATOR
https://repl.it/@mcshakes/Object-creator-drill
OBJECT UPDATER
https://repl.it/@mcshakes/Object-updater-drill
self-REFERENCE
MAX AND MIN (WITHOUT SORT)
https://repl.it/@mcshakes/min-and-max-without-sort-drill
COMPUTE THE AVERAGE
https://repl.it/@mcshakes/average-drill
FIZZBUZZ
ARRAY COPYING I
https://repl.it/@mcshakes/Array-copying-I-drill
ARRAY COPYING II
https://repl.it/@mcshakes/Array-copying-II-drill
SQUARES WITH MAP
CREATING ARRAYS
https://repl.it/@mcshakes/Creating-arrays-drill
ADDING ARRAY ITEMS
https://repl.it/@mcshakes/Creating-arrays-drill
ACCESSING ARRAY ITEMS
TRAFFIC LIGHTS
https://repl.it/@mcshakes/Traffic-lights-drill
HANDLING ERRORS
https://repl.it/@mcshakes/Error-alert-drill
AREA OF RECTANGLE
function computeArea(width, height) {
return width * height;
}
TEMPERATURE CONVERSION
function celsToFahr(celsTemp) {
return celsTemp * (9 / 5) + 32
@mcshakes
mcshakes / String Drills
Created January 7, 2018 23:56
Unit 2 / Lesson 2 / Project 3
function wisePerson(wiseType, whatToSay) {
return `A wise ${wiseType} once said: ${whatToSay}`;
// return 'A wise ' + wiseType + ' once said: "' + whatToSay + '".';
}
SHOUTER
function shouter(whatToShout) {
return whatToShout.toUpperCase();
After npm init and you do all that noise, for setup
  1. npm install --save-dev webpack webpack-dev-server babel-loader babel-core

Note: insert react-hot-loader and react etc, if you are working on React projects

example: npm install --save react react-dom history react-router

  1. touch webpack.config.js and add this boilerplate: