Skip to content

Instantly share code, notes, and snippets.

View rtanubra's full-sized avatar

Rey Tanubrata rtanubra

  • Ontario, Canada
View GitHub Profile
@rtanubra
rtanubra / gist:703a4e397490211dae43c146a2261e7e
Created February 15, 2019 12:59
Module 4- working with strings, Checkpoint 5
function wisePerson(wiseType, whatToSay) {
// your code here
return `A wise ${wiseType} once said: "${whatToSay}".`
}
//had to console log the expected test- appeared to have been missing the "" encasing for the actual quote....
function shouter(whatToShout) {
// your code here
console.log(whatToShout.toUpperCase()+"!!!")
return whatToShout.toUpperCase()+"!!!"
function computeArea(width, height) {
return width * height;
}
function celsToFahr(celsTemp) {
return celsTemp *9/5+32
}
function fahrToCels(fahrTemp) {
return (fahrTemp-32)*5/9
}
@rtanubra
rtanubra / gist:addfe592c0bd65d1474b8f5c1e6a713f
Created February 17, 2019 14:43
Module 4, Checkpoint 10: Variable Scope
What is scope? Your explanation should include the idea of global vs. block scope.
Why are global variables avoided?
Explain JavaScript's strict mode
What are side effects, and what is a pure function?
Questions to answer:
What is scope? Your explanation should include the idea of global vs. block scope.
Why are global variables avoided?
Explain JavaScript's strict mode
What are side effects, and what is a pure function?
Scope refers to the extent of which parts of your code has access to specific variables/functions declared within the program. Variables declared outside of a function will have global scope. Variables declared within a function will have block scope. Block scope will only be accessible within that block of code (namely, the function). Outside of the function the variable will cease to exist. Global variables will be accessible and modifiable everywhere in your program. Global variables are largely avoided, because functions may inadvertantly modify a global variable, also known as a side effect.
A function is determinate when it produces the same output (given the same input) regardless of when it is run in the program. Global variables tend to make this more challenging. A pure f
@rtanubra
rtanubra / gist:b58956199679becd462f0a9aa587dd5d
Created February 17, 2019 20:45
Module 04 Checkpoint 11 Objects Basics
https://repl.it/@ReyTanubrata/Object-creator-drill
https://repl.it/@ReyTanubrata/Object-updater-drill
https://repl.it/@ReyTanubrata/Self-reference-drill-2
https://repl.it/@ReyTanubrata/Deleting-keys-drill
@rtanubra
rtanubra / gist:becd21865ed79802427284fbedede854
Created February 17, 2019 22:51
Module 4, Checkpoint 12
https://repl.it/@ReyTanubrata/Make-student-reports-drill
https://repl.it/@ReyTanubrata/Enroll-in-summer-school-drill
https://repl.it/@ReyTanubrata/find-by-id-drill
https://repl.it/@ReyTanubrata/validate-object-keys-drill
Grokking
function getTokens()
-input: raw string (with weird characters perhaps in a paragraph)
-method:
-convert all alphabet characters to lower case
Questions Regarding JQuery:
1. What do you use JQuery for in your applications?
2. I recall JQuery has good API to interact with external APIs to retrieve infomration from the web. Is that still the prevailing JS tool for pulling data?
3. Does React have many of the functionality that JQuery have in terms of event listening, DOM manipulating and Traversing?
4. Would people use them in conjunction with one another?
5. Where do you see JQuery being used most in the next 1- 2 years?
@rtanubra
rtanubra / pseudocode
Created February 26, 2019 02:23
Module 7 Checkpoint 5
Shopping list application. Goal of this is to form:
For the 3 remaining user stories (add items, check/uncheck items, and delete items), plan out each function in pseudocode (plain language).
addItem
//utilize Jquery to listen to click of 'Add button' (or enter pressed while the input form is targetted)
//prevent default behaviour to GET or POST if we are using a form element
//create a new variable (nameToAdd) that will hold the string that is currently in the input form
//Update the global variable shopping list to append the new object
//object will have 3 keys, value pairs
//1. unique id
@rtanubra
rtanubra / Module 7 Quiz App
Created March 3, 2019 15:58
Module 7 Quiz App
Link to page: https://rtanubra.github.io/quizapp/
Link to repo:https://github.com/rtanubra/quizapp
HEADLINE
Rey Tanubrata
I am a burgeoning Fullstack Developer. On my free time, I use Python to overengineer and automate boring tasks.
BIO
I am a Web Developer Student at Bloc Thinkful.
My Goal is to rid the world of 'boring tasks,' to free us up for big creative projects!
I love projects that demystify and simplify complex inputs (like deciding who to trade in fantasy basketball).
I also love projects that automate repetitive tasks (like a budgeting app that remind you if you've forgotten to pay those pesky bills).
Outside of work, I enjoy learning how I can use coding to overengineer the simplest things like fishkeeping and gardening.