Skip to content

Instantly share code, notes, and snippets.

View mcshakes's full-sized avatar

Mac McCarthy mcshakes

View GitHub Profile
@mcshakes
mcshakes / mysql_error.md
Last active August 7, 2022 17:43
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

To set to null password for local development

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');

Nav Bar
https://glitch.com/edit/#!/nav-bar-glitch
https://nav-bar-glitch.glitch.me
Adrress Book
https://glitch.com/edit/#!/address-book
https://address-book.glitch.me
1) Find All
db.restaurants.find()
2)Limit and Sort
db.restaurants.find().sort({'name': 1}).limit(10)
3)Find by Object ID
db.restaurants.find(ObjectId("59074c7c057aaffaafb0da6d"))
4) Get by Value
@mcshakes
mcshakes / user-Feedback.md
Last active March 28, 2018 11:55
User Feedback and Iteration

Do my users think the app is interesting or valuable?

  • The basic idea definitely has merit, especially for not-experienced cooks or people who have random ingredients but don’t experiment.
  • People using the Blue Apron-type home-cooking-boxes will sometimes end up with random leftovers, especially sauces and aromatics.
  • Coupled with the caloric breakdown adds benefit for calorie watchers.

Did my users use the app as I intended?

  • To look up recipes based on what’s in my fridge and get a corresponding nutrition count.
  • Answer is yes.

Did my users encounter any bugs or broken features?

1) Echo endpoint
https://glitch.com/edit/#!/adaptable-macaroni?path=server.js:1:0
2) Mad Lib Generator
https://glitch.com/edit/#!/dashing-sagittarius?path=server.js:20:28
Step One: User sees a list (form) of dietary preferences
https://drive.google.com/file/d/1lsfE70vB9a_YNPQXbWmAt41sQSdYaqUP/view?usp=sharing
Step Two: User chooses correct action
https://drive.google.com/file/d/1D2j9wEnpdisbUnIc1BKSrfgEvRzCuOZs/view?usp=sharing
Step Three: User Gets Recipes
For this Async Project, I want to make an app where the user plans a meal around what is in the fridge.
Question: What can I cook with Chicken thighs, hummus, and 10 ounces of saffron.
User will enter those ingredients and will query the following recipes with one of these two APIs:
https://api.edamam.com/search
or
1) What is scope? Your explanation should include the idea of global vs. local scope.
I think of scope as accessibility of my variables, whether it is in a function or exists within the global sphere. Variables defined within a
a function (with var or let for example) are local variables, while variables defined outside of a function are global variables.
These variables in the global scope can be altered in any other scope. Local variables are just bound to their function (within the block) and are hidden from other
functions.
2) Why are global variables avoided?
They are accessible everywhere: from the console, from different functions. They can be overriden and the values can be fetched. This causes concern for future maintenance, as someone will have to look through entire call stack to identify which variable points to where, even using the same name and introducing duplicate bugs.
Cat Carousel
https://repl.it/@mcshakes/Cat-carousel-jQuery
FIZZ BUZZ
https://repl.it/@mcshakes/return-of-fizz-buzz
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 ++.