<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Ajinkya Chanshetty's Blog]]></title><description><![CDATA[Ajinkya Chanshetty's Blog]]></description><link>https://ajinkya10x.com</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 08:25:21 GMT</lastBuildDate><atom:link href="https://ajinkya10x.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[The safe space]]></title><description><![CDATA[We’ve all had moments where we lose our cool. You’re mad, your heart’s pounding, and suddenly you say, “You never listen!” or “Why do you always screw up?” It feels like a relief for a second, like letting out a big breath. But then you see their fac...]]></description><link>https://ajinkya10x.com/the-safe-space</link><guid isPermaLink="true">https://ajinkya10x.com/the-safe-space</guid><category><![CDATA[Care]]></category><category><![CDATA[love]]></category><category><![CDATA[Relationship]]></category><category><![CDATA[friendship]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Tue, 13 May 2025 15:49:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/kMnhiuPhzSY/upload/455cd5066daccf6deb4061f9e48ddadb.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We’ve all had moments where we lose our cool. You’re mad, your heart’s pounding, and suddenly you say, “You never listen!” or “Why do you always screw up?” It feels like a relief for a second, like letting out a big breath. But then you see their face—hurt, quiet—and you know you’ve messed up. You’ve just thrown a stone at a relationship you care about.</p>
<p>I’ve done this before. I bet you have too. The quickest way to wreck your relationships is to blurt out every thought in your head, no stopping, no thinking. It’s like spilling tea on a white shirt—it stains fast. When you talk without a pause, your relationships stop feeling safe and start feeling like a fight waiting to happen.</p>
<p>When you let every feeling pour out, it’s not just words. It’s pain. Saying stuff like “You’re so lazy” or “I’m sick of you” doesn’t disappear. It stays, like a scratch on your favorite table. I once got mad at my sister for borrowing my jacket without asking. “You’re so selfish!” I yelled. It wasn’t true—I was just annoyed about something else. But she looked so hurt, and we barely talked for days. That was on me, all because I didn’t wait a moment to calm down.</p>
<p>Those quick, mean words usually show what you’re feeling—like if you’re tired or stressed. But to the other person, it feels like you’re attacking them. They start to keep their distance, not because they don’t love you, but because they don’t want to get hurt again. Your family and friends aren’t there to take your bad moods—they deserve kindness.</p>
<p>If you keep saying whatever pops into your head, it makes people act differently around you. Your friend might stop telling you personal stuff because they’re scared you’ll snap. Your brother might avoid you to skip an argument. Even family dinners can feel tense, like everyone’s waiting for you to say something sharp. What used to be a cozy space turns into a place where people are careful around you.</p>
<p>I noticed this with a guy I work with. He’d always speak his mind, like saying “That’s a dumb idea” in meetings. He didn’t mean to be rude, but people stopped talking to him as much. It made me think about how my own words might push people away if I’m not careful.</p>
<p>So, how do you fix this? It’s not about hiding how you feel or acting fake. It’s about taking a tiny second—a deep breath, maybe counting to three—before you talk. That little break is like catching a ball before it hits the ground. It lets you think, Is this what I want to say? Will it help or make things worse?</p>
<p>I started doing this after too many times saying “I’m sorry” for stuff I didn’t mean. When I’m about to get mad, I take a breath or drink some water. Sometimes I say, “Hold on, I need a sec.” It’s not perfect, and I still mess up, but it’s helped a lot. My talks with friends feel easier, like we’re on the same team. It shows I care about their feelings, not just getting my point across.</p>
<p>Here’s what’s worked for me, and maybe it’ll work for you:</p>
<ol>
<li><p>Name What You Feel: Think to yourself, “I’m mad” or “I’m upset.” It’s like putting a name on a pet—it makes it less wild.</p>
</li>
<li><p>Talk About Yourself: Instead of “You never help,” say “I’m feeling stressed.” It’s less like pointing a finger.</p>
</li>
<li><p>Fix It Fast: If you say something mean, stop and say, “Wait, let me say that better.” It’s okay to make mistakes.</p>
</li>
<li><p>Practice All the Time: Try waiting a second when you’re annoyed, like if someone cuts you off in traffic. It’s like training for the big moments.</p>
</li>
<li><p>Say Sorry for Real: If you hurt someone, don’t just say “Whatever.” Say, “I’m sorry, I’ll try not to do that again.” It means a lot.</p>
</li>
</ol>
<p>Your family, friends, and the people you care about make life better. They’re worth taking care of. When you stop and think before you speak, you’re not just avoiding a fight—you’re showing you value them. You’re building trust and making your relationships a place where everyone feels safe. Thats the safe place everyone should have for others.</p>
<p>Next time you want to let everything out, take a breath. Think about the connection you want to keep, not the one you might break. It’s a small thing that changes a lot. Your loved ones will see it, and you’ll feel good knowing you’re keeping things strong.</p>
]]></content:encoded></item><item><title><![CDATA[Adulting the other way round]]></title><description><![CDATA[Life has a funny way of teaching us things, especially through the people we meet and the friendships we make. One big lesson it teaches is about karma—what goes around, comes around. Your actions, your thoughts, everything comes back to you somehow....]]></description><link>https://ajinkya10x.com/adulting-the-other-way-around</link><guid isPermaLink="true">https://ajinkya10x.com/adulting-the-other-way-around</guid><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Sat, 03 May 2025 11:00:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1747091020527/968779a4-68ca-4836-a145-e36f6f57753e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Life has a funny way of teaching us things, especially through the people we meet and the friendships we make. One big lesson it teaches is about <em>karma</em>—what goes around, comes around. Your actions, your thoughts, everything comes back to you somehow. And I’ve noticed something interesting: the people around us, especially our friends, show us who they really are over time.</p>
<p>I’ve seen that real friends, the ones who truly care about you, are rare. They’re happy when you do well and stick by you when things get tough. But then there are others—fake friends—who act like they’re happy for you but deep down, they’re not. They smile and say nice things when you succeed, but inside, they’re jealous. They keep an eye on everything you do, waiting for you to mess up. If you’re in trouble or struggling, they secretly feel happy, even though they act all supportive on the outside. It’s like they’re wearing a mask, pretending to be someone they’re not.</p>
<p>I saw a reel the other day that said something interesting. It said that if your close friends, ones you’ve known for years, suddenly drift away or stop talking to you for no clear reason, it might be the universe’s plan. It’s like life puts you in situations where you see their true face. The mask falls off, and you realize who they really are.</p>
<p>Honestly, I don’t fully believe in this whole “universe planning things” idea. It sounds a bit too filmy for me. But these kinds of experiences do make you think. They make you look at the people in your life and wonder who’s real and who’s just acting.</p>
<p>This is where karma fits in. Karma isn’t just about what you do—it’s also about what’s in your heart. People who secretly enjoy your problems or get jealous of your success are creating bad karma for themselves. Life has a way of balancing things out, and they’ll face the consequences someday. On the other hand, when you’re kind, honest, and supportive, you create good karma, and good things come back to you.</p>
<p>So, what’s the takeaway? First, give time some time—it always shows you who’s genuine. Second, don’t feel bad when someone’s true colors come out. Think of it as a chance to make space for better people in your life. And most importantly, focus on your own karma. Be a good friend, be real, and let life take care of the rest.</p>
<p>In the end, karma is like a mirror—it shows who you really are. As we go through life and deal with all kinds of people, it’s this mirror that helps us find true friends and live a better, happier life.</p>
<p>Thats another way of adulting and realising that we’re bound with Karmic bondage and letting things happen the way they are.</p>
<p>What do you think about karma? Have you ever had a friend whose real face came out later? Share your thoughts, let’s talk!</p>
]]></content:encoded></item><item><title><![CDATA[Observe the observer]]></title><description><![CDATA[This morning, I went to the bank. I had a small task to complete, and the staff asked me to sit for a while. As I sat there, I pulled out my phone and started scrolling aimlessly. I was only focused on my work at the bank—nothing more.
I remembered h...]]></description><link>https://ajinkya10x.com/observe-the-observer</link><guid isPermaLink="true">https://ajinkya10x.com/observe-the-observer</guid><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Tue, 24 Dec 2024 05:55:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1735019696152/9788b872-8ad4-4621-8e38-96ee6df14c25.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This morning, I went to the bank. I had a small task to complete, and the staff asked me to sit for a while. As I sat there, I pulled out my phone and started scrolling aimlessly. I was only focused on my work at the bank—nothing more.</p>
<p>I remembered how, as a child, visiting the bank used to feel so exciting. I would look around with curiosity—at the staff, their shiny cabins, the various forms, and everything else. I still recall their logo and a large piece of art that used to hang there.</p>
<p>Today, however, there were changes in the bank’s surroundings. But I didn’t notice them, as my attention was glued to my phone. It made me realize how much I’ve dulled my ability to observe and engage with the present moment.</p>
<p>Being present means being fully aware of what’s happening around you—paying attention to every detail, every feeling, and understanding how you react to it. This awareness doesn’t come easily, but with daily practice, it can grow.</p>
<p>The truth is, we often ignore the present and lose ourselves in artificial distractions—like endlessly scrolling through our phones. This habit pulls us away from experiencing the real world.</p>
<p>To sense something new, our mind needs to be steady and alert, but very few people have this quality today.</p>
<p>If we think about it, can we notice something new in places we visit regularly? I believe we can, but what we notice will change with age and perspective.</p>
<p>Your intelligence is determined by how sharp your observation is and how deeply you engage with what you observe. That’s why the key is to <em>observe the observer</em>—yourself. When you do this, you’ll gain a whole new perspective on life</p>
<p>What has been your experience?</p>
]]></content:encoded></item><item><title><![CDATA[A Dragon is not a slave]]></title><description><![CDATA[People are often controlled by their habits. They seek comfort in familiar routines. For instance, even if we stay at a luxurious hotel while traveling, it doesn’t feel as comfortable as being at home. This shows how much we depend on our habits for ...]]></description><link>https://ajinkya10x.com/a-dragon-is-not-a-slave</link><guid isPermaLink="true">https://ajinkya10x.com/a-dragon-is-not-a-slave</guid><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Sun, 22 Dec 2024 14:20:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1734877205327/5f1e4a57-e85b-478a-844a-e9a403cadee2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>People are often controlled by their habits. They seek comfort in familiar routines. For instance, even if we stay at a luxurious hotel while traveling, it doesn’t feel as comfortable as being at home. This shows how much we depend on our habits for comfort.</p>
<p>When we think positively, we automatically feel better. On the other hand, if we constantly dwell on thoughts like, “I am unhappy” or “My life is full of problems,” we start embodying that negativity. Osho, in one of his books, mentioned that if a person repeatedly tells themselves for 15 days, “I am sick,” they will actually fall ill. This is because 90% of illnesses are mental, not physical.</p>
<p>In an interview, Shah Rukh Khan shared that every morning he tells himself, “I am the best!” He explained that life throws so many challenges at him, and he has no one to rely on for support. So, he motivates himself to stay strong. This highlights the importance of not becoming a slave to negativity, toxic people, or bad environments.</p>
<p>No situation in life has the power to enslave us unless we let it. Even in toxic relationships, we have the ability to free ourselves. However, this doesn’t mean we label everything as toxic or give up when patience is needed. Every situation must be critically analyzed and evaluated.</p>
<p>Nothing should have the power to control us. We are born with limitless potential. Like a dragon, we have the strength to soar high and overcome negative situations that try to limit us. We can burn away anything that restricts us.</p>
<p>A dragon cannot be caged or forced to perform in a circus because <strong>a dragon is not a slave</strong>.</p>
]]></content:encoded></item><item><title><![CDATA[The one and the odd one]]></title><description><![CDATA[Once, in the Mahabharata, Guru Dronacharya asked his students a question while teaching archery: “When aiming at the bird on the tree, what do you see?”
Most students gave answers like seeing the tree, its leaves, and flowers. However, Arjuna replied...]]></description><link>https://ajinkya10x.com/the-one-and-the-odd-one</link><guid isPermaLink="true">https://ajinkya10x.com/the-one-and-the-odd-one</guid><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Tue, 17 Dec 2024 16:00:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1734451197544/50ec359d-6e36-4566-a7b6-819770458c36.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Once, in the Mahabharata, Guru Dronacharya asked his students a question while teaching archery: “When aiming at the bird on the tree, what do you see?”</p>
<p>Most students gave answers like seeing the tree, its leaves, and flowers. However, Arjuna replied that he could only see the bird’s eye. We all know this story, but what do we learn from it?</p>
<p>Lately, I’ve noticed something about myself — my mood changes a lot, and it’s affecting my daily life.</p>
<p>Some days, I’m very focused. I work seriously and think about what I need to achieve, not just for the day but for the whole year. On such days, I feel motivated and clear about my goals.</p>
<p>But there are days when I feel completely unmotivated and meaningless. Even office work feels like a burden, and I end up sitting idle, scrolling through my phone for hours, wasting the entire day.</p>
<p>Then there are a few days when I keep listening to songs or some Urdu poetry. I spend hours on YouTube, listening to anything I can find and thinking deeply about it. On these days, I manage to do some work, but not much.</p>
<p>At times, I binge-watch movies or series, one after another, and lose one or two days completely. These kinds of mood swings aren’t helpful at all.</p>
<p>A few months ago, I made a plan to start exercising. Surprisingly, I went to the gym consistently for three months without breaking the momentum. There were days when I skipped it but I made sure that the flow of the workout would not get disturbed over the weeks. Despite work and other responsibilities, I never got tired or skipped a session. I felt proud of myself for staying so disciplined.</p>
<p>Through this, I realized something important: no matter what happens in life, we shouldn’t let it affect us too much. It means there can be a lot of things that might happen at the professional and personal level. There can be days of excitement and boredom or some frustrations and depression but you should keep a balance of that particular emotion very clearly.</p>
<p>If we decide to reset our minds daily and stay committed, we can achieve our goals.</p>
<p>If you truly want to do something, you have to keep other things in control and not let them overwhelm you. That’s the key to maintaining balance, and when you do that, everything starts falling into place.</p>
<p>This might be another sign of maturity that people hold while growing old. I have seen my parents or some people who react very normally to moments of frustration and have never seen their breakdown. This doesn’t mean that they never did, but their threshold was very high.</p>
<p>So the bottom line is to forget the world and just focus on that one single thing which you want the most. If you do it, then everything else will work out. The reward of that one thing will be much higher than the rest of the scrap. So you have to figure out every other thing that’s draining your energy is the ONE or Its just the odd one for you. I hope it makes sense.</p>
]]></content:encoded></item><item><title><![CDATA[A reflection on Perfect Days!]]></title><description><![CDATA[I recently watched a movie called *Perfect Days*. The main character isn’t your typical hero—he’s just a regular guy, blending into the crowd. He doesn’t have friends or family, and he lives in a tiny room without even a proper kitchen. Yet, despite ...]]></description><link>https://ajinkya10x.com/a-reflection-on-perfect-days</link><guid isPermaLink="true">https://ajinkya10x.com/a-reflection-on-perfect-days</guid><category><![CDATA[mentalhealth]]></category><category><![CDATA[psychology]]></category><category><![CDATA[Human Resources]]></category><category><![CDATA[mentalhealthawareness]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Wed, 04 Sep 2024 19:13:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1725477074507/41322643-800e-46b5-bed9-eac5675d1cb4.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I recently watched a movie called *Perfect Days*. The main character isn’t your typical hero—he’s just a regular guy, blending into the crowd. He doesn’t have friends or family, and he lives in a tiny room without even a proper kitchen. Yet, despite his simple life, he’s genuinely happy.</p>
<p>This made me think: what do we really need to be happy? We often think we need a lot, but when you break it down, the most important things are actually quite few.</p>
<p>In the past, people said the basics for a good life were food, clothing, and shelter. But today, it feels like we need so much more—a good job, a decent salary, and a lifestyle that’s better than those around us. We chase after all sorts of luxuries, from the latest gadgets to fancy vacations. But if we get caught up in this race, we might miss out on what truly makes us happy.</p>
<p>The movie is set in Japan, where many people live alone due to high living costs and demanding work hours. The main character, Hirayama, is one of these people. He lives in a small room in the city, but he seems perfectly content. His life shows that happiness doesn’t come from having more—it comes from appreciating what you already have.</p>
<p>Hirayama isn’t sad or lonely. Every day, he wakes up, looks at the sky, and smiles, grateful for another day. He loves photography and finds joy in taking pictures of the world around him. Even though he’s been doing it for years, he still sees something new and beautiful every day.</p>
<p>He also loves music, especially vintage records. He doesn’t care about how much they’re worth—he treasures them for the joy they bring him. There’s a touching scene where his niece, who comes from a wealthy family, visits him. She’s fascinated by his simple, peaceful life, even though she’s used to luxury.</p>
<p>Watching *Perfect Days* felt like a peaceful escape. It pulls you into a different world, where happiness isn’t about having more stuff or impressing others. Some parts of the movie might feel slow or repetitive, but that’s part of its charm. It shows how Hirayama finds joy in his daily routine, never getting bored but instead finding new enthusiasm each day.</p>
<p>The final scene of the movie is especially moving, filled with deep emotions and meaning. I won’t give it away, but it’s a moment that leaves a lasting impression.</p>
<p>If you’re looking for a movie that’s different from the usual, *Perfect Days* is worth your time. It’s not just entertainment—it’s a gentle reminder to appreciate the simple things in life. If you’re someone who enjoys finding deeper meaning in stories, this movie will speak to you. Thanks for reading—hope you enjoy the movie.</p>
]]></content:encoded></item><item><title><![CDATA[Empty Minds : Time to reset your brain]]></title><description><![CDATA[Whenever I open YouTube, it's filled with so much information about so many things. The homepage shows thumbnails of cricket, songs, movies, news, and podcasts. Our minds are bombarded with information from morning till night. All this information is...]]></description><link>https://ajinkya10x.com/empty-minds-time-to-reset-your-brain</link><guid isPermaLink="true">https://ajinkya10x.com/empty-minds-time-to-reset-your-brain</guid><category><![CDATA[psychology]]></category><category><![CDATA[Mental Health]]></category><category><![CDATA[wisdom]]></category><category><![CDATA[Mindset]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Mon, 02 Sep 2024 17:24:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1725297768827/e697da0f-8013-434c-be0c-3a2dfbb06433.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Whenever I open YouTube, it's filled with so much information about so many things. The homepage shows thumbnails of cricket, songs, movies, news, and podcasts. Our minds are bombarded with information from morning till night. All this information isn't important, but we still consume it for no reason.</p>
<p>Every notification and mindless scrolling on our phones keeps us engaged, but it drains our energy. Every thumbnail we see on YouTube, every news article, or random video takes away some of our energy. All this information is like garbage that drains our energy. We get exhausted quickly and can't even realize why we're so tired.</p>
<p>Our brains have a limited capacity and get tired easily. It demands extra energy to process all this information. So, we end up eating more, which can lead to weight gain. Our minds need rest. I realized this when I felt sleepy without reason. Also, I found that my productivity is higher when I take an afternoon nap and resume work after it.</p>
<p>Because our brains get tired in the first half of the day, they need some recharge to work efficiently. Nowadays, our minds need to be empty to think about new ideas or feel good experiences in nature. The taste of the first bite of our meal, the first sip of morning coffee, is always special. Our minds should be empty and curious enough to feel it. If we're taking these things for granted, our minds need to be emptied.</p>
<p>The first step to emptying our minds is realizing we don't need to know everything. So, be selective about online content. Unfollow accounts that don't add value and set boundaries for consumption. Secondly, do physical activities or take a 30-minute walk daily. Engage in real things like observing the sky or listening to different noises.</p>
<p>Listen to mindful music with no words or songs. Silent music can calm our minds. Also, listen to songs we like and sing along. This is my favorite activity, and I do it first thing in the morning while brushing my teeth. Don't use headphones; play it loudly for a different impact.</p>
<p>Clearing clutter from our minds is essential for our well-being. When we let go of irrelevant information, we make space for what truly matters. We can focus better, make decisions more easily, and enjoy life more fully. Emptying our minds doesn't mean we stop thinking; it means we think more clearly and intentionally.</p>
]]></content:encoded></item><item><title><![CDATA[About what matters and what not]]></title><description><![CDATA[I was watching an interview of Roger Federer yesterday who was giving a speech at some university recently. To be honest, I don't watch tennis because it's not so well celebrated in India. But, I know he’s a great player and is a renowned celebrity w...]]></description><link>https://ajinkya10x.com/about-what-matters-and-what-not</link><guid isPermaLink="true">https://ajinkya10x.com/about-what-matters-and-what-not</guid><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Mon, 15 Jul 2024 00:55:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1721004893654/8803439a-2ab3-4342-b10a-3daa93c9d097.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was watching an interview of Roger Federer yesterday who was giving a speech at some university recently. To be honest, I don't watch tennis because it's not so well celebrated in India. But, I know he’s a great player and is a renowned celebrity who does some big brand endorsements. During the talk, he said something important that triggered my senses.</p>
<p>He said that he has so many titles and grand slams and won almost 80% of the matches over the past twenty-plus years or so but if you look at his point score then you’ll realize that he has secured only 54% of them. So even if after scoring only half of the chances of winning the game, he was able to produce such a great winning ratio over the longer run.</p>
<p>This reminds me of Pareto’s Principle where he says that 20% of the goals produce 80% of the impact in life. He derived it from the fact that 80% of the properties and land in Italy is owned by the 20% super influential people. This law is applicable to all the other aspects of life as well.</p>
<p>It simply means that if you focus on the things that are very important and can produce maximum outcomes in life are really worth doing.</p>
<p>In our lives, the maximum impact is produced by the two factors that are an excellent career and prime health. If you have a great career then you become financially strong enough. As long as you are in great health then nothing can stop you from working hard. All the other factors are secondary and hardly matter.</p>
<p>If you are working on some top-notch technologies which are having great potential rather than the traditional ones then definitely you can earn in the maximum bracket.</p>
<p>There are some projects that produce the maximum revenue for the company rather than the other ones. Similarly, only a few people in the team create a major impact and drive the project.</p>
<p>It is said that 80% of the wealth is concentrated by the super wealthy people that are barely 20%.</p>
<p>So at the personal level, It doesn't matter if you’re an introvert and don't have many friends or you can't swim or drive or cook. It doesn't matter if you know financial growth options or not spiritual enough or don't have any hobby. These things are also important but only when you have the first two or three things such as career, health, and family very strong.</p>
<p>As long as you have supportive parents, loved ones, and family, there’s nothing that matters at all. If you don't like your job then can switch to another one. If your relationship is not working enough then can build the new one. If you don't have enough friends then can create some more for sure.</p>
<p>Even though we have a large circle of friends, there are usually only a couple of people who help us during tough times. It's important to rely on those who are there for us. People can be busy with other commitments and may not always be available, even if they want to help. Additionally, the individuals who provide support may change over different phases of life, so it's beneficial to have multiple reliable friends.</p>
<p>I have lost 2 Kg of weight in the last three months just by doing 12 hours of intermittent fasting and 30 minutes of walking daily. I just changed my meal timings of dinner and tried to maintain the 14-hour gap till I take something in the morning. So, usually, I fail but somehow I manage to maintain the 12-hour window. This is very simple and easy to follow and produces maximum outcomes.</p>
<p>So, the bottom line is to create only twenty percent of skills and techniques that will give you 80% of the understanding and expertise in that subject. Identify the two expenses that cost you the maximum salary. Spend your time on those things that will give you maximum satisfaction rather than chasing multiple things at a time.</p>
<p>Well, this was my perspective and the same rule can be applied to multiple things in life. That's all for now, Thanks for reading!</p>
]]></content:encoded></item><item><title><![CDATA[A Cold Mind and Warm Heart]]></title><description><![CDATA[Can you imagine a dish of biryani with some authentic aroma and all the spices on it. Also, the chillies and onion with some raita decorate it so perfectly and you get tempted to it within seconds.
Whenever you see any such kind of advertisement of B...]]></description><link>https://ajinkya10x.com/a-cold-mind-and-warm-heart</link><guid isPermaLink="true">https://ajinkya10x.com/a-cold-mind-and-warm-heart</guid><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Thu, 11 Jul 2024 18:17:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1720721811982/69efe315-4401-46da-b018-1c7849994038.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Can you imagine a dish of biryani with some authentic aroma and all the spices on it. Also, the chillies and onion with some raita decorate it so perfectly and you get tempted to it within seconds.</p>
<p>Whenever you see any such kind of advertisement of Biryani or Spicy chat then we get the craving for it so naturally. Suddenly something happens and your mouth becomes watery even if you just think of it.</p>
<p>So did you ever notice what happens in your brain?</p>
<p>There is something that triggers your emotional impulse which results in some action.</p>
<p>All the e-commerce giants like Amazon are spending millions of dollars to create these triggers.</p>
<p>This particular thing is very relative and varies from person to person, so if you’re not conscious enough then you’ll get affected by it easily.</p>
<p>So the most important thing here is to be conscious and alert about all these triggers.</p>
<p>You have to be very resilient and robust about it and make your mind so calm and composed that nothing could trigger you.</p>
<p>There can be a number of examples when external factors impact you so bad that you get lost in it. I have experienced a few such incidents in my life when I got driven by that particular situation. Later, when I look back at those things, I realize that I could have responded differently.</p>
<p>I had gone to a restaurant which was full of people sitting in the groups and I was all alone. I was so embarrassed to sit on the table with no one around me and I could barely take my head up from my mobile. I took my whole meal by just looking at the mobile and somehow ran away from that place.</p>
<p>Later, when I analyzed the same situation critically, I realized that there was no need to get that much embarrassed at all. So the next time when I went to the same restaurant and everything was the same but I did not turn up to my mobile and was sitting quite calmly and composed. No one was even looking at me and I was having so different assumptions in my mind.</p>
<p>The same kind of thing happens if you happen to go to watch a movie all alone. You will realize it if you have been in such a situation. It looks easy but takes real guts.</p>
<p>So the bottom line is to develop such kind of confidence and be immune to all the personal triggers.</p>
<p>The same happens when you see some advertising for some trendy sneakers and clothes and you can't resist visiting that particular portal.</p>
<p>Even when you listen to some music or song then it creates some form of pleasure in your mind and you just get carried away with it for a moment. This can be used as a great tool to calm and relax your mind consciously.</p>
<p>So, instead of getting blown away by such triggers, we should take charge of our minds and can become mindful.</p>
<p>It's a practice and you will achieve it when done consciously. The goal is to be so calm and relaxed as if you've taken some drug shots.</p>
<p>If you're able to understand what I'm trying to say then nothing will disturb you. Just pause for a moment and try to identify what signal its passing to your brain.</p>
<p>There's no drug or no situation or no single thing in this world which can surpass your consciousness and that's the beauty of the brain. This is how you can make your mind ice cold. That's all for now!</p>
]]></content:encoded></item><item><title><![CDATA[Wabi Sabi]]></title><description><![CDATA[I was just looking at my memories of google photos from last year and stumbled upon one of the photos where I looked quite fine. The photo was from some trip but I was looking fitter than today. I used to go to the gym back then and I had done it con...]]></description><link>https://ajinkya10x.com/wabi-sabi</link><guid isPermaLink="true">https://ajinkya10x.com/wabi-sabi</guid><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Tue, 11 Jun 2024 16:45:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1721005110698/6bfbcef4-5ffd-47aa-ad7a-69b881d06ff4.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was just looking at my memories of google photos from last year and stumbled upon one of the photos where I looked quite fine. The photo was from some trip but I was looking fitter than today. I used to go to the gym back then and I had done it consistently for three months.</p>
<p>Usually, I’m very bad with my workout routine and all but last year I was very serious.</p>
<p>I had followed it actively because I had some backlog of health debt so had no other option.</p>
<p>After a few months, I had some other priorities and I did not continue it. The other priority was my laziness and perhaps I gave much more importance to it.</p>
<p>Also, I thought why should I take some extra time and effort to build my physique unless its not much required. I dont want to go somewhere and do some modelling-like stuff so I will just be focused on my primary work more. If I were to be a model then definitely I would have made six pack abs and all other things.</p>
<p>Sometimes this is how i justify my excuses and avoid that extra push and run away from new challenges. Later I realized I wanted to learn a new hobby and that was playing guitar. I could have learned it earlier in my college days as well. I missed it and I regret it now.</p>
<p>Again I thought I should have taken the other stream of engineering and my life would have been so different by now. Then I thought I should have taken the offer of the other company instead of the current one and so on.</p>
<p>We always think about the other path that we didnt follow and keep on wondering how it would have made a difference to our lives. Most of the time we end up regretting the decisions we didnt take.</p>
<p>But Its always not the same case but our perception that the grass would have been greener on the other side. We never consider that some decisions were wrong at that time and you chose the right ones.</p>
<p>Also, we should not blame ourselves regarding the choices we made even if did not turn in our fever. Nobody is perfect and has the ability to do all things perfectly all the time.</p>
<p>There’s a Japanese concept of living a meaningful life known as ‘Wabi-Sabi’. It means we should not run behind the unrealistic pursuit of perfection and materialistic wealth. It simply means that you only need the bare minimum and not the perfect one.</p>
<p>It means there’s a beauty in the imperfection and accept the most natural phase of life. The sea shells are not perfectly carved yet they are beautiful. The cactus and palm trees are not perfect as per the standards but still, they are adored by a lot of people. Just accept the way you are today becuase you’re in the most authentic and natural state of life.</p>
<p>When we accept ourselves with all the imperfection then we become aware of our limitations. Then we dont set the unrealistic expectations and dont stress about it. This is the zone where growth happens. So, we should seek for the excellence and not for the perfection. This is how you can break that chain of regret and accept yourself the way you are.</p>
<p>So the bottom line is to never regret about anything and being more kind to yourself because you are real and beautiful!</p>
]]></content:encoded></item><item><title><![CDATA[Elevating Your JavaScript Game: The Essential ES6 Features You Need to Know]]></title><description><![CDATA[Javascript is mainly used for the front end programming and its new features makes it compatible with server side programming as well. Javascript was introduced around the year of 1995 that is almost 30 years back and after that many different featur...]]></description><link>https://ajinkya10x.com/elevating-your-javascript-game-the-essential-es6-features-you-need-to-know</link><guid isPermaLink="true">https://ajinkya10x.com/elevating-your-javascript-game-the-essential-es6-features-you-need-to-know</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[ES6]]></category><category><![CDATA[javascript framework]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[frontend]]></category><category><![CDATA[UI]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Fri, 08 Mar 2024 18:43:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709923342144/312298e7-5f68-4156-be6d-874e3e446626.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Javascript is mainly used for the front end programming and its new features makes it compatible with server side programming as well. Javascript was introduced around the year of 1995 that is almost 30 years back and after that many different features were introduced over the years. There were no classes initially and it was purely object based language.</p>
<p>It used to follow object based programming paradigm which is also known as OOPs concept. Recently around 2015 they launched ES6 features which gained popularity due to some drastic change in the structure of the language. After that a lot more features have been released in the ES series until ES14 which was last year in June 2023.</p>
<p>So, lets explore some of the cool features of ECMAScript community that completely changed the game of Javascript development and made it one of the most loved and used language on Stackoverflow survey of last seven years.</p>
<ol>
<li><p><strong>let and const Declarations:</strong></p>
<ul>
<li><p><code>let</code> and <code>const</code> declarations provide block-scoped variables, meaning they are only accessible within the block (typically enclosed in curly braces <code>{}</code>). This contrasts with <code>var</code>, which has function scope or global scope. <code>let</code> variables can be reassigned, while <code>const</code> variables are constants whose value cannot be changed after initialization.</p>
</li>
<li><p>Variables declared using the <code>var</code> keyword are scoped to the function in which they are created, or if created outside of any function, to the global object. <code>let</code> and <code>const</code> are <em>block scoped</em>, meaning they are only accessible within the nearest set of curly braces (function, if-else block, or for-loop).</p>
<pre><code class="lang-typescript">  <span class="hljs-comment">/**
   * All variables are accessible within functions.
   */</span>
  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">variableScope</span>(<span class="hljs-params"></span>) </span>{

    <span class="hljs-keyword">var</span> x = <span class="hljs-number">10</span>;
    <span class="hljs-keyword">let</span> y = <span class="hljs-number">20</span>;
    <span class="hljs-keyword">const</span> z = <span class="hljs-number">30</span>;

    <span class="hljs-built_in">console</span>.log(x); <span class="hljs-comment">// 10</span>
    <span class="hljs-built_in">console</span>.log(y); <span class="hljs-comment">// 20</span>
    <span class="hljs-built_in">console</span>.log(z); <span class="hljs-comment">// 30</span>
  }

  <span class="hljs-built_in">console</span>.log(x); <span class="hljs-comment">// ReferenceError: x is not defined</span>
  <span class="hljs-built_in">console</span>.log(y); <span class="hljs-comment">// ReferenceError: y is not defined</span>
  <span class="hljs-built_in">console</span>.log(z); <span class="hljs-comment">// ReferenceError: z is not defined</span>

  variableScope();
