<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Shshank</title>
    <description>The latest articles on Forem by Shshank (@shshank).</description>
    <link>https://forem.com/shshank</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F73146%2F1a581e0c-1e08-462b-99af-400a7d5938cc.jpg</url>
      <title>Forem: Shshank</title>
      <link>https://forem.com/shshank</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/shshank"/>
    <language>en</language>
    <item>
      <title>Navigating the Shift from Programmer to Manager: Invaluable Insights for Success</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Fri, 15 Sep 2023 16:04:50 +0000</pubDate>
      <link>https://forem.com/shshank/navigating-the-shift-from-programmer-to-manager-invaluable-insights-for-success-5epb</link>
      <guid>https://forem.com/shshank/navigating-the-shift-from-programmer-to-manager-invaluable-insights-for-success-5epb</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Going from programmer to manager? Remember: No strict rules, favor simplicity, embrace diversity, keep momentum, decide promptly, stay humble yet confident. Succeed in your new role!&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;p&gt;Making the leap from being a programmer to a manager is a significant milestone in your career journey. This transformation demands a fresh perspective and a unique set of skills. Drawing from personal experiences, here are some valuable insights to guide you on this exciting path.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flexibility Trumps Rigid Rules
&lt;/h3&gt;

&lt;p&gt;In the realm of programming, we often encounter strict coding rules like the "Don't Repeat Yourself" (DRY) principle. While these rules serve as guiding lights, remember that there are no one-size-fits-all solutions in management. Situations are nuanced, and it's crucial to adapt your approach accordingly.&lt;/p&gt;

&lt;p&gt;Example: Just as you'd assess the applicability of DRY in a coding scenario, evaluate each managerial decision in its specific context. The key is to think critically and tailor your strategies to suit the circumstances.&lt;/p&gt;

&lt;h3&gt;
  
  
  Embrace the Power of Simplicity
&lt;/h3&gt;

&lt;p&gt;Programmers tend to admire elegant, intricate code. However, as a manager, simplicity should be your guiding principle. While complexity may seem impressive, it can lead to confusion and inefficiency.&lt;/p&gt;

&lt;p&gt;Example: Think of simplicity as optimizing for clarity. Just as you'd favor clear, straightforward code over unnecessarily intricate solutions, opt for straightforward managerial strategies that your team can readily grasp and follow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Celebrate Diversity within Your Team
&lt;/h3&gt;

&lt;p&gt;In programming, a diverse toolkit enhances your capabilities. Similarly, a diverse team with a range of skills, backgrounds, and perspectives can be an invaluable asset. Encouraging diversity within your team fosters creativity and robust problem-solving.&lt;/p&gt;

&lt;p&gt;Example: Picture a coding project where you leverage different libraries for distinct tasks. Apply a similar approach to building your team. Seek individuals with diverse skills and viewpoints to create a well-rounded, adaptable workforce.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep the Momentum Going
&lt;/h3&gt;

&lt;p&gt;Just as project momentum is vital in programming for efficiency and progress, it's equally crucial in management. Overcome obstacles promptly and make timely decisions to sustain your team's momentum.&lt;/p&gt;

&lt;p&gt;Example: Imagine resolving coding issues swiftly to maintain a project's trajectory. Apply the same swiftness to address managerial challenges. Avoid dwelling in decision limbo and ensure your team's energy and productivity remain uninterrupted.&lt;/p&gt;

&lt;h3&gt;
  
  
  Action Trumps Indecision
&lt;/h3&gt;

&lt;p&gt;In programming, indecision can lead to code stagnation. In management, the principle remains unchanged. When faced with uncertainty, it's often wiser to make a decision, even if it requires adjustments later, than to indefinitely postpone action.&lt;/p&gt;

&lt;p&gt;Example: Consider a scenario in coding where you're uncertain about the best approach. You'd select one method and refine it based on feedback and outcomes. Adopt this mindset in management, making decisions when necessary and adapting as more information becomes available.&lt;/p&gt;

&lt;h3&gt;
  
  
  Balancing Humility and Confidence
