javascript

Creating Chat Bubbles with curls in React Native (svg)

Creating Chat Bubbles with curls in React Native (svg)

Recently, while working on a project, I needed to create a chat feature with a UI similar to iMessage. When I reached the part where I had to implement the curls, I considered three options: One: Use before and after pseudo element. (Challenge: pseudo classes and element do not work in react-native, hence option 2) Two: Use two Views one for the curl and another to overlap it. Something like this <View style={styles.chatBubble}> <Text style={styles.text}> Hey whats up </Text> <View style={styles.curl}></View> <View style={styles.curlOverlap}></View> </View> Enter fullscreen mode Exit fullscreen mode Three: Use an Svg. Less work :) yay! Initially, I…
Read More
DOM | Selectors

DOM | Selectors

DOM (Document Object Model) selectors are methods provided by the browser to access elements in an HTML document. Here are the primary types of DOM selectors explained with examples: 1. getElementByIdThis method selects an element by its unique id attribute. html Copy code <!DOCTYPE html> <html> <head> <title>getElementById Example</title> </head> <body> <div id="myDiv">Hello, World!</div> <script> var element = document.getElementById('myDiv'); console.log(element.textContent); // Output: Hello, World! </script> </body> </html> Enter fullscreen mode Exit fullscreen mode 2. getElementsByClassNameThis method selects all elements with a specified class name and returns an HTMLCollection (similar to an array, but not exactly). <!DOCTYPE html> <html> <head> <title>getElementsByClassName…
Read More
From Monolithic to Microservices: A Comprehensive Guide

From Monolithic to Microservices: A Comprehensive Guide

In the evolving landscape of software development, the transition from monolithic architectures to microservices has become a significant trend. This transformation promises enhanced scalability, flexibility, and maintainability. In this blog, we will delve deep into the intricacies of both architectures, their pros and cons, and provide a detailed roadmap for migrating from a monolithic system to a microservices-based architecture. Understanding Monolithic Architecture A monolithic architecture is a traditional model for the design of a software program. Here, the application is built as a single, unified unit. Typically, a monolithic application consists of: A single codebase: All functionalities are interwoven and…
Read More
What is Threads and its use in Node.js

What is Threads and its use in Node.js

In the bustling world of computer science, threads are like tiny, independent workers within a larger workshop, a process. Imagine a single process as a factory. This factory has various tasks to complete, from assembling parts to running quality checks. Threads, on the other hand, are the individual workers on the assembly line. They share the same resources (tools, materials) within the factory (process) but can work on different tasks (instructions) concurrently. What are Threads? Threads are lightweight units of execution within a process. They share the same memory space and resources (like CPU time) of the process they belong…
Read More
Mastering Config-Driven UI: A Beginner’s Guide to Flexible and Scalable Interfaces

Mastering Config-Driven UI: A Beginner’s Guide to Flexible and Scalable Interfaces

Introduction In the world of front-end development, creating user interfaces (UI) that are flexible, maintainable, and scalable is crucial. One approach that helps achieve these goals is the concept of a config-driven UI. This blog will introduce you to config-driven UI, explain its benefits, and provide simple examples to help you understand how it works. What is Config-Driven UI? Config-driven UI is a design pattern where the structure and behaviour of the user interface are defined using configuration files rather than hard-coded in the application. These configuration files are typically in formats like JSON or YAML. By separating the UI…
Read More
Understanding Type Guards in Effect-TS: Ensuring Safe Option Handling

Understanding Type Guards in Effect-TS: Ensuring Safe Option Handling

In functional programming, handling optional values effectively and safely is paramount. Effect-TS provides robust tools to manage Option types, ensuring that developers can handle the presence or absence of values in a type-safe manner. One critical aspect of working with Option types is understanding and using type guards. In this article, we'll explore how to use various type guards provided by Effect-TS to check and handle Option types effectively. What is an Option? An Option type represents a value that may or may not exist. It encapsulates an optional value with two possible states: Some(value): Represents a value that exists.…
Read More
Versatility in Action: Exploring Key Fields Where MERN Stack Developers Excel

Versatility in Action: Exploring Key Fields Where MERN Stack Developers Excel

MERN stack developers are well-suited for various fields due to their proficiency in full-stack web development. Here are some key fields where MERN stack developers excel: 1. Web Development Front-End Development: Creating responsive, dynamic user interfaces using React. Back-End Development: Building robust server-side applications with Node.js and Express.js. Full-Stack Development: Handling both front-end and back-end development, ensuring seamless integration between the two. 2. Single Page Applications (SPAs) Dynamic Websites: Developing interactive and user-friendly websites that provide a smooth user experience without reloading pages. 3. E-Commerce Development Online Stores: Building scalable and secure e-commerce platforms with features like shopping carts, payment…
Read More
Advanced NVM Commands for Efficient Node.js Version Management

Advanced NVM Commands for Efficient Node.js Version Management

Advanced Installation Commands Install Node.js from Source For developers needing a specific setup or patch: nvm install -s <node_version> Enter fullscreen mode Exit fullscreen mode Reinstall Packages When Installing a New Version Easily transfer global packages to the newly installed version: nvm install <node_version> --reinstall-packages-from=current Enter fullscreen mode Exit fullscreen mode Install Multiple Versions Simultaneously Batch install several versions at once: nvm install <node_version_1> <node_version_2> <node_version_3> Enter fullscreen mode Exit fullscreen mode Efficient Node Version Switching Switching with Environment Variables Automatically switch Node.js versions based on your project’s configuration: export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This…
Read More
Seamless State Management using Async Iterators

Seamless State Management using Async Iterators

In my recent post about AI-UI, I touched on why I developed the library. I wanted declarative markup I wanted type-safe component encapsulation, with composition & inheritance I wanted a small, fast client-side solution with no complex build process (or any build process!) ...but most importantly... I didn't want to learn a whole new API just to manipulate data I already have in my app In my single page apps, I've got remote APIs and endpoints that supply data. Sure, I might want to do a bit of arithmetic, sorting, formatting, but basically, I want to say to the UI:…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.