</code></pre>
<pre><code class="lang-typescript">  <span class="hljs-comment">/**
   * var declared variables are accessible anywhere in the function scope.
   */</span>
  <span class="hljs-keyword">if</span> (<span class="hljs-literal">true</span>) {
    <span class="hljs-keyword">var</span> a = <span class="hljs-number">10</span>;
    <span class="hljs-keyword">let</span> b = <span class="hljs-number">20</span>;
    <span class="hljs-keyword">const</span> c = <span class="hljs-number">30</span>;
  }

  <span class="hljs-built_in">console</span>.log(a); <span class="hljs-comment">// 10</span>
  <span class="hljs-built_in">console</span>.log(b); <span class="hljs-comment">// ReferenceError: b is not defined</span>
  <span class="hljs-built_in">console</span>.log(c); <span class="hljs-comment">// ReferenceError: c is not defined</span>
</code></pre>
<p>  <code>var</code> allows variables to be hoisted, meaning they can be referenced in code before they are declared. <code>let</code> and <code>const</code> will not allow this, instead throwing an error.</p>
<pre><code class="lang-typescript">  <span class="hljs-built_in">console</span>.log(a); <span class="hljs-comment">// undefined</span>
  <span class="hljs-keyword">var</span> a = <span class="hljs-string">'foo'</span>;

  <span class="hljs-built_in">console</span>.log(b); <span class="hljs-comment">// ReferenceError: can't access lexical declaration 'b' before initialization</span>
  <span class="hljs-keyword">let</span> b = <span class="hljs-string">'baz'</span>;

  <span class="hljs-built_in">console</span>.log(c); <span class="hljs-comment">// ReferenceError: can't access lexical declaration 'c' before initialization</span>
  <span class="hljs-keyword">const</span> c = <span class="hljs-string">'bar'</span>;
