Author: pawan

  • Python Variables – Assign Multiple Values

    Python allows you to assign values to multiple variables in one line:

  • python type casting

    though not necessary to declare the type of variable, but it can be casted to a specific type. example below

  • python comment

    python comment starts with # Since Python will ignore string literals that are not assigned to a variable, you can add a multiline string (triple quotes) in your code, and place your comment inside it:

  • Python Indentation

    Where in other programming languages the indentation in code is for readability only, the indentation in Python is very important. Python uses indentation to indicate a block of code. The number of spaces is up to you as a programmer, the most common use is four, but it has to be at least one. example

  • Showing loader in nextJs

    you need to wrap the children in root layout with a built in Suspense component. Example: Another way is to create a loading component in project root with the follow code also to use loading spinner you need to have tailwind and daisy-ui installed to install daisy ui use below command

  • Adding navbar to NextJs project

    Add a new file NavBar.tsx next to layout.tsx that is in the root of the project and the add the below code. Then layout.tsx to be modified like below

  • Admin Layout

    create an admin folder in app folder and then create a file named layout.tsx or layout.jsx. and create a component for layout like

  • react nextJs css module or scoped css

    with convention you should name module.css like productcard.module.css and them import that css as and then you can use this css like Note: donot use css classes with name with hypen – as css classes are properties of javascript object style, which cannot have hypen. assuming that you have a class as card in ProductCard.module.css.

  • NextJs client component

    for using client component you just need to add use client on top of the component and then you can use useState, useEffects and onClick listners More detailed example

  • NextJs Navigation or nextJs link

    example for creating link for nextJs detailed example