Skip to content

Instantly share code, notes, and snippets.

View GrimmOutlook's full-sized avatar
🎯
Focusing

David Grimm GrimmOutlook

🎯
Focusing
View GitHub Profile
@GrimmOutlook
GrimmOutlook / gist:73bf2e49dea5ab3e108e3aed7067145a
Last active June 17, 2017 20:23
Thinkful Server-side - Mongo Basics Drills
Get all: db.restaurants.find();
Limit & Sort:
This didn't work:
db.restaurants.find({name: 1}).sort({name: 1}).limit(10);
This did:
db.restaurants.find({borough: "Manhattan"}, {name: 1}).sort({name: 1}).limit(10);
WHY?
@GrimmOutlook
GrimmOutlook / gist:559e923a3c86d48fd92b98b13c843f85
Last active June 1, 2017 20:10
Thinkful Server-side Programming, Unit 1 - Request & Response Drills
Echo Endpoint:
- https://glitch.com/edit/#!/blaze-jury?path=server.js:10:31
MadLibs:
- https://glitch.com/edit/#!/dust-peak?path=server.js:15:5
A/B Test:
- https://glitch.com/edit/#!/possible-velvet?path=server.js:18:15
@GrimmOutlook
GrimmOutlook / gist:ede8d5e4c4a160ff30bae5e3e80483bd
Created April 26, 2017 21:17
User Flow and Wireframes - Unit 3, Lesson 5, #3
Testing 1 2 3
@GrimmOutlook
GrimmOutlook / gist:78d4696cfd897143ec1df955319951c3
Created April 25, 2017 23:05
Choosing an API - Unit 3, Lesson 5, #2
High Level Definition of App Idea:
Using the http://api.fantasy.nfl.com/ API, my app helps users compare the stats of 2 different players at a certain position in order to
determine which player to select for their fantasy football draft.
@GrimmOutlook
GrimmOutlook / gist:03106b251a8196d5485609f2c4e92a20
Last active March 13, 2017 14:14
Prep Course, Unit 3, Lesson 1, #3 - Event Listener Drills
Cat Carousel: https://jsbin.com/sumejo/edit?html,js,output
2nd attempt: https://jsbin.com/daseroy/edit?html,js,output
Return of Fizzbuzz: https://jsbin.com/nanojo/edit?html,js,output - doesn't work, not close, but are you kidding me? I was supposed to
come up with THAT solution?!
Lightbulb Toggle: https://jsbin.com/fefiter/edit?html,css,js,output
@GrimmOutlook
GrimmOutlook / gist:19635f060e6ee7c41e79df1e9d9d05b4
Last active March 10, 2017 12:52
Prep Course, Unit 2, Lesson 6, #6 - Frequent Word Challenge
getTokens fxn:
1. Gets passed in a string.
2. The string then:
- gets converted to all lowercase letters.
- gets split into an array of strings of each individual word. A regular expression is used to split the string at a space, a comma,
an exclamation point, a period, a quotation mark, a semicolon, a colon, or a dash.
- has any "falsy" items removed from the array.
- gets alphabetically sorted.
3. An array of alphabetically sorted strings is returned. Each string contains a single word.
@GrimmOutlook
GrimmOutlook / gist:fee3e12ef9bc1184083541bdc220f5a5
Last active March 10, 2017 11:17
Prep Course, Unit 2, Lesson 6, #5 - Object Drills 2
Make Student Reports: https://jsbin.com/rapugej/edit?js,console
Enroll in Summer School: https://jsbin.com/wogohec/2/edit?js,output
Find by ID: https://jsbin.com/pexeciz/edit?js,console
Validate Object Keys: https://jsbin.com/nejiqef/2/edit?js,output
Todo List Factory:
@GrimmOutlook
GrimmOutlook / gist:def8062b74b9491c394ca4572b95c61a
Created March 6, 2017 14:21
Prep Course, Unit 2, Lesson 5, #4 - Scope Challenge
First Answer, without reviewing the Lessons or using Google:
1. What is scope? Your explanation should include the idea of global vs. local scope.
- Scope is where a variable or set of variables are defined and contained. Global scope sets a variable for the entire codebase. Local
scope is contained within the fxn where it is used. Also it's much better than Listerine.
2. Why are global variables avoided?
- If you're bringing in third-party libraries, such as jQuery, using an API, or merging with someone else's code, it can/will cause
@GrimmOutlook
GrimmOutlook / gist:690edaa431b2ba4484a01f59655cd232
Last active March 6, 2017 02:06
Prep Course, Unit 2, Lesson 6, #2
Object Creator: https://jsbin.com/wubojod/edit?js,console
Object Updater: https://jsbin.com/joxofu/edit?js,console
Self Reference: https://jsbin.com/xabixez/edit?js,console
Deleting Keys: https://jsbin.com/fagidiz/edit?js,console - Why does it log the key/values to the console in alphabetical order by key,
instead of the order in which they were listed in the code?
- Side effect?
@GrimmOutlook
GrimmOutlook / gist:03c249ed5485c484f4537ade88d0f02e
Last active March 5, 2017 23:22
Prep Course, Unit 2, Lesson 4, #4
min and max (without sort): https://jsbin.com/rovanaf/edit?js,console - Close, but not quite!
Compute the Average: https://jsbin.com/zesixi/edit?js,console - Took awhile, but got it!
FizzBuzz: https://jsbin.com/vahexah/edit?js,console - Didn't have divisible by 5 AND 3 first in the if statement.