</code></pre>
<p>  Redeclaring a variable with <code>var</code> will not throw an error, but 'let' and 'const' will.</p>
<pre><code class="lang-typescript">  <span class="hljs-keyword">var</span> a = <span class="hljs-string">'foo'</span>;
  <span class="hljs-keyword">var</span> a = <span class="hljs-string">'bar'</span>;
  <span class="hljs-built_in">console</span>.log(a); <span class="hljs-comment">// "bar"</span>

  <span class="hljs-keyword">let</span> b = <span class="hljs-string">'baz'</span>;
  <span class="hljs-keyword">let</span> b = <span class="hljs-string">'qux'</span>; <span class="hljs-comment">// Uncaught SyntaxError: Identifier 'b' has already been declared</span>
</code></pre>
<p>  <code>let</code> and <code>const</code> differ in that <code>let</code> allows reassigning the variable's value while <code>const</code> does not.</p>
<pre><code class="lang-typescript">  <span class="hljs-comment">// This is ok.</span>
  <span class="hljs-keyword">let</span> a = <span class="hljs-string">'foo'</span>;
  a = <span class="hljs-string">'bar'</span>;
  <span class="hljs-built_in">console</span>.log(a); <span class="hljs-comment">// bar</span>

  <span class="hljs-comment">// This causes an exception.</span>
  <span class="hljs-keyword">const</span> b = <span class="hljs-string">'baz'</span>;
  b = <span class="hljs-string">'qux'</span>;
  <span class="hljs-built_in">console</span>.log(b) <span class="hljs-comment">// TypeError: Assignment to constant variable.</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Arrow Functions:</strong></p>
<ul>
<li><p>Arrow functions provide a concise syntax for writing functions. They have implicit return if the function body is a single expression. Arrow functions also lexically bind <code>this</code>, meaning they inherit the <code>this</code> value from the surrounding code, which helps avoid issues with traditional function expressions.</p>
</li>
<li><p>Arrows is a new syntax for functions, which brings several benefits:</p>
<ul>
<li><p>Arrow syntax automatically binds <code>this</code> to the surrounding code's context</p>
</li>
<li><p>The syntax allows an implicit return when there is no body block, resulting in shorter and simpler code in some cases</p>
</li>
<li><p>Last but not least, <code>=&gt;</code> is shorter and simpler than <code>function</code>, although stylistic issues are often subjective</p>
</li>
</ul>
</li>
</ul>
</li>
</ol>
<p>        <strong>Example 01:</strong> Arrow Function with No Argument</p>
<p>        If a function doesn't take any argument, then you should use empty parentheses.</p>
<pre><code class="lang-typescript">        <span class="hljs-keyword">let</span> greet = <span class="hljs-function">() =&gt;</span> <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Hello'</span>);
        greet(); <span class="hljs-comment">// Hello</span>
