<?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>DEV Community: Awa</title>
    <description>The latest articles on DEV Community by Awa (@alwalxed).</description>
    <link>https://dev.to/alwalxed</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%2F1162540%2Fb5f660c8-cb82-490f-8469-e617bf1477e2.jpg</url>
      <title>DEV Community: Awa</title>
      <link>https://dev.to/alwalxed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alwalxed"/>
    <language>en</language>
    <item>
      <title>Context Dump: Simplifying AI File Preparation</title>
      <dc:creator>Awa</dc:creator>
      <pubDate>Sat, 21 Dec 2024 12:32:12 +0000</pubDate>
      <link>https://dev.to/alwalxed/context-dump-simplifying-ai-file-preparation-id5</link>
      <guid>https://dev.to/alwalxed/context-dump-simplifying-ai-file-preparation-id5</guid>
      <description>&lt;p&gt;If you’ve ever needed to gather specific project files for an AI task, Context Dump might help. It’s a simple CLI tool to generate a JSON dump of your project’s structure and content, ready for AI consumption.&lt;/p&gt;

&lt;h2&gt;
  
  
  What It Does
&lt;/h2&gt;

&lt;p&gt;Lets you select files interactively using a checkbox.&lt;br&gt;
Automatically ignores files like &lt;code&gt;node_modules&lt;/code&gt;, &lt;code&gt;.git&lt;/code&gt;, or anything in your &lt;code&gt;.gitignore&lt;/code&gt;.&lt;br&gt;
Outputs a structured JSON file containing file paths and contents.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to Use It
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Install:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; context-dump
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Run in any project directory:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;context-dump  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;JSON output is saved to &lt;code&gt;ai_context.json&lt;/code&gt; by default.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can also:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Change the output filename with &lt;code&gt;-o&lt;/code&gt;.&lt;br&gt;
Exclude specific files or folders with &lt;code&gt;-e&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Example Output
&lt;/h2&gt;

&lt;p&gt;Here’s what the JSON looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;  
  &lt;/span&gt;&lt;span class="nl"&gt;"project_structure"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"example.js"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;  
  &lt;/span&gt;&lt;span class="nl"&gt;"file_contents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;  
    &lt;/span&gt;&lt;span class="nl"&gt;"example.js"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;  
      &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"console.log('Hello, World!');"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;  
      &lt;/span&gt;&lt;span class="nl"&gt;"extension"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"js"&lt;/span&gt;&lt;span class="w"&gt;  
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;  
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;  
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check it out on &lt;a href="https://github.com/alwalxed/context-dump" rel="noopener noreferrer"&gt;Github&lt;/a&gt; . If it sounds useful, give it a try.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>javascript</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>These Two Tools Helped Me Earn $40K in Bounties</title>
      <dc:creator>Awa</dc:creator>
      <pubDate>Sat, 16 Nov 2024 21:29:48 +0000</pubDate>
      <link>https://dev.to/alwalxed/these-two-tools-helped-me-earn-40k-in-bounties-3bmb</link>
      <guid>https://dev.to/alwalxed/these-two-tools-helped-me-earn-40k-in-bounties-3bmb</guid>
      <description>&lt;p&gt;Hey Dev.to! 👋  &lt;/p&gt;

&lt;p&gt;I wanted to share two tools I built that helped me earn around $40K in bounties over the past two months. Both are open-source, easy to use, and work really well together (though they can be used independently too).  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Tool #1: Wayurls&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This tool is inspired by TomNomNom’s &lt;em&gt;waybackurls&lt;/em&gt;, but I’ve made it faster and more reliable. It’s written in Go, and installation is as simple as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go &lt;span class="nb"&gt;install &lt;/span&gt;github.com/alwalxed/wayurls@latest  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can find the repo here: &lt;a href="https://github.com/alwalxed/wayurls" rel="noopener noreferrer"&gt;https://github.com/alwalxed/wayurls&lt;/a&gt;.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Tool #2: Juicyurls&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;After gathering URLs with &lt;em&gt;wayurls&lt;/em&gt;, I use &lt;em&gt;juicyurls&lt;/em&gt; to filter them and find the interesting ones. It’s also written in Go and works great for narrowing down your targets. To install it, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go &lt;span class="nb"&gt;install &lt;/span&gt;github.com/alwalxed/juicyurls@latest  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s the repo for &lt;em&gt;juicyurls&lt;/em&gt;: &lt;a href="https://github.com/alwalxed/juicyurls" rel="noopener noreferrer"&gt;https://github.com/alwalxed/juicyurls&lt;/a&gt;.  &lt;/p&gt;




