Skip to content

Instantly share code, notes, and snippets.

View MatthewJRoybal's full-sized avatar
🏠
Working from home

Matthew J. Roybal MatthewJRoybal

🏠
Working from home
View GitHub Profile
1. Write a custom method to replace the string "The quick brown fox jumps
over the lazy dog" with the string "The1 quick2 brown3 fox4 jumps5
over6 the7 lazy8 dog9"
function customMethod() {
let string = 'The quick brown fox jumps over the lazy dog';
let replace = '';
let words = string.split(" ");
for(var i = 0; i < words.length; i += 1) {
replace = replace + words[i] + (i + 1) + ' ';
MVP User Stories:
As a user, I should be able to find out about what this website is all about
As a user, I should be able to log in
As a user, I should be able to take a quiz
As a user, I should be able to choose what types of questions are in the quiz
AS a user, I should see the first question when I start the quiz.
As a user, I should see the next question after I've answered the first
As a user, I should be able to see my score after completing all the questions
As a user, I should see all my quiz results on the dashboard/results page
As a user, I should be able to find out about what this website is all about
As a user, I should be able to log in
As a user, I should be able to take a quiz
As a user, I should be able to choose what types of questions are in the quiz
AS a user, I should see the first question when I start the quiz.
As a user, I should see the next question after I've answered the first
As a user, I should be able to see my score after completing all the questions
As a user, I should see all my quiz results on the dashboard/results page
As a user, I should be able to contribute questions
@MatthewJRoybal
MatthewJRoybal / Mongo_Drills.md
Last active April 26, 2017 01:26
Mongo Drills

##Get all Find the command that retrieves all restaurants. db.restaurants.find()

##Limit and sort Find the command that makes the first 10 restaurants appear when db.restaurants is alphabetically sorted by the name property. db.restaurants.find().sort({name: 1}).limit(10)

##Get by _id Retrieve a single restaurant by _id from the restaurants collection. This means you'll first need to get the _id for one of the restaurants imported into the database.

@MatthewJRoybal
MatthewJRoybal / Capstone One Findings
Created April 19, 2017 20:56
A write up of findings for my first capstone project
After the first solid draft which was submitted, there were several items which needed to be corrected as well as some improved styling added.
Code corrections:
1. The code didn't account for place entries which were had upper or lower case letters in various place. The code was recorrected to force all submissions into lower case lettering for an exact match.
2. The code didn't account for a message indicating misspelled place entries. A new message was inserted to appear when that happens.
3. The code wasn't allowing for a reset of the form or a new search once the initial search was completed. These are now included.
Styling improvements:
1. A logo was obtained on Fiverr for $6.
2. A landing page was added with a basic explanation of the app's purpose
@MatthewJRoybal
MatthewJRoybal / gist:b29452f008ed60afc1f64ad51a3366d8
Created April 5, 2017 01:52
Server Side Unit 1 Lesson 1 Drills: Request and response drills
// MadLib Generator
// ==================================
'use strict';
// Request and response object drills
// ==================================
// Express is an HTTP wrapper
@MatthewJRoybal
MatthewJRoybal / housing_search.txt
Created March 24, 2017 21:01
Allow real estate investors the ability to search a city and find out US census data for housing occupancy and vacancy rates.
Allow real estate investors the ability to search a city and find out US census data for housing occupancy and vacancy rates.
@MatthewJRoybal
MatthewJRoybal / text_analyzer.js
Created February 22, 2017 06:12
A text analyzer script
function wordCount(text) {
return text.split(" ").length;
};
function uniqueWordCount(text) {
var words = text.split(" ");
var counts = [];
for(var i = 0; i < words.length; i++ ) {
// if the word's position in the array exists, then don't push it into the empty array
if(counts.indexOf(words[i]) === -1) {
Cat Carousel: https://jsbin.com/pezoguy/2/edit?html,css,js,output
FizzBuzz Return: https://jsbin.com/xadolos/edit?html,js,output
Lightblub Toggle: https://jsbin.com/lalisej/3/edit?html,css,js,output
@MatthewJRoybal
MatthewJRoybal / Unit 2 Lesson 6 Challenge
Created February 20, 2017 02:20
Explain a function which is using objects to search for the highest word count.
function getTokens(rawString) {
// NB: `.filter(Boolean)` removes any falsy items from an array
return rawString.toLowerCase().split(/[ ,!.";:-]+/).filter(Boolean).sort();
}
function mostFrequentWord(text) {
// Convert all text to lower case, remove punctuation, and falsy items
var words = getTokens(text);
// Create an empty object for frequencies of words
var wordFrequencies = {};