</code></pre>
<p>        <strong>Example 02:</strong> Arrow Function with One Argument</p>
<p>        If a function has only one argument, you can omit the parentheses.</p>
<pre><code class="lang-typescript">        <span class="hljs-keyword">let</span> greet = <span class="hljs-function"><span class="hljs-params">x</span> =&gt;</span> <span class="hljs-built_in">console</span>.log(x);
        greet(<span class="hljs-string">'Hello'</span>); <span class="hljs-comment">// Hello</span>
</code></pre>
<p>        <strong>Example 03:</strong> Arrow Function as an Expression</p>
<p>        You can also dynamically create a function and use it as an expression.</p>
<pre><code class="lang-typescript">        <span class="hljs-keyword">let</span> age = <span class="hljs-number">25</span>;

        <span class="hljs-keyword">let</span> welcome = (age &lt; <span class="hljs-number">18</span>) ?
          <span class="hljs-function">() =&gt;</span> <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Baby'</span>) :
          <span class="hljs-function">() =&gt;</span> <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Adult'</span>);

        welcome(); <span class="hljs-comment">// Adult</span>
</code></pre>
<p>        <strong>Example 04:</strong> Multiline Arrow Functions</p>
<p>        If a function body has multiple statements, you need to put them inside curly brackets <code>{}</code>.</p>
<pre><code class="lang-typescript">        <span class="hljs-keyword">let</span> area = <span class="hljs-function">(<span class="hljs-params">r</span>) =&gt;</span> {
          <span class="hljs-keyword">const</span> pi = <span class="hljs-number">3.14</span>;
          <span class="hljs-keyword">return</span> pi * r * r;
        }

        <span class="hljs-keyword">let</span> result = area(<span class="hljs-number">10</span>);
        <span class="hljs-built_in">console</span>.log(result); <span class="hljs-comment">// 314</span>
</code></pre>
<p>        <em>Note: Unlike regular functions, arrow functions do not have their own</em> <code>this</code>. The value of <code>this</code> inside an arrow function remains the same throughout the lifecycle of the function and is always bound to the value of <code>this</code> in the closest non-arrow parent function.</p>
<ol start="3">
<li><p><strong>Template Literals:</strong></p>
<ul>
<li>Template literals allow embedding expressions within string literals using <code>${}</code> syntax. This enables multi-line strings without the need for concatenation and provides a convenient way for string interpolation.</li>
</ul>
</li>
<li><p><strong>Destructuring Assignment:</strong></p>
<ul>
<li>Destructuring assignment allows extracting values from arrays or objects into distinct variables using a syntax that mirrors the structure of the array or object. This feature simplifies code and makes it more readable, especially when working with complex data structures.</li>
</ul>
</li>
<li><p><strong>Default Parameters:</strong></p>
<ul>
<li>ES6 allows specifying default values for function parameters. If a parameter is not provided or is <code>undefined</code>, the default value will be used instead. This feature helps avoid the need for verbose checks for undefined values within functions.</li>
</ul>
</li>
<li><p><strong>Rest and Spread Operators:</strong></p>
<ul>
<li>The rest parameter (<code>...args</code>) allows collecting remaining arguments into an array, which is useful when working with functions that can accept a variable number of arguments. The spread operator (<code>...arr</code>) spreads elements of an iterable (like an array) into individual elements, facilitating tasks such as concatenation, copying, or passing array elements as function arguments.</li>
</ul>
</li>
<li><p><strong>Classes:</strong></p>
<ul>
<li>ES6 introduced class syntax, which provides a more familiar and intuitive way to create objects and define their behaviors. Classes support constructor methods, instance methods, static methods, inheritance, and super calls, making object-oriented programming in JavaScript more accessible.</li>
</ul>
</li>
<li><p><strong>Modules:</strong></p>
<ul>
<li>ES6 modules provide a standardized way to organize code into reusable and maintainable components. Modules encapsulate functionality and can export variables, functions, or classes for use in other modules. Import statements allow importing these exported functionalities into other modules, promoting modular code development.</li>
</ul>
</li>
</ol>
<p>These features represent just a portion of the enhancements introduced in ES6. They significantly improved JavaScript's expressiveness, readability, and maintainability, empowering developers to write more efficient and structured code. Additionally, ES6 laid the foundation for subsequent ECMAScript versions, which continue to expand and refine the language.</p>
]]></content:encoded></item><item><title><![CDATA[Most important Array methods in Javascript]]></title><description><![CDATA[There are multiple methods available to manipulate the values of the array in javascript. Arrays can hold the data in different format whether its elements, objects or nested objects and even nested arrays in the key value pairs. Also, there are some...]]></description><link>https://ajinkya10x.com/most-important-array-methods-in-javascript</link><guid isPermaLink="true">https://ajinkya10x.com/most-important-array-methods-in-javascript</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[ES6]]></category><category><![CDATA[UI]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[frontend]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Thu, 07 Mar 2024 18:30:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709835902736/5ae58bd7-0dec-43f9-8484-973d9d808453.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There are multiple methods available to manipulate the values of the array in javascript. Arrays can hold the data in different format whether its elements, objects or nested objects and even nested arrays in the key value pairs. Also, there are some important methods that are introduced in ES6 feature of Javascript. Lets explore them in details.</p>
<ol>
<li><p><strong>map()</strong>:</p>
<ul>
<li><p><strong>Use Case</strong>: Transforming data in an array.</p>
</li>
<li><p><strong>Example</strong>: Converting an array of Celsius temperatures to Fahrenheit.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst celsiusTemperatures = [<span class="hljs-number">0</span>, <span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">30</span>, <span class="hljs-number">40</span>];
  <span class="hljs-keyword">const</span> fahrenheitTemperatures = celsiusTemperatures.map(<span class="hljs-function"><span class="hljs-params">temp</span> =&gt;</span> (temp * <span class="hljs-number">9</span>/<span class="hljs-number">5</span>) + <span class="hljs-number">32</span>);
  <span class="hljs-comment">// fahrenheitTemperatures: [32, 50, 68, 86, 104]</span>
</code></pre>
</li>
<li><p>Often, you may need to transform data in an array into a different format.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst products = [
      { <span class="hljs-attr">name</span>: <span class="hljs-string">'Shirt'</span>, <span class="hljs-attr">price</span>: <span class="hljs-number">20</span> },
      { <span class="hljs-attr">name</span>: <span class="hljs-string">'Jeans'</span>, <span class="hljs-attr">price</span>: <span class="hljs-number">30</span> },
      { <span class="hljs-attr">name</span>: <span class="hljs-string">'Shoes'</span>, <span class="hljs-attr">price</span>: <span class="hljs-number">50</span> }
  ];

  <span class="hljs-keyword">const</span> prices = products.map(<span class="hljs-function"><span class="hljs-params">product</span> =&gt;</span> product.price);
  <span class="hljs-comment">// prices: [20, 30, 50]</span>
</code></pre>
</li>
<li><p><strong>Rendering Lists</strong>: When working with frameworks like React, mapping over an array to render components is a common use case.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst items = [<span class="hljs-string">'Apple'</span>, <span class="hljs-string">'Banana'</span>, <span class="hljs-string">'Orange'</span>];

  <span class="hljs-keyword">const</span> itemList = items.map(<span class="hljs-function">(<span class="hljs-params">item, index</span>) =&gt;</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">key</span>=<span class="hljs-string">{index}</span>&gt;</span>{item}<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span></span>);
</code></pre>
</li>
<li><p><strong>Generating IDs</strong>: You can generate unique IDs for array elements.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst data = [<span class="hljs-string">'John'</span>, <span class="hljs-string">'Doe'</span>, <span class="hljs-string">'Alice'</span>];

  <span class="hljs-keyword">const</span> withIDs = data.map(<span class="hljs-function">(<span class="hljs-params">item, index</span>) =&gt;</span> ({ <span class="hljs-attr">id</span>: index, <span class="hljs-attr">name</span>: item }));
  <span class="hljs-comment">// withIDs: [{ id: 0, name: 'John' }, { id: 1, name: 'Doe' }, { id: 2, name: 'Alice</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>filter()</strong>:</p>
<ul>
<li><p><strong>Use Case</strong>: Filtering out elements from an array based on a condition.</p>
</li>
<li><p><strong>Example</strong>: Filtering out even numbers from an array.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst numbers = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>];
  <span class="hljs-keyword">const</span> evenNumbers = numbers.filter(<span class="hljs-function"><span class="hljs-params">num</span> =&gt;</span> num % <span class="hljs-number">2</span> === <span class="hljs-number">0</span>);
  <span class="hljs-comment">// evenNumbers: [2, 4]</span>
</code></pre>
</li>
</ul>
</li>
</ol>
<ul>
<li><p><strong>Data Filtering</strong>: Filtering out data based on specific criteria.</p>
<pre><code class="lang-typescript">  javascriptCopy codeconst numbers = [<span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">30</span>, <span class="hljs-number">40</span>, <span class="hljs-number">50</span>];

  <span class="hljs-keyword">const</span> filtered = numbers.filter(<span class="hljs-function"><span class="hljs-params">num</span> =&gt;</span> num &gt; <span class="hljs-number">25</span>);
  <span class="hljs-comment">// filtered: [30, 40, 50]</span>
</code></pre>
</li>
<li><p><strong>Search Filtering</strong>: Filtering search results based on user input.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst users = [<span class="hljs-string">'Alice'</span>, <span class="hljs-string">'Bob'</span>, <span class="hljs-string">'Charlie'</span>, <span class="hljs-string">'David'</span>];

  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">filterUsers</span>(<span class="hljs-params">query</span>) </span>{
      <span class="hljs-keyword">return</span> users.filter(<span class="hljs-function"><span class="hljs-params">user</span> =&gt;</span> user.toLowerCase().includes(query.toLowerCase()));
  }

  <span class="hljs-keyword">const</span> filteredUsers = filterUsers(<span class="hljs-string">'b'</span>);
  <span class="hljs-comment">// filteredUsers: ['Bob']</span>
</code></pre>
</li>
<li><p><strong>Removing Invalid Data</strong>: Filtering out invalid or empty entries from an array.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst data = [<span class="hljs-literal">null</span>, <span class="hljs-literal">undefined</span>, <span class="hljs-number">0</span>, <span class="hljs-string">''</span>, <span class="hljs-string">'Hello'</span>, <span class="hljs-number">42</span>];

  <span class="hljs-keyword">const</span> validEntries = data.filter(<span class="hljs-built_in">Boolean</span>);
  <span class="hljs-comment">// validEntries: ['Hello', 42]</span>
</code></pre>
</li>
</ul>
<ol start="3">
<li><p><strong>reduce()</strong>:</p>
<ul>
<li><p><strong>Use Case</strong>: Aggregating data in an array into a single value.</p>
</li>
<li><p><strong>Example</strong>: Calculating the total sum of values in an array.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst numbers = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>];
  <span class="hljs-keyword">const</span> sum = numbers.reduce(<span class="hljs-function">(<span class="hljs-params">acc, curr</span>) =&gt;</span> acc + curr, <span class="hljs-number">0</span>);
  <span class="hljs-comment">// sum: 15</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>forEach()</strong>:</p>
<ul>
<li><p><strong>Use Case</strong>: Iterating over each element of an array.</p>
</li>
<li><p><strong>Example</strong>: Logging each element of an array.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst fruits = [<span class="hljs-string">'apple'</span>, <span class="hljs-string">'banana'</span>, <span class="hljs-string">'orange'</span>];
  fruits.forEach(<span class="hljs-function"><span class="hljs-params">fruit</span> =&gt;</span> <span class="hljs-built_in">console</span>.log(fruit));
  <span class="hljs-comment">// Output: apple, banana, orange</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>find()</strong>:</p>
<ul>
<li><p><strong>Use Case</strong>: Finding a specific element in an array.</p>
</li>
<li><p><strong>Example</strong>: Finding the first even number in an array.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst numbers = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>];
  <span class="hljs-keyword">const</span> found = numbers.find(<span class="hljs-function"><span class="hljs-params">num</span> =&gt;</span> num % <span class="hljs-number">2</span> === <span class="hljs-number">0</span>);
  <span class="hljs-comment">// found: 2</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>some()</strong>:</p>
