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:11422fec7ba386285a62567677ff4460
Last active February 27, 2017 00:48
Prep Course, Unit 2, Lesson 2, #3
String Drill #1: https://jsbin.com/vowugat/2/edit?js,console
String Drill #2: https://jsbin.com/zulaco/edit?js,console
String Drill #3: https://jsbin.com/wogavaj/edit?js,console
@GrimmOutlook
GrimmOutlook / gist:2a86562a1e9911707d409675d624697b
Created March 1, 2017 00:46
Prep Course, Unit 2, Lesson 2, #5
Number Drills:
Area of Rectangle: https://jsbin.com/rolikes/edit?js,console
Temperature Conversion: https://jsbin.com/niqikoz/edit?js,console
Is Divisible: https://jsbin.com/kopaxon/edit?js,console
- Used if else statement, but haven't covered that yet. is there another solution?
@GrimmOutlook
GrimmOutlook / gist:1796dfed015fc186d02874a0dd732d1b
Created March 1, 2017 21:31
Prep Course, Unit 2, Lesson 3, #3
Logic Drills:
Traffic Lights: https://jsbin.com/tuzupog/edit?js,console,output
Error Alert: https://jsbin.com/nujugu/edit?js,console,output
@GrimmOutlook
GrimmOutlook / gist:656436293ffcf96e7014e52602703dcf
Last active March 3, 2017 00:22
Prep Course, Unit 2, Lesson 4, #2
Array Drills:
1. Creating Arrays: https://jsbin.com/bebojeg/edit?js,console
2. Adding Array Items: https://jsbin.com/basewew/edit?js,console
3. Accessing Array Items: https://jsbin.com/kusubi/edit?js,console
4. Array Length and Access: https://jsbin.com/xukixo/edit?js,console
@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.
@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: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: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: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: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