Skip to content

Instantly share code, notes, and snippets.

View hiba-machfej's full-sized avatar

Hiba Machfej hiba-machfej

View GitHub Profile

Discussion questions:

1- What is test coverage, and why is it important?

2- Should you do 100% test coverage? What should you consider while determining the right level of test coverage?

3- How does static analysis testing differ from unit testing?

4- What are some common tools used for static analysis testing in JavaScript?

5- How can developers enforce static analysis rules across their team projects?

Awsome Todos questions and answers guide:

Main questions:

1- What is passport-google-oauth20?

2- Why do we use cookieParser and encryptCookieNodeMiddleware ?

3- How do you let Express app use cookie middlewares (cookieParser, encryptCookieNodeMiddleware) with secret key for handling encryption of cookies *(answer might require code snippets)?

4- How to let your Express app use a middleware function that sends 401 (When not authenticated) error response code for auth errors and 500 (other errors) *(answer might require code snippets)?

Discuss the answers for these questions with you teammates and write your answers in the comments.

  1. What is the difference between SQL and NoSQL?
  2. What is referencing and what is embedding in MongoDB?
  3. Why should we embed more than referencing when we can in MongoDB?
  4. When should we prefer referencing over nesting in MongoDB?
  5. What is the difference between a table and a collection?
@hiba-machfej
hiba-machfej / # Discussion Questions: Props vs. State.md
Created March 1, 2024 07:31
# Discussion Questions: Props vs. State

Discussion Questions: Props vs. State

  1. What is the difference between props and state in React?

  2. When would you use state instead of props?

  3. Assuming UserDetail is a component, what will its props be if it's rendered as follows:

    const user = {name: 'Spider Man', age: 32}

Questions: Frontend File Setup

Answer the following questions with your group:

  • How do you link a JavaScript file to an HTML document?
  • How do you link a CSS file to an HTML document?
  • What are the roles of HTML, CSS, and JavaScript on a webpage?
  • What is the DOM? How is it related to HTML, CSS, and JavaScript?
  • How does HTML get rendered into DOM?
  • What are elements?

Questions: Frontend File Setup

Answer the following questions with your group:

  • How do you link a JavaScript file to an HTML document?
  • How do you link a CSS file to an HTML document?
  • What are the roles of HTML, CSS, and JavaScript on a webpage?
  • What is the DOM? How is it related to HTML, CSS, and JavaScript?
  • How does HTML get rendered into DOM?
  • What are elements?

Scopes Discussion

1. What is the scope of variable GLOBAL_DATA in the example below:

<script>
  let GLOBAL_DATA = { value : 1};
</script>

Object Discussion Questions

There is some coding in this discussion. Feel free to write them in a REPL or in the comments below.

  1. How is an object different from an array?
  2. How does const work with objects?
  3. Explain the difference between bracket syntax and dot syntax. Give an example of something that works with bracket syntax but not dot syntax. Give an example of something that works with dot syntax but not bracket syntax.
  4. What are computed properties? Write an example code. What is the difference between Object.keys and Object.entries? Write example code using both of them.
There is some coding in this discussion. Feel free to write them in a REPL or in the comments below.
How is an object different from an array?
How does const work with objects?
Explain the difference between bracket syntax and dot syntax. Give an example of something that works with bracket syntax but not dot syntax. Give an example of something that works with dot syntax but not bracket syntax.
What are computed properties? Write an example code.
What is the difference between Object.keys and Object.entries? Write example code using both of them.
How do we get only the values of an object?
@hiba-machfej
hiba-machfej / step1.ts
Last active August 23, 2021 14:58
near-login
import { keyStores, Near, utils, WalletConnection } from "near-api-js";