<ul>
<li><p><strong>Use Case</strong>: Checking if at least one element meets a condition.</p>
</li>
<li><p><strong>Example</strong>: Checking if an array contains at least one negative number.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst numbers = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">-3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>];
  <span class="hljs-keyword">const</span> hasNegative = numbers.some(<span class="hljs-function"><span class="hljs-params">num</span> =&gt;</span> num &lt; <span class="hljs-number">0</span>);
  <span class="hljs-comment">// hasNegative: true</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>every()</strong>:</p>
<ul>
<li><p><strong>Use Case</strong>: Checking if all elements meet a condition.</p>
</li>
<li><p><strong>Example</strong>: Checking if all elements in an array are positive.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst numbers = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>];
  <span class="hljs-keyword">const</span> allPositive = numbers.every(<span class="hljs-function"><span class="hljs-params">num</span> =&gt;</span> num &gt; <span class="hljs-number">0</span>);
  <span class="hljs-comment">// allPositive: true</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>includes()</strong>:</p>
<ul>
<li><p><strong>Use Case</strong>: Checking if an array contains a specific value.</p>
</li>
<li><p><strong>Example</strong>: Checking if an array contains a certain string.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst fruits = [<span class="hljs-string">'apple'</span>, <span class="hljs-string">'banana'</span>, <span class="hljs-string">'orange'</span>];
  <span class="hljs-keyword">const</span> hasBanana = fruits.includes(<span class="hljs-string">'banana'</span>);
  <span class="hljs-comment">// hasBanana: true</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>slice()</strong>:</p>
<ul>
<li><p><strong>Use Case</strong>: Extracting a portion of an array.</p>
</li>
<li><p><strong>Example</strong>: Getting the first three elements of an array.</p>
<pre><code class="lang-javascript">  javascriptCopy codeconst numbers = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>];
  <span class="hljs-keyword">const</span> firstThree = numbers.slice(<span class="hljs-number">0</span>, <span class="hljs-number">3</span>);
  <span class="hljs-comment">// firstThree: [1, 2, 3]</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Array.from() Method</strong>:</p>
<ul>
<li><p><strong>Description</strong>: Creates a new array from an array-like or iterable object.</p>
<pre><code class="lang-typescript">  javascriptlet str = <span class="hljs-string">'JavaScript'</span>;
  <span class="hljs-keyword">let</span> newArray = <span class="hljs-built_in">Array</span>.from(str);
  <span class="hljs-built_in">console</span>.log(newArray);
</code></pre>
</li>
<li><p><strong>Output</strong>: <code>['J', 'a', 'v', 'a', 'S', 'c', 'r', 'i</code><a target="_blank" href="https://www.javatpoint.com/es6-array-methods"><code>'</code></a><code>, 'p', 't']</code><a target="_blank" href="https://www.javatpoint.com/es6-array-methods">2</a>.</p>
</li>
</ul>
</li>
<li><p><strong>Arra</strong><a target="_blank" href="https://www.javatpoint.com/es6-array-methods"><strong>y</strong></a><strong>.of() Method</strong>:</p>
<ul>
<li><p><strong>Description</strong>: It creates an array with the specified elements<a target="_blank" href="https://www.javatpoint.com/es6-array-methods">.</a> In ES5, when a single numeric value gets passed in the array constructor, then it will create an array of that size. <strong>Array.of()</strong> is a new way of creating an array which fixes this behavior of ES5.</p>
<p>  By using this method, if you are creating an array only with a single numeric value, then it will create an array only with that value instead of creating the array of that size.</p>
<pre><code class="lang-typescript">  javascriptlet singleValueArray = <span class="hljs-built_in">Array</span>.of(<span class="hljs-number">42</span>);
  <span class="hljs-built_in">console</span>.log(singleValueArray);
