Format numbers using compact notation
const number = 2500000; // Basic usage const formatter = new Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' // 'short' or 'long' }); console.log(formatter.format(number)); // "2.5M"
Search for a command to run...
const number = 2500000; // Basic usage const formatter = new Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' // 'short' or 'long' }); console.log(formatter.format(number)); // "2.5M"
In Tailwind CSS, ring and border utilities both create visual boundaries around elements, but they differ significantly in their underlying implementation and how they affect the element's layout. Border: Implementation: border utilities directly ap...
Developers who utilize AI for code generation don't necessarily need to understand every line of the generated code. Instead, they should approach it as they would code written by another developer. A thorough review is essential, but it's not requir...
[https://chatblogr.com](https://chatblogr.com) is a yet another chat pp where you can chat with Cerebras Inference. It allows you to save the chat for future reference. And the best you can convert that into a blog. For example, https://chatblogr.com...

After building an awesome page or a website, it is usual to share the link in social media to get an audience. Social media sites like Facebook or Twitter use the meta tags in the page to show the link preview. For example, consider sharing the link ...
Auth.js is a popular framework for authentication in a NextJS app. The basic configuration is shown below import NextAuth from "next-auth" import { PrismaAdapter } from "@auth/prisma-adapter" import { prisma } from "@/prisma" import Google from "next...
Consider a div with the following style .fixed-div { position: fixed; left: 0; right: 0; top: 0; bottom: 0; } The expectation from this div is to stretch the entire view port. However, when this div is placed with another div that is relat...

Sometimes, there may be lot of zeroes in a number. While displaying big numbers, it is often better to show the number as 1.2M or 25B. toLocaleString provides a neat way to do it. numberValue.toLocaleString('en-US', { minimumFractionDigits: 1, ...

Use graphql-codegen for generating graphql types for a nextjs app. The input to the tool is the GraphQL schema and location of the gql tags (or GraphQL document). These inputs are provided in a codegen.ts file. import { CodegenConfig } from '@graphql...