&lt;p&gt;I usually use these tools in a pipeline, but they can definitely be used on their own depending on your needs.  &lt;/p&gt;

&lt;p&gt;Feel free to check them out, and if you want to contribute or just want to say thanks, don’t hesitate to reach out.  &lt;/p&gt;

&lt;p&gt;Happy hunting! I hope these tools are as helpful to you as they’ve been to me! 😊  &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Tags:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#opensource #golang #bugbounty #infosec #waybackurls #securitytools #vulnerability #cybersecurity #pentesting #ethicalhacking #programming #developer #devtools #hackingtools #automation #open_source_software #github #kali #python #redteam #blueTeam #websecurity #dataanalysis #techtools #code #codetools #programmingtools #bughunting #vulndev #infoseccommunity #softwaredevelopment #coding #bugbountyhunter #cyberattack #cyberdefense #networksecurity #pentesttools #securityresearch #opensourcecommunity #techgeek #webscraping #hacker #programminglife #devops #hackthebox #osint #vulnerabilityassessment #securitytesting #programmingprojects #openprogramming #securityresearcher #blackhat #cyberthreats #hackertools&lt;/code&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>cybersecurity</category>
      <category>tooling</category>
      <category>opensource</category>
    </item>
    <item>
      <title>10 'Aha' Moments: Navigating React's Doc!</title>
      <dc:creator>Awa</dc:creator>
      <pubDate>Sat, 16 Sep 2023 07:39:25 +0000</pubDate>
      <link>https://dev.to/alwalxed/10-aha-moments-navigating-reacts-new-documentation-3cm7</link>
      <guid>https://dev.to/alwalxed/10-aha-moments-navigating-reacts-new-documentation-3cm7</guid>
      <description>&lt;p&gt;Since the React documentation update, I hadn't found the time to thoroughly go through it. In the past two days, I dedicated myself to sifting through every detail, looking for any previous misunderstandings and gaining new insights. So, Here, I share the &lt;strong&gt;10 misconceptions&lt;/strong&gt; I had about React!&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  1. React Assumes Every Component is a Pure Function
&lt;/h2&gt;