</code></pre>
</li>
<li><p><strong>Output</strong><a target="_blank" href="https://www.javatpoint.com/es6-array-methods">:</a> [ 42 ]</p>
</li>
</ul>
</li>
</ol>
<p>These examples demonstrate the practical use of each array method to manipulate data and perform common operations on arrays in JavaScript.</p>
]]></content:encoded></item><item><title><![CDATA[Unlocking the Power of Angular Pipes: A Comprehensive Guide to Pure, Async, and Custom Transformations]]></title><description><![CDATA[Angular Pipes are an essential feature of Angular that helps in transforming and formatting data displayed in templates. They allow users to modify the way data is presented on the screen. For example, let's say you want to change the date format. Th...]]></description><link>https://ajinkya10x.com/unlocking-the-power-of-angular-pipes-a-comprehensive-guide-to-pure-async-and-custom-transformations</link><guid isPermaLink="true">https://ajinkya10x.com/unlocking-the-power-of-angular-pipes-a-comprehensive-guide-to-pure-async-and-custom-transformations</guid><category><![CDATA[Angular]]></category><category><![CDATA[angular material]]></category><category><![CDATA[pipes]]></category><category><![CDATA[angular17]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Wed, 06 Mar 2024 23:56:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709769286958/29e5012c-8153-4683-a683-9cd2226c6793.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Angular Pipes are an essential feature of Angular that helps in transforming and formatting data displayed in templates. They allow users to modify the way data is presented on the screen. For example, let's say you want to change the date format. There are multiple ways to represent dates, and Angular Pipes can help you choose the format that best suits your needs. Also, there are different types of pipes available.</p>
<p>In this blog, we will cover several important points related to pipes in Angular, which are as follows:</p>
<p>- What is a pure pipe?</p>
<p>- What is an async pipe?</p>
<p>- What kind of data can be used with async pipe?</p>
<p>- How can you create a custom pipe?</p>
<p>- How does the async pipe prevent memory leaks?</p>
<p>- What is the difference between pure and impure pipes?</p>
<h3 id="heading-pure-pipe"><strong>Pure Pipe:</strong></h3>
<ol>
<li><p>Pure pipes are ideal for scenarios where the transformation of data does not rely on any mutable state or side effects. Here are some key points about pure pipes:</p>
<ul>
<li><p><strong>Statelessness</strong>: Pure pipes should not maintain any internal state. Their output solely depends on their input parameters.</p>
</li>
<li><p><strong>Deterministic</strong>: Pure pipes are deterministic, meaning they produce the same output for the same input every time they are called. This property is crucial for Angular's change detection mechanism to work efficiently.</p>
</li>
<li><p><strong>Performance Optimization</strong>: Angular can optimize the performance of pure pipes by caching the results of previous transformations and only re-evaluating the pipe when its input values change.</p>
</li>
<li><p><strong>Marking as Pure</strong>: In Angular, you declare a pipe as pure by setting the <code>pure</code> property to <code>true</code> in the <code>@Pipe</code> decorator.</p>
</li>
</ul>
</li>
</ol>
<h3 id="heading-async-pipe"><strong>Async Pipe:</strong></h3>
<p>    The async pipe is specifically designed to work with asynchronous data sources like observables and promises. Here's what you need to know about async pipes:</p>
<ul>
<li><p><strong>Subscription Management</strong>: The async pipe subscribes to the observable or promise passed to it and automatically unsubscribes when the component is destroyed. This behavior prevents memory leaks by ensuring that subscriptions are cleaned up.</p>
</li>
<li><p><strong>Handling Observable Streams</strong>: For observables, the async pipe emits the latest value emitted by the observable stream. It automatically triggers change detection when a new value is emitted.</p>
</li>
<li><p><strong>Promise Resolution</strong>: For promises, the async pipe resolves the promise and emits the resolved value.</p>
</li>
<li><p><strong>Simplifies Template Code</strong>: The async pipe simplifies template code by handling the subscription and unwrapping the asynchronous data source, making the template cleaner and easier to read.</p>
</li>
</ul>
<h3 id="heading-custom-pipes"><strong>Custom Pipes:</strong></h3>
<p>    Creating custom pipes allows you to encapsulate complex transformation logic and reuse it across your application. Here's how you create a custom pipe in Angular:</p>
<ul>
<li><p><strong>Implement PipeTransform</strong>: Your custom pipe class must implement the <code>PipeTransform</code> interface, which requires you to define a <code>transform</code> method.</p>
</li>
<li><p><strong>@Pipe Decorator</strong>: Decorate your custom pipe class with the <code>@Pipe</code> decorator, providing a name for your pipe. This name is used to reference the pipe in your templates.</p>
</li>
<li><p><strong>Transformation Logic</strong>: Implement the transformation logic inside the <code>transform</code> method. This method takes the input value and optional parameters and returns the transformed value.</p>
</li>
<li><p><strong>Registering the Pipe</strong>: Ensure that your pipe is registered in an Angular module's <code>declarations</code> array or the <code>exports</code> array if you plan to use it in other modules.</p>
</li>
</ul>
<p>    <strong>Creating Custom Pipes</strong>: To create a custom pipe in Angular, you need to implement the <code>PipeTransform</code> interface and its <code>transform</code> method. This method takes an input value and optional parameters, applies some transformation, and returns the transformed value. You also need to decorate your class with <code>@Pipe</code> decorator to make it a pipe. Here's a basic example:</p>
<pre><code class="lang-javascript">    <span class="hljs-keyword">import</span> { Pipe, PipeTransform } <span class="hljs-keyword">from</span> <span class="hljs-string">'@angular/core'</span>;

    @Pipe({
      <span class="hljs-attr">name</span>: <span class="hljs-string">'myCustomPipe'</span>
    })
    <span class="hljs-keyword">export</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyCustomPipe</span> <span class="hljs-title">implements</span> <span class="hljs-title">PipeTransform</span> </span>{
      transform(value: any, ...args: any[]): any {
        <span class="hljs-comment">// Implement your transformation logic here</span>
        <span class="hljs-keyword">return</span> transformedValue;
      }
    }
</code></pre>
<h3 id="heading-preventing-memory-leaks-with-async-pipe"><strong>Preventing Memory Leaks with Async Pipe:</strong></h3>
<p>    The async pipe in Angular automatically unsubscribes from the observable or promise when the component using the pipe is destroyed. This prevents memory leaks because it ensures that subscriptions are cleaned up when no longer needed. This behavior is one of the reasons why the async pipe is recommended for handling asynchronous data streams in Angular applications.</p>
<h3 id="heading-difference-between-pure-and-impure-pipes"><strong>Difference between Pure and Impure Pipes</strong>:</h3>
<ul>
<li><p><strong>Pure Pipes</strong>: As mentioned earlier, pure pipes are stateless and produce the same output for the same input every time. They are generally more efficient because Angular can optimize them by caching the result of previous transformations. Pure pipes are denoted by the <code>pure: true</code> option in the <code>@Pipe</code> decorator.</p>
</li>
<li><p><strong>Impure Pipes</strong>: Impure pipes, on the other hand, can have internal state and may not produce the same output for the same input. They are called more frequently as Angular doesn't cache their results. Impure pipes are useful when the transformation depends on changing external factors, such as user input or state changes. Impure pipes are denoted by the <code>pure: false</code> option in the <code>@Pipe</code> decorator. However, it's recommended to use pure pipes whenever possible for better performance.</p>
</li>
</ul>
<p>    Here are some examples of Angular pipes. For more information, refer to the official Angular documentation. In conclusion, understanding the distinction between pure and impure pipes is essential for optimizing Angular applications' performance and efficiency. Pure pipes are recommended for scenarios where output depends solely on input values, while impure pipes are suitable for cases involving external dependencies or state changes.</p>
]]></content:encoded></item><item><title><![CDATA[The Black and White World!]]></title><description><![CDATA[Recently, I came across a quote while scrolling and it said something like “Choose your hard”. The thought was so real that I got triggered by it. Usually, I don't like to read quotes because they ignite your mind and that can be dangerous. I think y...]]></description><link>https://ajinkya10x.com/the-black-and-white-world</link><guid isPermaLink="true">https://ajinkya10x.com/the-black-and-white-world</guid><category><![CDATA[motivation]]></category><category><![CDATA[thoughts]]></category><category><![CDATA[life]]></category><category><![CDATA[Blogging]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Sun, 11 Feb 2024 20:53:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1707684221750/74c58a8d-2831-43a5-8f16-0afd9aac328e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Recently, I came across a quote while scrolling and it said something like “Choose your hard”. The thought was so real that I got triggered by it. Usually, I don't like to read quotes because they ignite your mind and that can be dangerous. I think you should not get influenced by any random quote or thing because you’re giving them that power to provoke you indirectly.</p>
<p>This kind of external motivation doesn't work. It can not fuel your mind for a longer time. In case it does then also remains for a very short time. So instead of looking for another round of drug shots, you can rely on self-motivation as it lasts for a prolonged time.</p>
<p>So the quote said this -</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1707683890311/dda4648e-745c-4cf4-9a00-3c2d570a19b4.jpeg" alt class="image--center mx-auto" /></p>
<p>So when I think about it, I find a few things are relevant and applicable to all of us. Every random quote written by someone can not be the universal truth. It's just another take by that particular person.</p>
<p>The world is not completely divided into black and white. Nothing can be completely wrong and completely right at the same time. There’s always a gray area that exists and that's the beauty of life.</p>
<p>I have seen people struggling in their dream company with the highest paycheck. It doesn't mean that they are not happy or sad. It means that they have their moment of ups and downs in the journey. They have their struggles and lucrative rewards as well.</p>
<p>Some people are insecure about their careers even after passing from the premium institutes. Some are not happy even after getting that prestigious scholarship from the university. And there can be a few people who are still happy doing their normal 9-5 Job as well. It's just a matter of time and perception that makes you happy. It's a circle of musical chairs. You will experience all the shades of life and everyone has to go through it and there is no choice.</p>
<p>In today's world, social media often presents us with perfectly curated images and illusions. This can lead us to believe that everything in life should be flawless, whether it's our careers, relationships, physical appearances, or social circles.</p>
<p>There seems to be an unspoken pressure to strive for an unattainable standard of perfection. But the reality is that perfection is just an illusion.</p>
<p>In reality, nothing in this world is flawless from the outset. It is through our efforts, perseverance, and acceptance of imperfection that we create beauty and meaning in our lives.</p>
<p>The only choice we can make is to change our mindset and be resilient to all the odds. Nothing is perfect or imperfect in this world. We have to make it perfect by taking all the efforts consistently.</p>
<p>You can't lose weight and build a great physic by just sitting idle at home. It takes at least 3 to 6 months of disciplined workouts and diet.</p>
<p>Similarly, a perfect marriage doesn't exist but can be achieved by making generous efforts, understanding, and after some timely sacrifices. The same goes for a great friendship, I realized this when I was talking to one of my best friends who has been there with me for the last 20 years.</p>
<p>So, the bottom line is, that the world is not black and white. There’s always a grey area that exists. Also, there are all shades of a rainbow that exists and we all live in there. Also, nothing is hard in this world if it's done properly. Every situation is temporary whether it's happiness or pain. Embrace the anxiety and understand the universal laws of the world. Just follow the two words, BE BOLD!</p>
]]></content:encoded></item><item><title><![CDATA[Europe Remote Work Guide 2024: Explore the Top 10 Job Market Platforms in Europe]]></title><description><![CDATA[Are you a tech enthusiast looking to embark on a remote career journey within the diverse landscape of Europe? Look no further! I've compiled a curated list of 10 essential job sites tailored for tech professionals seeking exciting opportunities acro...]]></description><link>https://ajinkya10x.com/europe-remote-work-guide-2024-explore-the-top-10-job-market-platforms-in-europe</link><guid isPermaLink="true">https://ajinkya10x.com/europe-remote-work-guide-2024-explore-the-top-10-job-market-platforms-in-europe</guid><category><![CDATA[remote work]]></category><category><![CDATA[remote jobs ]]></category><category><![CDATA[remote-working]]></category><category><![CDATA[DevRel]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Sun, 14 Jan 2024 12:20:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1705234789678/cd2d07dd-8db1-4505-8d1e-cfae1e6c353c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Are you a tech enthusiast looking to embark on a remote career journey within the diverse landscape of Europe? Look no further! I've compiled a curated list of 10 essential job sites tailored for tech professionals seeking exciting opportunities across the European Union. These platforms cater to various preferences and specialize in different sectors, ensuring you have a comprehensive range of choices. Let's dive into the top 10 job sites that you should bookmark to kickstart your tech career in Europe:</p>
<ol>
<li><p><a target="_blank" href="https://euremotejobs.com/"><strong>EU Remote Jobs</strong></a><strong>:</strong></p>
<ul>
<li>Specializing in remote job opportunities within the European Union, this platform is your go-to resource for location-independent roles across diverse tech sectors.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.jobteaser.com/"><strong>Jobteaser</strong></a><strong>:</strong></p>
<ul>
<li>Ideal for graduates exploring job opportunities in Europe, Jobteaser provides a platform that caters to entry-level positions, making it a great resource for those starting their tech careers.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://eurojobs.com/"><strong>Eurojobs</strong></a><strong>:</strong></p>
<ul>
<li>Offering a broad range of job listings across various sectors in Europe, Eurojobs is a comprehensive platform for tech professionals looking for diverse opportunities.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://nofluffjobs.com/"><strong>No Fluff Jobs</strong></a><strong>:</strong></p>
<ul>
<li>Focused exclusively on IT job opportunities in Europe, No Fluff Jobs streamlines your search for coding, development, and IT-related roles.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://lnkd.in/ek_3wRfY"><strong>JobsinNetwork</strong></a><strong>:</strong></p>
<ul>
<li>Providing access to a network of job sites across Europe, JobsinNetwork connects tech professionals with a wide range of job opportunities.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://eures.europa.eu/"><strong>EURES (European Job Mobility Portal)</strong></a><strong>:</strong></p>
<ul>
<li>As a public service initiative, EURES offers access to job opportunities across the European Union, making it an invaluable resource for tech professionals seeking mobility.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://lnkd.in/ePTMqgGy"><strong>Europelanguagejobs</strong></a><strong>:</strong></p>
<ul>
<li>Tailored for individuals with language skills, Europelanguagejobs provides job listings with a language focus, offering tech roles that require linguistic expertise.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.stepstone.de"><strong>StepStone</strong></a><strong>:</strong></p>
<ul>
<li>Widely used across Europe and especially in Germany, StepStone is a popular job site that features a variety of tech roles, providing a comprehensive job search experience.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.jobs.ie"><strong>Jobs IE</strong></a><strong>:</strong></p>
<ul>
<li>A popular job portal in Ireland covering different industries, Jobs IE is an excellent resource for tech professionals exploring opportunities in the Irish market.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://jobs.thelocal.com/"><strong>The Local Jobs</strong></a><strong>:</strong></p>
<ul>
<li>Providing local job listings in various European countries, The Local Jobs is a valuable platform for tech enthusiasts seeking region-specific opportunities.</li>
</ul>
</li>
</ol>
<p>So as to conclude this comprehensive guide to Europe's dynamic remote job landscape, you're well on your way to unlocking exciting opportunities.</p>
<p>Remember, remote work offers the flexibility to shape your career on your terms. Whether you're a seasoned professional or just starting, these platforms open doors to a wealth of possibilities.</p>
<p>Bookmark this guide, explore the featured platforms, and embark on your journey towards a fulfilling remote career in the heart of Europe.</p>
<p>Here's to your success and the limitless potential that remote work brings!</p>
]]></content:encoded></item><item><title><![CDATA[Mastering Peak Performance: Explore the Full Potential of Your React App with Optimization Techniques]]></title><description><![CDATA[React application optimization is the most important thing for any developer. It's very crucial to check the performance of the app even if you're adding a single library to it. React provides the flexibility to add any number of external libraries f...]]></description><link>https://ajinkya10x.com/mastering-peak-performance-explore-the-full-potential-of-your-react-app-with-optimization-techniques</link><guid isPermaLink="true">https://ajinkya10x.com/mastering-peak-performance-explore-the-full-potential-of-your-react-app-with-optimization-techniques</guid><category><![CDATA[React]]></category><category><![CDATA[ReactHooks]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[javascript framework]]></category><category><![CDATA[Performance Optimization]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Tue, 02 Jan 2024 19:57:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1704225411051/b4e6edfe-7ecc-4002-a8df-f3608fe6f178.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>React application optimization is the most important thing for any developer. It's very crucial to check the performance of the app even if you're adding a single library to it. React provides the flexibility to add any number of external libraries for various features but everything comes at a cost!</p>
<p>It can be the developers' nightmare to tackle tiny issues once you deploy the application and check the performance. So here are some of the areas where you should pay attention from the very early stage of development.</p>
<p><strong>Modify the Codebase:</strong></p>
<ul>
<li><p><strong>Code Splitting:</strong> Unleash the power of modularity by breaking your code into smaller, on-demand chunks using dynamic imports. This minimizes initial load times and enhances responsiveness.</p>
</li>
<li><p><strong>Lazy Loading:</strong> Further streamline initial load by deferring the loading of non-critical components until they're actually needed. React's lazy loading feature, often paired with code splitting, proves invaluable here.</p>
</li>
</ul>
<p><strong>Bundle Size Reduction:</strong></p>
<ul>
<li><p><strong>Bundle Analysis:</strong> Gain a clear understanding of your bundle composition using tools like Webpack Bundle Analyzer. Identify and eliminate unnecessary dependencies and large libraries to reduce overall size.</p>
</li>
<li><p><strong>Minification and Compression:</strong> Shrink file sizes by minifying JavaScript, CSS, and HTML using tools like UglifyJS and Gzip. This leads to faster transmission and rendering.</p>
</li>
</ul>
<p><strong>Image Optimization:</strong></p>
<ul>
<li><strong>Optimized Images:</strong> Ensure images are appropriately compressed and optimized before usage. Embrace responsive images and the <code>srcset</code> attribute for device-specific loading, further enhancing efficiency.</li>
</ul>
<p><strong>Reducing Unnecessary Renders:</strong></p>
<ul>
<li><strong>Memoization:</strong> Cache the results of expensive function calls with techniques like memoization, effectively preventing redundant re-renders. React.memo and useMemo hooks offer valuable assistance in this area.</li>
</ul>
<p><strong>Handling Large Data Sets:</strong></p>
<ul>
<li><strong>Virtualization:</strong> Tackle performance issues associated with large lists or tables by implementing virtualization. Libraries like react-virtualized and react-window render only visible items, significantly boosting performance.</li>
</ul>
<p><strong>Server-Side Rendering (SSR):</strong></p>
<ul>
<li><strong>Initial Content on Server:</strong> Optimize time to first paint by rendering initial page content on the server, reducing client-side workload. SSR proves particularly beneficial for SEO and initial load speed.</li>
</ul>
<p><strong>Production Build Optimization:</strong></p>
<ul>
<li><strong>Production-Ready Code:</strong> Guarantee the use of React's production build for deployment, benefiting from pre-configured optimizations such as minification and the removal of development-only code.</li>
</ul>
<p><strong>Continuous Monitoring and Profiling:</strong></p>
<ul>
<li><p><strong>Performance Monitoring:</strong> Employ tools like Lighthouse, Google PageSpeed Insights, or New Relic to meticulously monitor performance and pinpoint areas for further enhancement.</p>
</li>
<li><p><strong>Profiling:</strong> Identify specific bottlenecks and tailor optimization strategies accordingly using React's built-in Profiler or external performance profiling tools.</p>
</li>
</ul>
<p>Hope these areas of improvement are enough to understand the importance of the optimization. This could save you from a long bug list. Cheers!</p>
]]></content:encoded></item><item><title><![CDATA[Top 5 ways to remove duplicates from an Array]]></title><description><![CDATA[Array is the most useful data structure to store the data and its widely used across platforms. Whenever you're appearing for an interview for javascript, this could be the first question to check your logical ability.
Here are the top five ways to r...]]></description><link>https://ajinkya10x.com/top-5-ways-to-remove-duplicates-from-an-array</link><guid isPermaLink="true">https://ajinkya10x.com/top-5-ways-to-remove-duplicates-from-an-array</guid><category><![CDATA[2Articles1Week]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[javascript framework]]></category><category><![CDATA[React]]></category><category><![CDATA[crazyblogger]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Mon, 01 Jan 2024 22:09:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1704146920757/d27839f4-2177-4b70-9d06-bab8d62d7b9b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Array is the most useful data structure to store the data and its widely used across platforms. Whenever you're appearing for an interview for javascript, this could be the first question to check your logical ability.</p>
<p>Here are the top five ways to remove the duplicates without hassle.</p>
<ol>
<li><p>Using the brute force approach, the simplest one and beginner-friendly. You just need to iterate two loops and check the adjacent elements for equality.</p>
<pre><code class="lang-javascript"> <span class="hljs-keyword">var</span> array = [<span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">20</span>, <span class="hljs-number">30</span>, <span class="hljs-number">10</span>, <span class="hljs-number">30</span>, <span class="hljs-number">40</span>, <span class="hljs-number">58</span>, <span class="hljs-number">31</span>, <span class="hljs-number">32</span>, <span class="hljs-number">31</span>]

 <span class="hljs-keyword">var</span> unique = [];

 <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>; i &lt; array.length; i++) {
    <span class="hljs-keyword">let</span> isDuplicate = <span class="hljs-literal">false</span>;
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> j = i+<span class="hljs-number">1</span>; j &lt; array.length; j++) {
       <span class="hljs-keyword">if</span>(array[i]==array[j]){
          isDup=<span class="hljs-literal">true</span>
          <span class="hljs-keyword">break</span>;
       }
    }
    <span class="hljs-keyword">if</span>(!isDuplicate){
       unique.push(array[i])         
    }
 }

 <span class="hljs-built_in">console</span>.log(unique)
