Skip to main content

Posts

Best Practice for css naming conventions and BEM rules

The Block, Element, Modifier methodology (commonly referred to as BEM) is a popular naming convention for classes in HTML and CSS. Developed by the team at Yandex, its goal is to help developers better understand the relationship between the HTML and CSS in a given project.Here’s an example of what a CSS developer writing in the BEM style might write:/* Block component */.btn{}/* Element that depends upon the block */.btn__price{}/* Modifier that changes the style of the block */.btn--orange{}.btn--big{}In this CSS methodology a block is a top-level abstraction of a new component, for example, a button: .btn { }. This block should be thought of as a parent. Child items, or elements, can be placed inside and these are denoted by two underscores following the name of the block like .btn__price { }. Finally, modifiers can manipulate the block so that we can theme or style that particular component without inflicting changes on a completely unrelated module. This is done by appending two …
Recent posts

BlogPosting Schema Markup to Blog Posts

AWS FREE Tier FAQs

WS Free Tier FAQs
Q: What is the AWS Free Tier?
The AWS Free Tier provides customers the ability to explore and try out AWS services free of charge up to specified limits for each service. The Free Tier is comprised of three different types of offerings, a 12-month Free Tier, an Always Free offer, and short term trials. Services with a 12-month Free Tier allow customers to use the product for free up to specified limits for one year from the date the account was created. Services with an Always Free offer allow customers to use the product for free up to specified limits as long as they are an AWS customer. Services with a short term trial are free to use for a specified period of time or up to a one-time limit depending on the service selected. Details on the limits and services provided for free are detailed in each card on the Free Tier page. If your application use exceeds the free tier limits, you simply pay standard, pay-as-you-go service rates (see each service page for full pric…

How to determine the size of MySQL databases and tables

SELECT table_schema AS "Database",
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)"
FROM information_schema.TABLES
GROUP BY table_schema;To determine the sizes of all of the tables in a specific database, at the mysql> prompt, type the following command. Replace database_name with the name of the database that you want to check:SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "database_name" ORDER BY (data_length + index_length) DESC;

Why we create separate model for request and response in rest api

We take separate model for request and response these are basically from UI point of view. Suppose we get the data from end user like : firstName, lastName, email, password.

We get this data in JSON formate so we have to convert this JSON object to java object for that we create a separate model object in the package ui.model.request. and it will also used by spring framework to convert JSON object to Java object.

Once we persist the data then we get some response back but in that response we. have like pkId of table but we don't want to send this in our response so we can't use a single entity that we used to perisit our data. So we create a new package with ui.model.response and we will copy that required fields and this will used to convert from Java object to JSON and it will be sent back to spring framework





Here incoming request like from end user






Now this incoming request received by method called createUser(); and @RequestBody annotation will take this request as JSON …

Angular 9 ngForm, ngNoForm and Template Reference Variables

What is Angular NgForm

It's simply a directive exported from FormsModule which gets automatically added to all <form> tags in your Angular templates once you import the module.

Behind the curtains, the ngForm directive creates a top-level FormGroup instance and binds it to your <form> tag to enable you to work with the form. For example to access the aggregate form value or check validation status.
How to Access Angular NgForm Using Template Reference Variables

Since the ngForm directive is implicitly added in your <form> tag when you import its parent module (FormsModule) in your application, you don't need to do any configuration to start working with template-based forms.

You can simply get a reference to your form' ngForm directive by exporting it into a local template variable and by using the ngForm directive as the value of the variable (#myForm=ngForm).

Using Angular ngNoForm If you you want to import FormsModule in your application but want to skip …

how to add angular material in angular 9

Step 1: First go to the project (inside the project folder) run the following command.

Mukeshs-MacBook-Air:angular-matrial-project mukeshchoudhary$ ng add @angular/material ?Would you like to share anonymous usage data about this project with the Angular Team at Google under Google’s Privacy Policy at https://policies.google.com/privacy? For more details and how to change this setting, see http://angular.io/analytics.Yes
Thank you for sharing anonymous usage data. Would you change your mind, the following command will disable this feature entirely:
ng analytics project off
Installing packages for tooling via npm. Installed packages for tooling via npm. ?Choose a prebuilt theme name, or "custom" for a custom theme:Indigo/Pink[ Preview: https://material.angular.io?theme=indigo-pink ] ?Set up global Angular Material typography styles?Yes ?Set up browser animations for Angular Material?Yes UPDATE package.json (1364 bytes) ✔ Packages installed successfully. UPDATE src/app/app.module.ts (502 by…