How to configure Git to use Notepad or any editor of your choice as the default text editor

Open a command prompt or terminal window

Type the following command to set Notepad as the default text editor for Git:

GIT command
git config --global core.editor notepad

This will set Notepad as the default text editor for all Git repositories on your system.

Now when you need to edit a commit message or any other text file in Git, Git will open the Notepad editor for you to make changes.

Note:

that Notepad may not be the best choice for a text editor for programming, as it lacks many features that are helpful for coding.

You may want to consider using a more advanced text editor, such as Visual Studio Code, Atom, Sublime Text, or Notepad++, depending on your preferences.

To use a different text editor with Git, just replace "notepad" with the name of your preferred text editor in the command above.



javascript quick Cheat sheet

Variables:

JAVA SCRIPT
// Declare a variable with let
let x = 5;

// Declare a constant with const
const y = 10;

// Declare a variable without assigning a value
let z;

Data types:

JAVA SCRIPT
 // Number
let a = 5;
let b = 3.14;

// String
let c = "Hello";
let d = 'World';

// Boolean
let e = true;
let f = false;

// Undefined
let g;

// Null
let h = null;

// Object
let i = { name: "John", age: 30 };

// Array
let j = [1, 2, 3, 4];

Operators:

JAVA SCRIPT 
 // Arithmetic operators
let a = 5 + 2; // 7
let b = 5 - 2; // 3
let c = 5 * 2; // 10
let d = 5 / 2; // 2.5
let e = 5 % 2; // 1

// Comparison operators
let f = 5 == 5; // true
let g = 5 === '5'; // false
let h = 5 != 5; // false
let i = 5 !== '5'; // true
let j = 5 > 2; // true
let k = 5 < 2; // false
let l = 5 >= 5; // true
let m = 5 <= 2; // false

// Logical operators
let n = true && false; // false
let o = true || false; // true
let p = !true; // false  
 

Conditional statements:

JAVA SCRIPT 
 // If statement
let a = 5;
if (a > 2) {
console.log("a is greater than 2");
}

// If-else statement
let b = 1;
if (b > 2) {
console.log("b is greater than 2");
} else {
console.log("b is less than or equal to 2");
}

// If-else if-else statement
let c = 0;
if (c > 0) {
console.log("c is positive");
} else if (c < 0) {
console.log("c is negative");
} else {
console.log("c is zero");
} 

Loops:

JAVASCRIPT
// For loop
for (let i = 0; i < 5; i++) {
console.log(i);
}

// While loop
let j = 0;
while (j < 5) {
console.log(j);
j++;
}

// Do-while loop
let k = 0;
do {
console.log(k);
k++;
} while (k < 5);

// For-in loop (used to loop over properties of an object)
let person = { name: "John", age: 30 };
for (let key in person) {
console.log(key + ": " + person[key]);
}

// For-of loop (used to loop over elements of an array)
let arr = [1, 2, 3];
for (let value of arr) {
console.log(value);
}

Functions:

JAVASCRIPT 
// Function declaration
function add(a, b) {
  return a + b;
}

// Function expression
let multiply = function(a, b) {
  return a * b;
};

//

interpolation in angular

Interpolation in angular is a technique used to dynamically generate content based on data or variables. It is a way of injecting data into templates using a special syntax. 
In Angular, interpolation is achieved by wrapping a variable or expression 
in double curly braces {{ }}.
For example:
If you have a variable name defined in your component, you can display its value in the template using interpolation as follows:

<p>Hello, {{name}}!</p>

If the value of the name is "zaheer", the above code will render as:
<p>Hello, John!</p>

Angular supports expressions inside the double curly braces as well. This means you can perform arithmetic operations or call functions and display their results in the template using interpolation. For example:

Interpolation is a powerful feature of Angular that makes it easy to create dynamic and responsive applications.

Examples of how interpolation can be used in Angular:

Displaying Component Properties:

One common use case for interpolation is to display component properties in the template. 
Let's say we have a component with a property called message. 
We can use interpolation to display the value of the message in the template like this:

<p>{{ message }}</p>

Performing String Concatenation:

Interpolation can also be used to concatenate strings in the template. For example, 
let's say we have two properties in our component, firstName, and lastName. 
We can use interpolation to combine these two properties into a single string in the template like this:

<p>{{ firstName + ' ' + lastName }}</p>

Evaluating Expressions:

In addition to displaying properties and concatenating strings, interpolation can also be used to evaluate expressions in the template. 
For example:
Let's say we have a component with a property called count. 
We can use interpolation to display the result of an expression that doubles the value of the count like this:

<p>{{ count * 2 }}</p>

Conditionally Displaying Content:

Interpolation can also be used to conditionally display content in the template using the ternary operator. For example, let's say we have a component with a property called isLoggedIn. We can use interpolation to display a different message depending on whether the user is logged in or not like this:

<p>{{ isLoggedIn ? 'Welcome back!' :

'Please log in.' }}</p>

Using Template Variables:

In addition to displaying component properties and evaluating expressions, interpolation can also be used with template variables. Template variables allow you to reference elements in your template and perform actions on them. 
For example:
Let's say we have an input element in our template and we want to reference its value in our component. We can use a template variable to achieve this:
<input #myInput type="text">

<p>{{ myInput.value }}</p>

In the above example, we've created a template variable called myInput that references the input element. We can then use interpolation to display the value of the input element's value property in the template.

Displaying Arrays:

Interpolation can also be used to display arrays in the template. Let's say we have an array of numbers in our component. 
We can use interpolation to display each number in the array using the *ngFor directive:
<ul> <li *ngFor="let number of numbers">
{{ number }}</li>
</ul>
In the above example, we're using the *ngFor directive to loop over the numbers array and 
display each number in a list item using interpolation.

Using Pipes:

You can use pipes with interpolation to format and transform data before displaying it in the template. For example: 
Let's say we have a component with a property called price that contains a number. We can use the currency pipe to format the price as a currency value in the template like this:

<p>{{ price | currency }}</p>

How to add all the files except one file into the git



To add all files in a git repository except for one file, you can use the following command:


git add --all :!file_to_exclude


Replace  "file_to_exclude"  with the name of the file that you want to exclude from the list of files to be added.

For example:
If you want to add all files except for a file named  "secret.txt",  you can use the following command:


git add --all :!secret.txt


This will add all files in the repository except for the "secret.txt" file.





Html complete Notes

posts

css syntax and selectors

css syntax and selectors

CSS (Cascading Style Sheets) is a language used for describing the presentation of a document written in a markup language, such as HTML or XML. 
It is used to control the layout and visual design of web pages.

CSS selectors are used to select elements on a web page and apply styles to them. 
Some common types of selectors include:

Element selectors: Selects elements based on their HTML tag name, such as "p" for paragraphs or "h1" for headings.
Example:
p {
color: blue;
}




Class selectors: Selects elements based on their class attribute. Classes are assigned to elements using the "class" attribute, and multiple elements can share the same class. 
Example:

.highlight {
    background-color: yellow;
 }


 

ID selectors: Selects elements based on their id attribute. 
IDs are assigned to elements using the "id" attribute, and each element can have only one unique id. 
Example:

 #header {
       font-size: 20px;
   }

 
  

Attribute selectors: Selects elements based on their attributes and attribute values. 
Example:

a[href='https://example.com']
     {
       color: red;
     }


    

There are also more advanced selectors such as:

Pseudo-class selectors: Selects elements based on their state or position in the document, such as links that have been visited or elements that are being hovered over. 
Example: 

  a:hover {
       text-decoration: underline;
   }



 

Pseudo-element selectors: Selects a specific part of an element, such as the first letter of a paragraph or the ::before and ::after of an element. 
Example:
  p::first-letter {
     font-size: 20px;
  }



You can also group selectors to apply the same styles to multiple elements. 
Example:

h1, h2, h3 {
  color: blue;
  text-align: center;
}



You can also use CSS cascading and inheritance to apply styles to child elements. 
Example:

#parent {
color: blue;
}
#parent .child {
background-color: yellow;
}


It is important to note that the specificity of the selectors is also important, more specific selectors will have precedence over more general selectors.