</code></pre>
</li>
<li><p>It can also be done using the filter method where the comparison between the first index of the element and the current index of the element has to be the same.</p>
<p> Here, the indexOf() method returns the first index of the element.</p>
<pre><code class="lang-javascript"> <span class="hljs-keyword">var</span> array = [ <span class="hljs-number">10</span>, <span class="hljs-number">30</span>, <span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">30</span>, <span class="hljs-number">40</span>, <span class="hljs-number">10</span>]

 <span class="hljs-keyword">for</span>(<span class="hljs-keyword">let</span> i =<span class="hljs-number">0</span>; i&lt;array.length; i++){
     <span class="hljs-built_in">console</span>.log(array.indexOf(i))
 }

 Num  |IndexOf| Iterator
 <span class="hljs-number">10</span>   | <span class="hljs-number">0</span>     | <span class="hljs-number">0</span>
 <span class="hljs-number">30</span>   | <span class="hljs-number">1</span>     | <span class="hljs-number">1</span>
 <span class="hljs-number">10</span>   | <span class="hljs-number">0</span>     | <span class="hljs-number">2</span>
 <span class="hljs-number">20</span>   | <span class="hljs-number">3</span>     | <span class="hljs-number">3</span>
 <span class="hljs-number">30</span>   | <span class="hljs-number">1</span>     | <span class="hljs-number">4</span>
 <span class="hljs-number">40</span>   | <span class="hljs-number">5</span>     | <span class="hljs-number">5</span>
 <span class="hljs-number">10</span>   | <span class="hljs-number">0</span>     | <span class="hljs-number">6</span>
</code></pre>
<p> So, we just have to compare the first index should be the same index of that element whenever it occurs in the array.</p>
<pre><code class="lang-javascript"> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">removeDuplicates2</span>(<span class="hljs-params">array</span>)</span>{
    <span class="hljs-keyword">let</span> unique = array.filter(<span class="hljs-function">(<span class="hljs-params">el, index</span>)=&gt;</span>{
       <span class="hljs-keyword">return</span>(array.indexOf(el) === index)
    })
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Unique Arrays"</span>, unique)
 }

 removeDuplicates2([<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]);
</code></pre>
</li>
<li><p>Also, there's a shortest method from ES6 that can give you an array with unique values.</p>
<pre><code class="lang-javascript"> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">removeDuplicates3</span>(<span class="hljs-params">array</span>)</span>{
    <span class="hljs-keyword">let</span> unique = [..new <span class="hljs-built_in">Set</span>(array)]
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Unique Arrays"</span>, unique)
 }

 removeDuplicates3([<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]);
</code></pre>
</li>
<li><p>You can create a separate array and check if the element exists in that array or not.</p>
<pre><code class="lang-javascript"> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">removeDuplicates4</span>(<span class="hljs-params">array</span>)</span>{
    <span class="hljs-keyword">let</span> unique = []
    array.forEach(<span class="hljs-function">(<span class="hljs-params">el, index</span>)=&gt;</span>{
     <span class="hljs-keyword">if</span>(!unique.includes(el)){
         unique.push(el)
     }
    })
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Unique Arrays"</span>, unique)
 }

 removeDuplicates4([<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]);
</code></pre>
</li>
<li><p>The last but not the least is the reduce method from ES6 again. This method has a callback function with two parameters such as accumulater and current element.</p>
<p> Also, we have to define the initial value of the accumulater as the blank array. The condition would be to check the element exists in the accumulator or not, and if doesn't exist then it will return -1.</p>
<pre><code class="lang-javascript"> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">removeDuplicates5</span>(<span class="hljs-params">array</span>)</span>{
    <span class="hljs-keyword">let</span> unique = array.reduce(<span class="hljs-function">(<span class="hljs-params">acc, current</span>)=&gt;</span>{
       <span class="hljs-keyword">if</span>(acc.indexOf(current) === <span class="hljs-number">-1</span>){
          acc.push(current)
       }
       <span class="hljs-keyword">return</span> acc
    },[])
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Unique Arrays"</span>, unique)
 }

 removeDuplicates5([<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]);
</code></pre>
<p> So, that's it for now, hope you found this article useful for your learning journey, If its beneficial for you then dont forget to click the upvote button. It will motivate me to write more. Cheers!</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[How to complete the Tutorials on Udemy and escape the Tutorial Hell?]]></title><description><![CDATA[When I started learning the web development I used to watch tutorials on Youtube. Also, I bought some courses from Udemy which I hardly completed.
There are a lot more courses available in Udemy with a very great content. The prices are also very rea...]]></description><link>https://ajinkya10x.com/how-to-complete-the-tutorials-on-udemy-and-escape-the-tutorial-hell</link><guid isPermaLink="true">https://ajinkya10x.com/how-to-complete-the-tutorials-on-udemy-and-escape-the-tutorial-hell</guid><category><![CDATA[2Articles1Week]]></category><category><![CDATA[Hashnode]]></category><category><![CDATA[crazyblogger]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Sun, 19 Nov 2023 14:08:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1700401683457/79294de6-226c-4d05-ae7a-a073f8616c7a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When I started learning the web development I used to watch tutorials on Youtube. Also, I bought some courses from Udemy which I hardly completed.</p>
<p>There are a lot more courses available in Udemy with a very great content. The prices are also very reasonable and it takes a very less amount that is equivalent to buying a pizza for you!</p>
<p>The best form of investment is the one that you do on yourself and learning is the most effective area out of it. So I don't hesitate to buy any course wherever it's available.</p>
<p>The real problem arises when you go on purchasing the courses and don't complete it anymore. Once you start a specific tutorial you get the most of the resistance to it.</p>
<p>You don't like to learn it because it's very low dopamine action and our mind is addicted to the cheap dopamine levels that we get from social media.</p>
<p>Social media including Twitter is the cheapest form of dopamine providers if you don't use it wisely. It's like the slow poison to your mind.</p>
<p>So here are some of the hacks that you can do it overcome it.</p>
<ul>
<li><p>Start the tutorial and try to watch it without doing anything</p>
</li>
<li><p>If you try to write some notes in the first place then your mind is very reluctant to do it and you end up doing nothing.</p>
</li>
<li><p>So start very slowly to adapt to learning in the initial days and keep the resistance lower in your mind.</p>
</li>
<li><p>Follow the 4X pattern and don't expect that you'll understand everything in the first iteration.</p>
</li>
<li><p>Try to follow the four iterations or repetition of the same tutorial back and forth strictly.</p>
</li>
<li><p>You would have done it more than 50% of your capacity.</p>
</li>
<li><p>Thus you can achieve at least more than half of your potential if you just keep your patience instead of just giving up.</p>
</li>
<li><p>After that you can change the gear and accelerate more. Now you'll be fearless about that topic and you'll get self-motivation to do more.</p>
</li>
</ul>
<p>This has worked really well in my case. You don't need to follow multiple tutorials from every platform or every channel from Youtube.</p>
<p>Once you get a basic understanding of the concepts, try to build things on your own. Just roll up your sleeves and get your hands dirty.</p>
<p>No one has ever learned to swim just by reading books or by sitting outside the pool. So just buckle up and get on the ride.</p>
<p>Hope this is useful! Cheers!</p>
]]></content:encoded></item><item><title><![CDATA[React Gmail Login API Integration with an example]]></title><description><![CDATA[In a world where Spotify, Netflix, Instagram, Airbnb, and more dominate the digital landscape with their React-built platforms, managing individual sign-ups can be overwhelming. That's where the convenience of a Gmail login option steps in, streamlin...]]></description><link>https://ajinkya10x.com/react-gmail-login-api-integration-with-an-example</link><guid isPermaLink="true">https://ajinkya10x.com/react-gmail-login-api-integration-with-an-example</guid><category><![CDATA[React]]></category><category><![CDATA[WeMakeDevs]]></category><category><![CDATA[gmail]]></category><category><![CDATA[2Articles1Week]]></category><category><![CDATA[#learning-in-public]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Tue, 24 Jan 2023 23:03:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1674601124269/801f53cb-0e87-49c3-bca2-9db5920c6c4e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In a world where Spotify, Netflix, Instagram, Airbnb, and more dominate the digital landscape with their React-built platforms, managing individual sign-ups can be overwhelming. That's where the convenience of a Gmail login option steps in, streamlining our experience and saving valuable time and energy.</p>
<p>React application is compatible with lots of open-source libraries. When it comes to authentication there are plenty of them but we can proceed with <code>react-google-login</code></p>
<p>So, we'll discuss the steps to integrate the same in your react app.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674586152270/9523502f-75b5-4678-8c59-41aad04da449.png" alt class="image--center mx-auto" /></p>
<ol>
<li><p>Create Client Id for OAuth login from the developer console here - <a target="_blank" href="https://console.cloud.google.com/">https://console.cloud.google.com/</a></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674586481754/3cca12d4-af35-474a-9d4f-3f11f7970fa7.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Create the project with all the details.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674586626596/d8de39bf-e212-4ba7-b5a1-85e25c590669.webp" alt class="image--center mx-auto" /></p>
</li>
<li><p>After that, select the created project. Now head towards the left sidebar menu and click on the <strong>APIs &amp; Services &gt; OAuth consent screen</strong>  menu as shown below:</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674586853550/3207dee9-d256-462f-b65a-a90164595381.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>On the next screen, select the <strong>External</strong> radio option and hit create.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674586972605/9c8cee82-3650-468f-8082-31866fa5acce.webp" alt class="image--center mx-auto" /></p>
</li>
<li><p>Fill up all the details as shown below and complete it further.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674587048152/5cc92228-8301-4ca2-928c-48f5b9e2bfa0.webp" alt class="image--center mx-auto" /></p>
</li>
<li><p>Now, open the left sidebar and select the OAuth option as mentioned.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674599352019/ddcee011-cc9f-4e7f-af72-9d86da924de0.png" alt class="image--center mx-auto" /></p>
<p> 7. Now, add the details as mentioned.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674599476737/17c24a2e-e2b6-4e94-b6b2-2214b7886a79.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<p>Now, you will abel to see the <strong>client Id</strong> that can be used in the component.</p>
<p>Once, you're done with this process, you need to create the React app with these steps.</p>
<ol>
<li><p>Create the new app</p>
<p> <code>npx create-react-app react-portal-app</code></p>
</li>
<li><p>Install the bootstrap library</p>
<p> <code>npm install bootstrap --save</code></p>
</li>
<li><p>Now, install the react-google-login package that will provide the functionalities.</p>
<p> <code>npm install react-google-login</code></p>
</li>
<li><p>Create the google component under the src folder as - <strong>googlebutton.component.js</strong> and add the following code</p>
<pre><code class="lang-javascript"> <span class="hljs-keyword">import</span> React, { Component } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
 <span class="hljs-keyword">import</span> { GoogleLogin, GoogleLogout } <span class="hljs-keyword">from</span> <span class="hljs-string">"react-google-login"</span>;

 <span class="hljs-comment">// You have to replace this client ID as per your app from Google console</span>
 <span class="hljs-keyword">const</span> CLIENT_ID =
   <span class="hljs-string">"827529413912-celsdkun_YOUR_API_KEY_lsn28.apps.googleusercontent.com"</span>;

 <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">GoogleLoginComponent</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{
   <span class="hljs-keyword">constructor</span>() {
     <span class="hljs-built_in">super</span>();
     <span class="hljs-built_in">this</span>.state = {
       <span class="hljs-attr">isLoggedIn</span>: <span class="hljs-literal">false</span>,
       <span class="hljs-attr">userInfo</span>: {
         <span class="hljs-attr">name</span>: <span class="hljs-string">""</span>,
         <span class="hljs-attr">emailId</span>: <span class="hljs-string">""</span>,
       },
     };
   }

   <span class="hljs-comment">// Success Handler</span>
   responseGoogleSuccess = <span class="hljs-function">(<span class="hljs-params">response</span>) =&gt;</span> {
     <span class="hljs-built_in">console</span>.log();
     <span class="hljs-keyword">let</span> userInfo = {
       <span class="hljs-attr">name</span>: response.profileObj.name,
       <span class="hljs-attr">emailId</span>: response.profileObj.email,
     };
     <span class="hljs-built_in">this</span>.setState({ userInfo, <span class="hljs-attr">isLoggedIn</span>: <span class="hljs-literal">true</span> });
   };

   <span class="hljs-comment">// Error Handler</span>
   responseGoogleError = <span class="hljs-function">(<span class="hljs-params">response</span>) =&gt;</span> {
     <span class="hljs-built_in">console</span>.log(response);
   };

   <span class="hljs-comment">// Logout Session and Update State</span>
   logout = <span class="hljs-function">(<span class="hljs-params">response</span>) =&gt;</span> {
     <span class="hljs-built_in">console</span>.log(response);
     <span class="hljs-keyword">let</span> userInfo = {
       <span class="hljs-attr">name</span>: <span class="hljs-string">""</span>,
       <span class="hljs-attr">emailId</span>: <span class="hljs-string">""</span>,
     };
     <span class="hljs-built_in">this</span>.setState({ userInfo, <span class="hljs-attr">isLoggedIn</span>: <span class="hljs-literal">false</span> });
   };

   render() {
     <span class="hljs-keyword">return</span> (
       <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"row mt-5"</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"col-md-12"</span>&gt;</span>
           {this.state.isLoggedIn ? (
             <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
               <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Welcome, {this.state.userInfo.name}<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>

               <span class="hljs-tag">&lt;<span class="hljs-name">GoogleLogout</span>
                 <span class="hljs-attr">clientId</span>=<span class="hljs-string">{CLIENT_ID}</span>
                 <span class="hljs-attr">buttonText</span>=<span class="hljs-string">{</span>"<span class="hljs-attr">Logout</span>"}
                 <span class="hljs-attr">onLogoutSuccess</span>=<span class="hljs-string">{this.logout}</span>
               &gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">GoogleLogout</span>&gt;</span>
             <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
           ) : (
             <span class="hljs-tag">&lt;<span class="hljs-name">GoogleLogin</span>
               <span class="hljs-attr">clientId</span>=<span class="hljs-string">{CLIENT_ID}</span>
               <span class="hljs-attr">buttonText</span>=<span class="hljs-string">"Sign In with Google"</span>
               <span class="hljs-attr">onSuccess</span>=<span class="hljs-string">{this.responseGoogleSuccess}</span>
               <span class="hljs-attr">onFailure</span>=<span class="hljs-string">{this.responseGoogleError}</span>
               <span class="hljs-attr">isSignedIn</span>=<span class="hljs-string">{true}</span>
               <span class="hljs-attr">cookiePolicy</span>=<span class="hljs-string">{</span>"<span class="hljs-attr">single_host_origin</span>"}
             /&gt;</span>
           )}
         <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
       <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
     );
   }
 }
 <span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> GoogleLoginComponent;
</code></pre>
<p> This component will provide the google sign in and sign out options.</p>
</li>
<li><p>Add the selector of the component in your app.js file</p>
<pre><code class="lang-javascript"> <span class="hljs-keyword">import</span> { Component } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
 <span class="hljs-keyword">import</span> <span class="hljs-string">"./App.css"</span>;
 <span class="hljs-keyword">import</span> <span class="hljs-string">"../node_modules/bootstrap/dist/css/bootstrap.min.css"</span>;
 <span class="hljs-keyword">import</span> GoogleLoginComponent <span class="hljs-keyword">from</span> <span class="hljs-string">"./googlebutton.component"</span>;

 <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">App</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{

   render() {
     <span class="hljs-keyword">return</span> (
       <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"App container"</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Welcome to React App!<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">GoogleLoginComponent</span> /&gt;</span>
       <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
     );
   }
 }
 <span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
