Skip to content

Instantly share code, notes, and snippets.

View halitbatur's full-sized avatar
🏠
Working from home

Halit Batur halitbatur

🏠
Working from home
View GitHub Profile
@halitbatur
halitbatur / AI.md
Created August 20, 2024 08:59
Ai related questions

Discussion questions about AI

  1. What is Hugging Face, and what role does it play in the AI community?
  2. What is a Large Language Model (LLM)?
  3. What are some popular LLMs available on Hugging Face?
  4. How do you use a model from Hugging Face in a Python project?
  5. What is Gradio, and how does it simplify AI demos?
  6. What are some examples of AI applications built using Gradio?
  7. How can Gradio be integrated with Hugging Face models?
@halitbatur
halitbatur / testing.md
Created July 23, 2024 07:14
Jest and Supertest

Testing Discussion #2

  1. What is the role of the describe and it functions in Jest? How do they help in organizing and structuring test cases?
  2. Explain how to use Supertest for testing HTTP endpoints in an Express.js application. What are the steps involved in setting up Supertest?
  3. Discuss the purpose of mocking in Jest. How can you use jest.mock to simulate dependencies in your tests? Provide an example of mocking a database module in an Express.js application.
  4. How can you use Jest’s expect function to perform assertions in your tests? Provide examples of different types of assertions (e.g., toEqual, toBe, toMatchObject) and explain when to use each.
  5. What are hooks in Jest, and how can they be used to set up and tear down test environments? Describe the differences between the hooks and provide scenarios where each hook might be appropriately used.
@halitbatur
halitbatur / test.md
Created July 22, 2024 07:17
Testing

Testing in JS disscusion

  1. What is the purpose of unit testing in JavaScript development? How does it contribute to the overall quality of a software application?
  2. Explain the difference between manual testing and automated testing. What are the advantages of using automated testing in JavaScript projects?
  3. What is a test suite, and how does it relate to test cases in JavaScript testing? Provide an example of a test suite and its corresponding test cases.
  4. Describe the concept of test-driven development (TDD) in JavaScript. How does TDD influence the development process and help in writing robust and reliable code?
  5. What are the popular testing frameworks and libraries available for JavaScript? Compare and contrast two of them, highlighting their key features and use cases.
@halitbatur
halitbatur / security.md
Last active July 18, 2024 08:52
Security Attacks

Modern Security Attacks

  1. What is a CSRF attack? How does it use HTTP requests? And why do we call it the one-click attack?

  2. What is an XSS attack? And what is the connection between it and cookies/sessions? What are the two main categories of XSS?

  3. What is a phishing attack? How do attackers typically execute phishing attacks, and what are their primary goals?

  4. What is a man-in-the-middle (MITM) attack? How do attackers perform MITM attacks, and what can be the consequences for victims?

@halitbatur
halitbatur / authAndSecurity.md
Created July 15, 2024 07:08
Discussion about Auth and Security

Discussion Questions on Authentication and Security

  1. Why is it important to secure a backend application, and what are some potential risks if it remains unsecured? Discuss how attaching data to a user identity can mitigate some of these risks.

  2. How does the use of tokens enhance the security of a web application? Explain the process of generating and using tokens for user authentication, and compare it with the use of plain email and password combinations.

  3. What are the benefits of using modern hashing algorithms for passwords compared to older methods? Discuss the role of salting in preventing attacks and the concept of an adjustable cost factor.

  4. Explain the steps that take place when a user signs in to a website. How is the authentication data handled and stored, and what are the implications of these storage locations on security and user experience?

@halitbatur
halitbatur / mongoose.md
Created July 11, 2024 07:20
Mongoose Discussion

Mongoose Discussion

  1. Explain the purpose of Mongoose middleware. How can you use pre and post hooks to manage data before and after certain operations? Provide examples of use cases where middleware would be beneficial in an Express.js application.
  2. How does Mongoose support indexing, and why is indexing important for database performance? Discuss how to create and use indexes in your schema and the impact they have on query efficiency.
  3. Describe the concept of schema methods in Mongoose. How do they differ from static methods, and when would you use each type? Give examples of scenarios where schema methods would enhance the functionality of your application.
  4. What are the advantages of using Mongoose’s built-in query helpers? How do they simplify the process of writing queries in an Express.js application? Discuss examples of custom query helpers you might create for a project.
  5. How does Mongoose handle relationships between different collections? Discuss the use of references and embedded docu
@halitbatur
halitbatur / mvc.md
Created July 4, 2024 07:17
MVC and CRUD

Discuss the points below with your teammates and add your answers below in the comments

  1. What is the best/most common file structure for backend NodeJS projects?
  2. What is the MVC architecture? Why we will be using it?
  3. Explore defining a schema in Mongoose, you can refer to this for more information (no answer in the comments required).
  4. What are the CRUD operations? add an example code of each CRUD operations in Mongoose.
@halitbatur
halitbatur / dataModel.md
Created July 4, 2024 07:15
Data Model activity

List of Apps

  • Twitch
  • Instagram
  • Airbnb
  • Uber eats
  • Twitter
  • Any Banking app (Most of them have similar data models)
  • Netflix
  • Github
  • Splitwise
@halitbatur
halitbatur / restdisucssion.md
Created June 25, 2024 06:47
Rest Discussion

RESTful API Discussion Questions

  1. What are the HTTP Methods in RESTful API and when would you use each of these?
  2. What does this HTTP Status codes represent?
    • 1xx
    • 2xx
    • 3xx
    • 4xx
    • 5xx
  3. What is the difference between the following response functions?
  • res.send()
@halitbatur
halitbatur / contextAPI.md
Created June 10, 2024 06:57
Context API and state management discussion
  1. What is React.useContext, and how does it differ from traditional prop drilling?
  2. What are some common use cases for React.useContext, and when might you prefer to use it over other state management solutions like Redux or MobX?
  3. How do you create and consume a Context in a React application? Can you walk through a basic example?
  4. What are the limitations of using React.useContext for state management? How do these limitations compare to other tools like Redux or Zustand?
  5. In what situations might it be beneficial to combine React.useContext with other state management libraries? Provide an example scenario.