Skip to content

Instantly share code, notes, and snippets.

View muslemomar's full-sized avatar

Muslem Omar muslemomar

View GitHub Profile
@muslemomar
muslemomar / take-home-web-project-questions.txt
Last active May 22, 2020 09:04
Take Home Web Project Questions
1) So you said that the API should not use a database and at the same time it should allow you to register users.
The only possible way is storing users in the memory, but restarting the server will reset the integers. is that ok?
2) Do the numbers have to be exact sequential (one exactly after another)?
for example if current integer is "5", if the user call "next integer" endpoint, it will return you "7" or "10" any integer larger than current one. is that ok?
3) Can the integers be large like "1590081234" ? Actually I have the idea of using timestamps 😅.
4) Should the integers be unique accross users also ? I mean can 2 users or more, share the same integer?
@muslemomar
muslemomar / mongodb-embedding.md
Last active May 26, 2022 13:40
Comparison of putting author inside blogpost vs blogpost inside author

1. Embedding BlogPosts inside Author:

AuthorSchema = { blogposts: BlogPost[] }

✔ Pros:

  • Easy to query for all/specific authors.
  • Easy to update an author or delete him (including his blogposts) with a single command.
@muslemomar
muslemomar / demo.js
Last active June 28, 2022 15:59
Create a fixed length array
let arr = [];
arr.maxLength = 3;
Array.prototype.pushLimited = function(elem) {
if (this.length === this.maxLength) {
throw new Error('max length exceeded');
} else {
this.push(elem);
}
}
Bicycle World
Welcome to Bicycle World, the premier text-based bicycle shop! This shop is only accessible to programmers like you, who are familiar with the command line.
In this project, I used the commands I learned to navigate and edit the filesystem.
The filesystem is shown below. Main directory is BicycleWorld.
BicycleWorld
|—— brands.txt
|—— freight/

Showcase your solid knowledge of HTML and CSS creating a webpage for a restaurant.

REQUIREMENTS:

  • Landing page.
  • Should include the navbar and the footer.
  • Menu Page that include categorized meals with name, price, description and image.
  • Meet our chefs section that has a list of chefs.
  • Utilize forms to a usage of your choice such as reservation/booking or feedback form.
  • Contact details section including phone number, email, and address.

Discussion Questions: Events

Objectives

  • Recall the different types of JavaScript Events
  • Identify when the DOMContentLoaded event will trigger
  • Implement a callback attached to an event handler

Exercise

Scopes Discussion

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

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

Promise Discussion Questions

  1. In your own words, what does asynchronous mean?
  2. In your own words, what is a promise?
  3. In your own words, why is it called a Promise?
  4. In your own words, why is it called await?
  5. Please read the common mistakes section of MDN here and summarize what the common mistakes are.
  6. Why would you use async/await over .then?
Louis[n] went[v] to the store[n], and it was fun[a]. He taught[v] the class[n].

Learning Objectives

The objective of this discussion is to expose you to some of the popular frameworks that are built on top of JavaScript or React. The goal is not for you to know how to use these, but simply understand what their intended usage is in case you want to use it at some point in time.

For each of these, I want you to answer the following questions for the class:

  1. Why does this exist? Why did people spend hundreds of hours of their time to build this?
  2. For what types of projects would you use this for?

Questions

  1. Gatsby
  2. Storybook