</li>
</ol>
<p>Finally, you can start the app with <code>npm start</code> and its Boom!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674600192142/135a7e07-dd05-46e5-aa12-a6c26f606ae9.png" alt class="image--center mx-auto" /></p>
<p>You have to be careful while mentioning your URLs in the OAuth configuration, sometimes it takes some time for the configuration at google API end. Once its done, you can start to explore the different parameters that comes in the response.</p>
<p>If you liked it then please share it and hit the like button because,</p>
<p>A person who feels appreciated will do more than expected! Happy coding :)</p>
]]></content:encoded></item><item><title><![CDATA[Facebook Login API integration in React with example]]></title><description><![CDATA[You might have signed up with Facebook on multiple platforms like Spotify, Netflix, Instagram, Airbnb, and a lot more. It is the simplest and most reliable way that saves time and makes your life easy. All these platforms are built on React and use t...]]></description><link>https://ajinkya10x.com/facebook-login-api-integration-in-react-with-example</link><guid isPermaLink="true">https://ajinkya10x.com/facebook-login-api-integration-in-react-with-example</guid><category><![CDATA[2Articles1Week]]></category><category><![CDATA[React]]></category><category><![CDATA[Facebook]]></category><category><![CDATA[WeMakeDevs]]></category><category><![CDATA[#ajinkyachanshetty]]></category><dc:creator><![CDATA[Ajinkya Chanshetty]]></dc:creator><pubDate>Sat, 14 Jan 2023 00:32:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1673656260261/3785f5e4-d07f-4e35-9fb2-70e6b2414133.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You might have signed up with Facebook on multiple platforms like Spotify, Netflix, Instagram, Airbnb, and a lot more. It is the simplest and most reliable way that saves time and makes your life easy. All these platforms are built on React and use the same API provided by Facebook that can be integrated into your local app as well.</p>
<p>To integrate Facebook authentication and login in React application, there are multiple libraries available, so we are going to use the 'react-facebook-login' one.</p>
<p>First, you need to have a Facebook account and then you can go to the Developer console here- <a target="_blank" href="https://developers.facebook.com/apps">https://developers.facebook.com/apps</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1673482417408/02c0c5de-0f26-41cd-bd29-db3be5176926.png" alt class="image--center mx-auto" /></p>
<p>Now, you can create a new app from the button</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1673482511901/7237da6d-7fb6-4a64-8384-db265a1c587e.png" alt class="image--center mx-auto" /></p>
<p>After that, you can start with any of the options which provide a different range of data, but for our scope as of now, you can select "Business".</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1673482666755/6705b6f1-3a70-4375-a677-f53df821238a.png" alt class="image--center mx-auto" /></p>
<p>Now, you can select the app name as per your convenience like 'react-login-app', and proceed further to create app.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1673482811907/9e5bd24c-bca4-4c47-9c6c-53cb2d13d05b.png" alt class="image--center mx-auto" /></p>
<p>Now your app is ready with the APP ID as shown on the menu bar.</p>
<p>Again you have to click settings &gt; basic &gt; add platform at the bottom of the page. Then you'll able to see this popup and select the web option.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1673483017372/d21f3b74-a65c-4ec1-b6f1-57b13dc491ca.png" alt class="image--center mx-auto" /></p>
<p>Once you select the web option, select the 'add platform' at the bottom and add the url as shown.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1673653535200/6a887b2b-953d-45a3-89db-d8e97dfc93ae.png" alt class="image--center mx-auto" /></p>
<p>now, we can start with the integration of the same with React app.</p>
<ol>
<li><p>First, create React app</p>
<pre><code class="lang-javascript"> npx create-react-app react-facebook-login-app
</code></pre>
</li>
<li><p>Then move inside the app folder with the command:</p>
<p> <code>cd react-facebook-login-app</code></p>
</li>
<li><p>Install bootstrap library package</p>
<p> <code>npm install bootstrap --save</code></p>
</li>
<li><p>Now, install the react-facebook-login package</p>
<p> <code>npm install react-facebook-login</code></p>
</li>
<li><p>Create Facebook login component as FacebookLoginComponent.js</p>
<pre><code class="lang-javascript"> <span class="hljs-keyword">import</span> React, { useState } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
 <span class="hljs-keyword">import</span> FacebookLogin <span class="hljs-keyword">from</span> <span class="hljs-string">"react-facebook-login"</span>;
 <span class="hljs-keyword">import</span> <span class="hljs-string">"./App.css"</span>;

 <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">FacebookLoginComponent</span>(<span class="hljs-params"></span>) </span>{
   <span class="hljs-keyword">const</span> [login, setLogin] = useState(<span class="hljs-literal">false</span>);
   <span class="hljs-keyword">const</span> [data, setData] = useState({});
   <span class="hljs-keyword">const</span> [picture, setPicture] = useState(<span class="hljs-string">""</span>);

   <span class="hljs-keyword">const</span> responseFacebook = <span class="hljs-function">(<span class="hljs-params">response</span>) =&gt;</span> {
     <span class="hljs-built_in">console</span>.log(response);
     <span class="hljs-comment">// Login failed</span>
     <span class="hljs-keyword">if</span> (response.status === <span class="hljs-string">"unknown"</span>) {
       alert(<span class="hljs-string">"Login failed!"</span>);
       setLogin(<span class="hljs-literal">false</span>);
       <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;
     }
     setData(response);
     setPicture(response.picture.data.url);
     <span class="hljs-keyword">if</span> (response.accessToken) {
       setLogin(<span class="hljs-literal">true</span>);
     } <span class="hljs-keyword">else</span> {
       setLogin(<span class="hljs-literal">false</span>);
     }
   };
   <span class="hljs-keyword">const</span> logout = <span class="hljs-function">() =&gt;</span> {
     setLogin(<span class="hljs-literal">false</span>);
     setData({});
     setPicture(<span class="hljs-string">""</span>);
   };

   <span class="hljs-keyword">return</span> (
     <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"container"</span>&gt;</span>
       {!login &amp;&amp; (
         <span class="hljs-tag">&lt;<span class="hljs-name">FacebookLogin</span>
           <span class="hljs-attr">appId</span>=<span class="hljs-string">"569720507786195"</span>
           <span class="hljs-attr">autoLoad</span>=<span class="hljs-string">{false}</span>
           <span class="hljs-attr">fields</span>=<span class="hljs-string">"name,email,picture"</span>
           <span class="hljs-attr">scope</span>=<span class="hljs-string">"public_profile,email,user_friends"</span>
           <span class="hljs-attr">callback</span>=<span class="hljs-string">{responseFacebook}</span>
           <span class="hljs-attr">icon</span>=<span class="hljs-string">"fa-facebook"</span>
         /&gt;</span>
       )}

       {login &amp;&amp; (
         <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"card"</span>&gt;</span>
           <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"card-body"</span>&gt;</span>
             <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"rounded"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">{picture}</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"Profile"</span> /&gt;</span>
             <span class="hljs-tag">&lt;<span class="hljs-name">h5</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"card-title"</span>&gt;</span>{data.name}<span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span>
             <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"card-text"</span>&gt;</span>Email ID: {data.email}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
             <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"btn btn-danger btn-sm"</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{logout}</span>&gt;</span>
               Logout
             <span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
           <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
         <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
       )}
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
   );
 }

 <span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> FacebookLoginComponent;
</code></pre>
<p> Now, you have to replace the appId with yours one.</p>
</li>
<li><p>Add the selector to this component in app.js file.</p>
<pre><code class="lang-javascript"> <span class="hljs-keyword">import</span> <span class="hljs-string">'./App.css'</span>;
 <span class="hljs-keyword">import</span> <span class="hljs-string">'../node_modules/bootstrap/dist/css/bootstrap.min.css'</span>;
 <span class="hljs-keyword">import</span> FacebookLoginComponent <span class="hljs-keyword">from</span> <span class="hljs-string">'./facebooklogin.component'</span>;

 <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
   <span class="hljs-keyword">return</span> (
     <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"App"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Facebook Login Tutorial in React App<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span> 

        <span class="hljs-tag">&lt;<span class="hljs-name">FacebookLoginComponent</span> /&gt;</span>

     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
   );
 }

 <span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<ol>
<li><p>Run the application with <code>npm start</code></p>
<p> and check on <a target="_blank" href="http://localhost:3000">http://localhost:3000</a></p>
</li>
</ol>
</li>
</ol>
<pre><code>![](https:<span class="hljs-comment">//cdn.hashnode.com/res/hashnode/image/upload/v1673654978696/eb13afa5-05c5-4cb9-ad50-43222df066fc.png align="center")</span>

That<span class="hljs-string">'s it. you can check out the example here-

%[https://codesandbox.io/s/react-facebook-login-example-6369em?file=/src/FacebookLoginComponent.js] </span>
</code></pre><p><a target="_blank" href="https://codesandbox.io/s/react-facebook-login-example-6369em?file=/src/FacebookLoginComponent.js">https://codesandbox.io/s/react-facebook-login-example-6369em?file=/src/FacebookLoginComponent.js</a></p>
<p>Happy coding, Thank you!</p>
]]></content:encoded></item></channel></rss>