&lt;/h3&gt;

&lt;p&gt;Both in programming and management, humility is essential. Acknowledge that you don't possess all the answers and remain receptive to learning from others. Simultaneously, maintain confidence in your abilities and decisions.&lt;/p&gt;

&lt;p&gt;Example: Think of the collaborative spirit in open-source development, where you collaborate with others and glean knowledge from their expertise. Apply this humility and thirst for learning to your managerial role while exuding confidence in your leadership.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;The transition from programmer to manager marks an exciting journey filled with opportunities for growth and influence. By embracing these insights, you can navigate this transformation successfully. Remember that your programming background equips you with problem-solving skills and adaptability that are invaluable in the realm of management. As you embark on this thrilling path, remain open to learning, prioritize simplicity, and lead with a harmonious blend of humility and confidence.&lt;/p&gt;

</description>
      <category>learning</category>
      <category>coding</category>
      <category>programming</category>
    </item>
    <item>
      <title>Cross-Device Testing: Ensuring Your Web App Shines Everywhere</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Fri, 08 Sep 2023 08:19:21 +0000</pubDate>
      <link>https://forem.com/shshank/cross-device-testing-ensuring-your-web-app-shines-everywhere-mf4</link>
      <guid>https://forem.com/shshank/cross-device-testing-ensuring-your-web-app-shines-everywhere-mf4</guid>
      <description>&lt;p&gt;Imagine this: you've carefully crafted your website, and it looks perfect in a responsive checker tool on your desktop. But when you open it on your mobile device, you're greeted with styling issues you never saw coming. What gives? Well, this is where cross-device testing comes into play. In this article, we'll dive into why this type of testing is crucial, how you can do it effectively, and provide you with concrete examples to make it all crystal clear. Plus, don't forget to share your insights in the comments!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Responsive Design Conundrum:
&lt;/h2&gt;

&lt;p&gt;Responsive web design is our saving grace when it comes to building websites that adapt gracefully to various devices. However, the real test is ensuring that what looks great in your desktop browser simulator works just as beautifully on an actual mobile device.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Power of Cross-Device Testing:
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Why is cross-device testing the unsung hero of web development? Here's why:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Smoother User Experience:&lt;/strong&gt; Websites that perform consistently across different devices deliver a better user experience, leading to higher satisfaction and engagement.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SEO Benefits:&lt;/strong&gt; Search engines love mobile-friendly websites. Rigorous testing can give your site a boost in search engine rankings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Wider Audience:&lt;/strong&gt; A responsive website casts a wider net, capturing users who prefer mobile devices over traditional computers.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Tools of the Trade:
&lt;/h2&gt;

&lt;p&gt;Ready to put your site through the wringer? Here are some handy tools and methods:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Browser DevTools:&lt;/strong&gt; Most web browsers offer built-in tools for emulating various devices and screen sizes. You can inspect and fine-tune your website's CSS and HTML in real-time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Online Emulators:&lt;/strong&gt; Platforms like BrowserStack and CrossBrowserTesting let you test your website across a range of devices and browsers without needing physical access to each one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Real Devices:&lt;/strong&gt; For the most accurate results, consider testing on actual smartphones and tablets. Invest in a collection of devices or explore cloud-based device farms for comprehensive testing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Tackling Challenges Head-On:
&lt;/h2&gt;

&lt;p&gt;Let's address some common issues and explore solutions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Styling Snags:&lt;/strong&gt; Elements may misbehave on mobile screens, like misalignment or text overflow. Utilize CSS media queries to adjust styles based on screen size.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@media screen and (max-width: 768px) {
  /* CSS rules for smaller screens */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;iOS ::first-letter Quirk:&lt;/strong&gt; iOS devices sometimes throw ::first-letter pseudo-element styling for a loop. Work around this by applying specific styles using JavaScript.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
  // Apply alternative ::first-letter styling
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Conclusion:
&lt;/h2&gt;