&lt;p&gt;Purity in programming is a way of writing functions. There are many programming paradigms (paradigm means the rules or structures for writing your app). There are two common paradigms: OOP and Functional Programming. In the past, React was implemented in OOP, therefore, there were classes. However, later they switched to Functional Programming, where the concept of purity is highly important. What it stands for is simple: a pure function is a function that contains all it needs inside it without relying on external values. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function addNumbers(a, b) {
  return a + b;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice how the function takes two arguments and returns them without relying on anything other than them. And notice here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let total = 0;

function addToTotal(number) {
  total += number;
  return total;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;how the function is impure and relies on external resources to compute the value. React is fundamentally designed around this concept, therefore, as the heading says: React assumes that every component you write is a pure function.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. React's Re-rendering Process is Recursive
&lt;/h2&gt;

&lt;p&gt;It may be a bit strange to be surprised about such a thing, but I hadn’t really thought about it, although it makes sense. Recursion in programming is a way of solving specific types of problems, which are recursive problems. A recursive problem is a problem where the initial returned value of a function needs to be computed n times in order to produce the final value. In a nutshell, a function calls itself multiple times until it reaches its final condition. So in React, when you're mounting a component, it checks if there are other components inside it that need to be mounted and checks inside them again and again until it renders them all.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Think of React States as Snapshots!
&lt;/h2&gt;

&lt;p&gt;Start to think about React States as snapshots! This one is so cool! I always thought about states in a formless way, like a box or a variable, however, thinking about them as snapshots solidifies their functionality even more. Unlike regular JavaScript variables, React state behaves more like a snapshot. So setting it does not change the state variable you already have, but instead triggers a re-render with the new “value” or snapshot!&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Every Render Has its Own DNA
&lt;/h2&gt;

&lt;p&gt;In every re-render, a component's internal variables and event handlers don’t “survive” re-renders. Instead, they get recreated, so every render has its own event handlers!&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Paradoxical and Impossible States
&lt;/h2&gt;

&lt;p&gt;When working with states, try to visualize your component logic before implementing it, because as long as you make your states concise and few, you'll maintain conciseness and avoid bugs. As the Docs say: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Remove any non-essential states.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Creating many states can result in common logical errors between them, where one state paradoxically contradicts others. &lt;em&gt;For example, imagine a checkbox component that can be either checked or unchecked. If the component's state somehow indicates that it's both checked and unchecked simultaneously, it's in a paradoxical state.&lt;/em&gt; Impossible states are states that are theoretically not possible based on the business logic of the application. &lt;em&gt;For example, if you have a form with required fields, it's an impossible state for the form to be submitted without those fields being filled out. If this were to happen, it would indicate a bug or a logic error in the application.&lt;/em&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Don't Mirror Props
&lt;/h2&gt;

&lt;p&gt;Don't mirror props. If you are passing a state from parent to child, avoid storing the passed prop into a local state. Because if the parent's state gets updated, the local state will override it. Instead, use it directly, and if you find the need to shorten it, consider storing it in a constant variable.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Consider Using Immer for Concise, State Updates
&lt;/h2&gt;

&lt;p&gt;Consider using Immer for concise state updates, especially for objects and arrays. Immer is a handy library when working with objects and arrays. Here's how Immer works: In React, it's clearly not recommended to mutate objects and arrays. Instead, it's better to reproduce them with the new value. In other words, copy them to a new state and override them with the desired changes. This can be a bit painful, especially if your state is nested and you don't want to change its structure, i.e., flattening it. So, Immer comes to solve this problem by introducing a very intuitive and convenient way. To update state with Immer, you would mutate it like you are mutating a normal object. And it looks like you are breaking the rules! But it's not, because you are not directly mutating the original state, but instead, you are mutating a proxy state that lets you change it, and then it does all the magic for you under the hood, by comparing the changes to the proxy state to the original and then producing the new one!&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Preserving and Resetting State
&lt;/h2&gt;

&lt;p&gt;Imagine a parent component with its state passed down to two children. If one child updates it, the other will also re-render since the parent component re-renders due to the state update. However, the internal states of the other child won't be destroyed because they're tied to the component's lifecycle. The lifecycle comprises three stages: Mounting, Re-rendering, and Unmounting. So, internal states are only destroyed when the component gets unmounted. But during re-rendering, the states persist because it's actually a fundamental part of the component's lifecycle.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  9. useReducer and useState are Technically the Same
&lt;/h2&gt;

&lt;p&gt;useReducer and useState are technically the same. The main difference between them, or the main reason that may make you choose useReducer over useState, is when you have multiple event handlers in your component that are updating the same state. Instead of having all these sprinkled handlers all over your component, you can abstract them into a single file, and contain them into a single packet, and organize them using if statements or even better, switch cases.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  10. useEffect is Meant for External Systems!
&lt;/h2&gt;

&lt;p&gt;The primary purpose of useEffect is to interface with external systems. useEffect is an escape hatch provided by React to let you escape their paradigm. As stated in the doc: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Effects are an escape hatch from the React paradigm. They let you “step outside” of React and synchronize your components with some external system."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So if one wants to sync anything that's React related, using useEffect would be insufficient! A list of common systems outside of React that you might interact with using tools like useEffect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Browser APIs (DOM manipulation, timers, etc.)&lt;/li&gt;
&lt;li&gt;Network Requests (HTTP requests to servers, API calls)&lt;/li&gt;
&lt;li&gt;WebSockets and Server-Sent Events (Real-time communication)&lt;/li&gt;
&lt;li&gt;Global State Management (Redux, Context API, etc.)&lt;/li&gt;
&lt;li&gt;Browser Storage (localStorage, sessionStorage)&lt;/li&gt;
&lt;li&gt;External Libraries and Modules&lt;/li&gt;
&lt;li&gt;Native Modules (in React Native) (for mobile applications)&lt;/li&gt;
&lt;li&gt;Event Listeners (e.g., clicks, key presses)&lt;/li&gt;
&lt;li&gt;Browser History and Navigation&lt;/li&gt;
&lt;li&gt;Browser Cookies and Headers&lt;/li&gt;
&lt;li&gt;Geolocation APIs (for accessing user’s location)&lt;/li&gt;
&lt;li&gt;Media APIs (audio, video, etc.)&lt;/li&gt;
&lt;li&gt;Canvas and WebGL APIs (for graphics)&lt;/li&gt;
&lt;li&gt;Device APIs (accessing&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>javascript</category>
      <category>coding</category>
    </item>
  </channel>
</rss>