&lt;p&gt;Cross-device testing is the linchpin of ensuring a seamless user experience. It helps you identify and fix styling issues, making your website more accessible and user-friendly. By employing the right tools and techniques, you can create a website that impresses not only on your development machine but on every device your audience uses.&lt;/p&gt;

&lt;p&gt;Remember, a website that adapts gracefully to diverse screens stands a better chance of attracting and retaining visitors, ultimately contributing to your online success. So, don't skimp on the testing phase – it's your gateway to an impeccable web presence!&lt;/p&gt;

&lt;p&gt;In the comments section, feel free to share your insights and any additional tips you've discovered. Together, we can make the web a better place for everyone.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>css</category>
    </item>
    <item>
      <title>Open Source Project suggestions</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Mon, 04 Sep 2023 05:37:54 +0000</pubDate>
      <link>https://forem.com/shshank/open-source-project-suggestions-1opn</link>
      <guid>https://forem.com/shshank/open-source-project-suggestions-1opn</guid>
      <description>&lt;p&gt;Hey all! Let's share some new open source projects that requires contributers to help open source projects grow. Share list of projects you follow or part of OS project in comments.&lt;/p&gt;

</description>
      <category>php</category>
      <category>discuss</category>
      <category>javascript</category>
    </item>
    <item>
      <title>10 Essential JavaScript Code Snippets for Every Developer</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Sun, 03 Sep 2023 06:29:06 +0000</pubDate>
      <link>https://forem.com/shshank/10-essential-javascript-code-snippets-for-every-developer-59ml</link>
      <guid>https://forem.com/shshank/10-essential-javascript-code-snippets-for-every-developer-59ml</guid>
      <description>&lt;h2&gt;
  
  
  1. Debounce Function: Prevents a function from being called too frequently, especially useful for handling user input.
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const debounce = (func, delay) =&amp;gt; {
  let timeoutId;
  return (...args) =&amp;gt; {
    clearTimeout(timeoutId);
    timeoutId = setTimeout(() =&amp;gt; func(...args), delay);
  };
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Copy to Clipboard:
&lt;/h2&gt;

&lt;p&gt;Allows you to copy text to the clipboard.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const copyToClipboard = (text) =&amp;gt; {
  const textArea = document.createElement("textarea");
  textArea.value = text;
  document.body.appendChild(textArea);
  textArea.select();
  document.execCommand("copy");
  document.body.removeChild(textArea);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Deep Clone an Object:
&lt;/h2&gt;

&lt;p&gt;Creates a deep copy of an object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const deepClone = (obj) =&amp;gt; JSON.parse(JSON.stringify(obj));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Random Number Generator:
&lt;/h2&gt;

&lt;p&gt;Generates a random number within a specified range.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const getRandomNumber = (min, max) =&amp;gt; Math.floor(Math.random() * (max - min + 1)) + min;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Check if Array Contains Duplicates:
&lt;/h2&gt;

&lt;p&gt;Checks if an array contains duplicate elements.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const hasDuplicates = (arr) =&amp;gt; new Set(arr).size !== arr.length;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Capitalize the First Letter of a String:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const capitalizeFirstLetter = (str) =&amp;gt; str.charAt(0).toUpperCase() + str.slice(1);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. Date Formatting:
&lt;/h2&gt;

&lt;p&gt;Formats a JavaScript Date object into a human-readable string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const formatDate = (date) =&amp;gt; {
  const options = { year: 'numeric', month: 'long', day: 'numeric' };
  return date.toLocaleDateString(undefined, options);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8. Calculate Array Sum:
&lt;/h2&gt;

&lt;p&gt;Calculates the sum of elements in an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sumArray = (arr) =&amp;gt; arr.reduce((acc, current) =&amp;gt; acc + current, 0);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  9. Validate Email Address:
&lt;/h2&gt;

&lt;p&gt;Checks if a given string is a valid email address.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const isValidEmail = (email) =&amp;gt; /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  10. Fetch API Request:
&lt;/h2&gt;

&lt;p&gt;Performs a simple HTTP GET request using the Fetch API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch('https://api.example.com/data')
  .then(response =&amp;gt; response.json())
  .then(data =&amp;gt; console.log(data))
  .catch(error =&amp;gt; console.error('Error:', error));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These JavaScript code snippets encompass various common tasks in web development and can be valuable additions to your projects. If you have any other helpful snippets to share, please feel free to contribute in the comments section, enhancing the utility of this thread.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Laravel Beyond Basics: Unleash Advanced Tips and Tricks</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Thu, 31 Aug 2023 07:53:57 +0000</pubDate>
      <link>https://forem.com/shshank/laravel-beyond-basics-unleash-advanced-tips-and-tricks-55e6</link>
      <guid>https://forem.com/shshank/laravel-beyond-basics-unleash-advanced-tips-and-tricks-55e6</guid>
      <description>&lt;p&gt;Are you eager to take your Laravel skills to the next level? While you've got the hang of the basics, there's a treasure trove of advanced tips and tricks waiting for you. In this beginner-friendly guide, we'll uncover some powerful techniques that can supercharge your Laravel development journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Mastering Service Providers:
&lt;/h2&gt;

&lt;p&gt;Service providers are like magic tools that enhance your Laravel app's capabilities. For instance, imagine you're integrating a payment gateway. You can create a custom service provider that binds the payment gateway's API to Laravel's service container. This way, you'll have a centralized and clean way to manage payments throughout your app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// CustomServiceProvider.php
public function register()
{
    $this-&amp;gt;app-&amp;gt;bind(PaymentGateway::class, function ($app) {
        return new PaymentGateway(config('payment.api_key'));
    });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Diving into Event Listeners:
&lt;/h2&gt;

&lt;p&gt;Let's say you want to send a welcome email to users when they sign up. By setting up an event listener, you can automatically trigger the email whenever a user registers. This helps in making your application more responsive and user-friendly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// UserRegistered.php
public function handle(UserRegistered $event)
{
    Mail::to($event-&amp;gt;user-&amp;gt;email)-&amp;gt;send(new WelcomeEmail());
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Middleware Magic:
&lt;/h2&gt;

&lt;p&gt;Middleware isn't just for authentication. Consider a scenario where you want to log every request made to your app. By creating a custom middleware, you can effortlessly log data without cluttering your main codebase.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// LogRequests.php
public function handle($request, Closure $next)
{
    Log::info('Request:', $request-&amp;gt;all());
    return $next($request);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. A Peek into Eloquent Relationships:
&lt;/h2&gt;

&lt;p&gt;Suppose you're building a blog app. Eloquent relationships allow you to easily associate authors with their articles, comments with posts, and more. By understanding and implementing these relationships, your database queries become remarkably efficient.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Article.php
public function author()
{
    return $this-&amp;gt;belongsTo(User::class, 'author_id');
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Crafting Artisan Commands:
&lt;/h2&gt;

&lt;p&gt;Think about running a command to generate boilerplate code for frequently used components, like controllers or models. With Artisan, you can create custom commands to automate these processes, saving you time and effort.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:custom-controller
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Unlocking the Power of Queues:
&lt;/h2&gt;

&lt;p&gt;Imagine you're allowing users to upload images. Processing these images in real-time could slow down your app. With queues, you can move image processing to the background, ensuring a smooth user experience.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// UploadImageController.php
public function upload(Request $request)
{
    $image = $request-&amp;gt;file('image');
    ProcessImage::dispatch($image);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. Exploring Package Development:
&lt;/h2&gt;

&lt;p&gt;Suppose you've built a unique functionality, like a customizable calendar. Packaging it allows other developers to easily integrate it into their projects. By sharing your package with the Laravel community, you contribute to a thriving ecosystem.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer create-project vendor/package
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By the end of this guide, you'll have a whole new set of skills to wield in your Laravel projects. These advanced techniques will not only make your code more efficient but also boost your confidence as a Laravel developer. So, let's journey beyond the basics and unlock the true potential of Laravel's advanced features!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>beginners</category>
      <category>php</category>
    </item>
    <item>
      <title>Unlocking the Secrets of GoF Design Patterns: A Beginner's Guide</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Sat, 19 Aug 2023 07:35:50 +0000</pubDate>
      <link>https://forem.com/shshank/unlocking-the-secrets-of-gof-design-patterns-a-beginners-guide-h24</link>
      <guid>https://forem.com/shshank/unlocking-the-secrets-of-gof-design-patterns-a-beginners-guide-h24</guid>
      <description>&lt;p&gt;Picture software development as crafting a puzzle, where each piece fits just right. Design patterns are like those pre-made puzzle pieces, solving common challenges developers face. One set of these patterns, known as the Gang of Four (GoF) design patterns, is particularly famous. Let's break them down in simple terms using relatable examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Building Better with Creational Patterns
&lt;/h2&gt;

&lt;p&gt;Imagine you're baking cookies. Creational patterns are like your cookie-cutter shapes. They help you create objects in a smart way. There are five types of these patterns.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Factory Method&lt;/strong&gt;: Think of this as a cookie factory. You ask for your favorite flavour, and it bakes it for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Abstract Factory&lt;/strong&gt;: This is a cookie factory that makes different shapes, sizes, and flavours of cookies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Singleton&lt;/strong&gt;: Imagine a recipe book that everyone uses. Singleton makes sure there's only one copy for everyone to share.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prototype&lt;/strong&gt;: This is like making a copy of your best cookie and then decorating it differently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Builder&lt;/strong&gt;: Builders help you create fancy cookie houses. You follow step-by-step instructions to build your masterpiece.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Fitting Pieces with Structural Patterns
&lt;/h2&gt;

&lt;p&gt;Think of building a cool LEGO structure. Structural patterns help you connect LEGO bricks to create something big. There are seven types of these patterns.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Adapter&lt;/strong&gt;: Imagine you have a charger that doesn't fit your phone. An adapter makes it work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bridge&lt;/strong&gt;: It's like building a bridge between two islands so they can talk to each other.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composite&lt;/strong&gt;: Think of this as building a cool robot from smaller parts like arms, legs, and a head.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decorator&lt;/strong&gt;: Imagine your plain LEGO house. With decorator, you add different designs to make it unique.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facade&lt;/strong&gt;: This is like pressing one button on a remote to do many things. It hides the complicated stuff.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flyweight&lt;/strong&gt;: Think of this as sharing your toy car with friends to save space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proxy&lt;/strong&gt;: It's like asking a friend to order your favorite food. They do it for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Teamwork with Behavioral Patterns
&lt;/h2&gt;

&lt;p&gt;Imagine playing in a team. Behavioral patterns show how team members work together. There are eleven types of these patterns.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chain of Responsibility&lt;/strong&gt;: Imagine passing a note in class. It goes from one friend to another until the right person reads it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command&lt;/strong&gt;:  It's like giving a magic wand to someone else to do things for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interpreter&lt;/strong&gt;: Think of this as a language translator, making everyone understand the same message.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Iterator&lt;/strong&gt;: Imagine looking at each animal in a zoo one by one. An iterator helps you do that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mediator&lt;/strong&gt;: It's like a team captain who helps players communicate without confusion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memento&lt;/strong&gt;: Imagine saving your video game at a certain level. Memento helps you go back to that level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observer&lt;/strong&gt;: Think of this like a group chat. When someone sends a message, everyone in the group knows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State&lt;/strong&gt;: Imagine a light that changes colors based on the room's mood. The state pattern works like that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strategy&lt;/strong&gt;: It's like having different game plans for different opponents. You pick the best one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Template Method&lt;/strong&gt;: Think of following a recipe to bake cookies. You can change some ingredients and still get yummy cookies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visitor&lt;/strong&gt;: Imagine a friendly inspector who visits every room and leaves a note.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, these patterns are like your coding buddies. They help you build software smarter, just like using cookie cutters to make perfect cookies. Like connecting LEGO bricks to create something amazing. And, of course, working as a team in a game. Remember these &lt;strong&gt;Gang of Four patterns&lt;/strong&gt; - they're like your coding toolbox, making coding easier and more fun!"&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>GitHub adds more security enhancements to npm</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Sat, 27 Aug 2022 15:45:15 +0000</pubDate>
      <link>https://forem.com/shshank/github-adds-more-security-enhancements-to-npm-439b</link>
      <guid>https://forem.com/shshank/github-adds-more-security-enhancements-to-npm-439b</guid>
      <description>&lt;p&gt;GitHub has announced the general availability of an enhanced 2FA experience on npm, as well as an improved verification process of accounts and packages. Here are the other updates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A streamlined login and publishing experience with the npm CLI&lt;/li&gt;
&lt;li&gt;Ability to connect GitHub and Twitter accounts to npm&lt;/li&gt;
&lt;li&gt;All packages on npm have been re-signed&lt;/li&gt;
&lt;li&gt;Added a new npm CLI command to audit package integrity&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>visibility : hidden vs display : none</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Sat, 20 Aug 2022 15:16:08 +0000</pubDate>
      <link>https://forem.com/shshank/visibility-hidden-vs-display-none-589f</link>
      <guid>https://forem.com/shshank/visibility-hidden-vs-display-none-589f</guid>
      <description>&lt;h2&gt;
  
  
  visibility : hidden
&lt;/h2&gt;

&lt;p&gt;When applied to HTML element, it will not be visible in the page. But, the HTML element is still in the DOM. The element will not be seen but it does takes up space.&lt;/p&gt;

&lt;h2&gt;
  
  
  display : none
&lt;/h2&gt;

&lt;p&gt;When applied to HTML element, it will not be visible in the page. The element has no affect on the DOM. The element will not be seen as well as does not takes up space.&lt;/p&gt;

&lt;p&gt;A simple HTML layout&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;CSS Properties&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdpmlwiknr0tgncufwoy1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdpmlwiknr0tgncufwoy1.png" alt="BhavShashank"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Applying &lt;code&gt;visibility: hidden&lt;/code&gt; to div element&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcdnexh0dkw1cvtpf081f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcdnexh0dkw1cvtpf081f.png" alt="Visiblity Hidden BhavShashank"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Applying &lt;code&gt;display:none&lt;/code&gt; to div element&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdoobxv1kviuk6biltqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdoobxv1kviuk6biltqo.png" alt="Display None BhavShashank"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/bhavshashank/embed/PoRVdOa?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;To Conclude&lt;br&gt;
With &lt;code&gt;visibility:hidden&lt;/code&gt;, the element takes up space but &lt;code&gt;display: none&lt;/code&gt;, it is removed from the DOM and does not takes up space.&lt;/p&gt;

&lt;p&gt;Thank you for reading.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Plugin/Library idea</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Thu, 11 Aug 2022 09:04:11 +0000</pubDate>
      <link>https://forem.com/shshank/pluginlibrary-idea-3fcd</link>
      <guid>https://forem.com/shshank/pluginlibrary-idea-3fcd</guid>
      <description>&lt;p&gt;Hi! Hope you all are doing well. Being a developer, open source and stack overflow are your best friend. &lt;/p&gt;

&lt;p&gt;I wanted to thanks to all contributers and developer who build open source products, write tuts. &lt;/p&gt;

&lt;p&gt;From a long time, I wanted to build a library or project and launch it as open source, but not getting enough ideas. So requesting, if you guys can help me finding an idea in PHP laravel or JS.&lt;/p&gt;

&lt;p&gt;Thank you for spending time reading till here. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>php</category>
      <category>laravel</category>
      <category>programming</category>
    </item>
    <item>
      <title>flat() vs flatMap()</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Thu, 11 Aug 2022 06:52:03 +0000</pubDate>
      <link>https://forem.com/shshank/flat-vs-flatmap-3p73</link>
      <guid>https://forem.com/shshank/flat-vs-flatmap-3p73</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;flat()&lt;/code&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;flat()&lt;/code&gt; method creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Argument - The depth level specifying how deep a nested array structure should be flattened. Default value is 1.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;flat()&lt;/code&gt; method removes empty slots in arrays.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flat&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="c1"&gt;// [10, 20, 40, 50]&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arrTwo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arrTwo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flat&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="c1"&gt;// [10, [20], 30]&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arrThree&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;]]];&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arrThree&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// [10, 20, 30]&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arrFour&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[[[[&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;]]]]];&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;Infinity&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;//[10, 20, 40];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;flatMap()&lt;/code&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The flat &lt;code&gt;flatMap()&lt;/code&gt; method return a new array formed by applying a given callback function to each element of the array, and then flattening the array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is identical to a &lt;code&gt;map()&lt;/code&gt; followed by a &lt;code&gt;flat()&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;resultingArr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flatMap&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resultingArr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// [3, 6, 9]&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arrTwo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]]];&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;doubleEven&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flatMap&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;doubleEven&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// [4]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>#CSSExplainer: image() function, explained</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Fri, 05 Aug 2022 12:31:38 +0000</pubDate>
      <link>https://forem.com/shshank/cssexplainer-image-function-explained-2aae</link>
      <guid>https://forem.com/shshank/cssexplainer-image-function-explained-2aae</guid>
      <description>&lt;p&gt;The CSS &lt;code&gt;image()&lt;/code&gt; function is similar to the &lt;code&gt;url()&lt;/code&gt; function, but with extra features that let us specify an image with fallback options and annotations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key features:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Uses media fragments to clip out a portion&lt;/li&gt;
&lt;li&gt;Specifies fallback images&lt;/li&gt;
&lt;li&gt;Uses a solid color as an image&lt;/li&gt;
&lt;li&gt;Specifies the directionality of image, ltr for left to right or rtl for right to left
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* Syntax of image() function */&lt;/span&gt;

&lt;span class="c"&gt;/*
image(&amp;lt;image-tags&amp;gt; [ &amp;lt;image-src&amp;gt; , &amp;lt;color&amp;gt; ] )

&amp;lt;image-tags&amp;gt; = ltr | rtl
 ltr - ltr for left-to-right &amp;amp; rtl - right-to-left. 

&amp;lt;image-src&amp;gt; = &amp;lt;url&amp;gt; | &amp;lt;string&amp;gt;
&amp;lt;color&amp;gt; = &amp;lt;rgb()&amp;gt; | &amp;lt;rgba()&amp;gt; | &amp;lt;hsl()&amp;gt; | &amp;lt;hsla()&amp;gt; | &amp;lt;hex-color&amp;gt; | &amp;lt;named-color&amp;gt;
*/&lt;/span&gt;


&lt;span class="c"&gt;/* Example-1: Cropping portion of an image*/&lt;/span&gt;
&lt;span class="nc"&gt;.logo&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;background-image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;'myimage.webp#xywh=338,324,360,390'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Example-2: Putting color on top of a background image */&lt;/span&gt;
&lt;span class="nc"&gt;.logo&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
    &lt;span class="sx"&gt;url("https://mdn.mozillademos.org/files/12053/firefox.png")&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;25%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-repeat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;no-repeat&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>css</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>What's new in Vue.js 2.7.8</title>
      <dc:creator>Shshank</dc:creator>
      <pubDate>Sat, 30 Jul 2022 12:28:30 +0000</pubDate>
      <link>https://forem.com/shshank/whats-new-in-vuejs-278-c48</link>
      <guid>https://forem.com/shshank/whats-new-in-vuejs-278-c48</guid>
      <description>&lt;p&gt;The version 2.7.8 of Vue.js, the JavaScript framework for building user interfaces and single-page apps, is now available. This version includes notable improvements, some of which are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixed &lt;code&gt;shallowReactive&lt;/code&gt; nested ref setting edge cases&lt;/li&gt;
&lt;li&gt;Added support for listeners on setup context and &lt;code&gt;useListeners()&lt;/code&gt; helper&lt;/li&gt;
&lt;li&gt;Resolved the issue with &lt;code&gt;&amp;lt;script setup&amp;gt;&lt;/code&gt; component resolution edge case with v3&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>vue</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
