teleren/devto huggingface dataset:
Navigating the open-source package Odyssey
Tags: opensource, reactnative, package
Published: 2023-12-23 20:09:20

---
title: Navigating the open-source package Odyssey
published: true
description: Releasing an open-source package might seem easy, but maintaining it is another story. And it becomes more challenging if you don't have time
tags: opensource,reactnative,package,
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-12-23 20:03 +0000
---

Releasing an open-source package might seem easy, but maintaining it is another story. I have published around four to five libraries so far. Although simple, they effectively served their purpose.


![Navigating through the open-source package odyssey](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bsbipyaulnthdtwedjg0.png)


Life changes, like switching jobs or discontinuing projects, can disrupt your connection with the original project. This disruption makes updating and maintaining the packages derived from that project challenging. It’s particularly difficult if your new role or project doesn’t involve using those libraries.

With smaller packages that don’t generate income, we often limit updates to our free time. This becomes even more challenging when working intensively, as the available time for such updates dwindles.

I must admit, I only recently updated a package I developed years ago and hadn’t used it in the last one or two years. Each new issue report or notification related to these packages increases my unease. This feeling intensifies when I’m deeply involved in another project, especially when developing a new package for a necessary component. At this point, every commit starts to feel frustrating.

**(Check out v3.0.0 RN-Secure-Storage: https://github.com/talut/rn-secure-storage)**

Despite these challenges, the reliance of many people on your package for their work creates a sense of responsibility for you as a developer.

## What about the future?

Fortunately, I’ve decided to start a hobby project that incorporates all my unarchived packages. This approach lets me continuously update these shared packages while developing my hobby project, offering a practical solution to an ongoing challenge.
Of course, there’s the common scenario where hobby projects, a standard pursuit for every software developer, often get set aside. However, one must start somewhere.

Perhaps by acknowledging this, I am, in a way, giving myself a reason to see my hobby project through to completion.
It’s easy to begin a project with enthusiasm, but as the initial excitement wanes and other commitments take precedence, these personal ventures tend to drift into the background. Yet, these projects hold more than just code; they are a testament to our learning journey, creativity, and passion for the craft.
The importance of Clean Code
Tags: programming, beginners, javascript, cleancode
Published: 2022-10-25 17:52:55


![Clean Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/awm1daiq1xofi2yvtq28.png)

> "So if you want to go fast, if you want to get done quickly, if you want your code to be easy to write, make it easy to read." - Robert C Martin

Clean code is very important not just to you but everyone that has to work with the code as-well. Clean coding means writing for your future self and others that will have to go back and read your code. The code is not just for the computer it is for humans to understand too.

If you do not write clean code you will get lost in the sauce as my cohort would say. Code should be written in functions adding modularity and those functions should do one thing. Nested code can be hard to read and make changes to if the programmer can't even understand the code. Writing with variables and functions that have meaningful names can be helpful towards writing clean code. Writing simple code will help with writing clean code for example knowing when to use if statements and when to use ternary statements. Having all these things will lead to clean code as-well as when looking for how to fix a problem it will be solved faster with clean code.

To conclude writing clean code isn't just for yourself but for others too. Just because you understand it now doesn't mean you will later. Writing clean code will allow you to work much faster as-well as anyone you are working with too.
Essential Concepts for Professional Web and REST API Development
Tags: javascript, express, backend, programming
Published: 2023-12-23 20:04:43

Mastering Express.js requires a deep understanding of several key concepts that are essential for writing high-quality code and building professional applications. Here's what you need to know:

## 1. Middleware
Understand what Middleware is, how it operates, and its role in managing requests, responses, and their flow. This includes creating custom Middleware and using third-party Middleware.

## 2. Routes and Routing
Know how to define routes and handle different HTTP methods (GET, POST, PUT, DELETE, etc.). This also involves using route parameters, managing dynamic routes, and grouping routes.

## 3. Error Handling
Learn effective error management using Middleware for error handling and design patterns to capture and respond to errors coherently.

## 4. Model-View-Controller (MVC)
While Express.js does not enforce a specific structure, understanding and applying the MVC pattern can help organize your code more efficiently.

## 5. Database Integration 
Understand how to integrate Express.js with different databases, whether SQL (like PostgreSQL or MySQL) or NoSQL (like MongoDB).

## 6. Authentication and Security
Know best practices for implementing authentication and authorization (like JWT, OAuth), and understand security concepts like CORS, SQL injection, XSS, CSRF, and how to mitigate them.

## 7. Testing 
Familiarize yourself with testing Express applications, using tools and frameworks like Mocha, Chai, or Jest for unit and integration testing.

## 8. Performance Optimization
Learn how to optimize an Express application to enhance its performance, which may include caching techniques, response compression, and reducing server workload.

## 9. Template Engines
Understand how template engines like Pug, EJS, or Handlebars work and are used, though they are not always utilized in REST APIs.

## 10. Deployment and Maintenance
Know the best practices for deploying and maintaining Express applications in production, including environment configuration, log management, and monitoring.

Mastering these concepts will provide a solid foundation for working professionally with Express.js, allowing you to create robust, secure, and high-performing applications.
Zik Analytics
Tags: webdev, javascript, programming, beginners
Published: 2023-12-23 19:45:31

[Zik Analytics](https://www.wsovn.net/mua-chung-zik-analytics) là gì?
ZIK Analytics là một công cụ nghiên cứu thị trường thương mại điện tử hàng đầu, giúp người bán tìm thấy các mặt hàng có lợi nhuận để bán trên eBay và các thị trường khác và chỉ cho họ cách bán hàng nhanh chóng bằng cách xếp hạng chúng trên trang 1.
Zikanalytics là công cụ hỗ trợ spy cực tốt ở ebay, dễ dàng tìm được các sản phẩm bán chạy ở các store khác, và tìm được sản phẩm hot để bán trên ebay (Không bị logout khi dùng).
Tính năng chính mà Zik Analytics đang có:
CÁC NHÀ CẠNH TRANH NGHIÊN CỨU NHẬN DỮ LIỆU CHÍNH XÁC
Zik Analytics quét các chỉ số chính của người bán bao gồm lượng hàng đã bán, lợi nhuận và các mặt hàng đã bán để xem những gì mọi người đang mua với Phân tích ZIK.
TRONG NGHIÊN CỨU SẢN PHẨM DEPTH
Mua ngay tại: [https://www.wsovn.net/mua-chung-zik-analytics](https://www.wsovn.net/mua-chung-zik-analytics)
Signals In React | Catching up with the latest trends
Tags: javascript, react, webdev, typescript
Published: 2023-12-23 18:19:34

It's intriguing to see that almost every JavaScript client framework has now implemented signals.

A pattern that was once deemed old and primitive has become the flagship feature of so many frameworks.

But it seems that the React team is still against the idea as they:
"don’t think it’s a great way to write UI code" as mentioned here:
{% embed https://twitter.com/acdlite/status/1626590880126889984?lang=en %}

But this doesn't mean all hope is lost. 
After exploring the `@preact/signals-react` package I've found that there are some incredible possibilities when it comes to using signals in React.

All of the drawbacks of using React state are gone!!

No more prop drilling or prev-callbacks and it even allows direct mutation of the signal value.

Unfortunately, though, that library doesn't integrate well with React's state-based ecosystem and even somehow managed to break React's internal rendering queues("Which I discovered a bit too late").

So I thought that I might have a go at building a signal-based state manager for React.

So after tons of experimentation and testing, I think it is finally ready to be shared.

Here is a very basic example:

```jsx
import { createSignal } from 'react-use-signals';

export const counterSignal = createSignal(0);

export const handleIncrement = () => {
  counterSignal.value += 1;
};

const Counter = () => {
  const count = counterSignal.useStateAdapter();

  return (
    <div>
      <p>Count: {count.value}</p>
      <button onClick={handleIncrement}>Increment</button>
    </div>
  );
};
```

And there are plenty more where that came from!!

There are more examples of how to use signals as a store, optimized rendering, selectors, and more.

Feel free to check it out on NPM:
https://www.npmjs.com/package/react-use-signals

And if you're looking for a detailed article on how they work:
https://medium.com/@personal.david.kohen/the-quest-for-signals-in-react-usestate-on-steroids-71eb9fc87c14

Any suggestions or feedback would be highly appreciated.
Mastering the While Loop in JavaScript
Tags: javascript, beginners, codenewbie, tutorial
Published: 2023-12-23 18:17:54

Introduction:
Every aspiring JavaScript developer must understand the while loop, a fundamental tool for handling repetitive tasks. This article aims to simplify the while loop, guiding you through its construction step by step.

Anatomy of a While Loop:
A while loop in JavaScript typically includes:

Condition: Determines how long the loop should run.

Loop Actions: The code that executes on each iteration.

Counter Update: Modifies the loop variable (if necessary).


Step-by-Step Guide to Constructing a While Loop:


```
// Step 1: Initialization Phase (Outside the Loop)
let i = 0;  // Initialize the loop counter or any necessary variables outside the loop.

// Step 2: Begin with the Keyword
while (

    // Step 3: Open Parentheses - this is done automatically by the syntax of the 'while' loop.

    // Step 4: Set the Condition
    i < 10  // The loop will continue to run as long as this condition is true. Here, it runs as long as 'i' is less than 10.

    // Step 5: Close Parentheses and Open Curly Braces - done automatically by the syntax.
) {

    // Step 6: Specify Loop Actions
    console.log(i);  // During each iteration, we'll print the current value of 'i' to the console.

    // Step 7: Update the Loop Counter
    i++  // After each iteration, increase the value of 'i' by 1.

    // Step 8: Close Curly Braces - will be done after specifying all the actions inside the loop.
}

```


Common Pitfalls and Tips:

Infinite Loops: The most common mistake is creating an infinite loop. Ensure that the loop condition will eventually become false.

Counter Management: If using a counter, initialize it before the loop and update it correctly within the loop.

Condition Relevance: Make sure the condition is relevant to the loop's purpose and changes appropriately with each iteration.

Conclusion:
The while loop is an essential element in JavaScript, offering a straightforward way to handle repetitive tasks. With practice, you'll gain proficiency in using while loops, enhancing your JavaScript programming skills. Experiment with different scenarios and see how while loops can simplify your code.

Questions or Further Discussion:
If you have any questions or would like an in-depth discussion on other JavaScript concepts, feel free to drop a comment. 

Also i appreciate my followers patience recently. I've been dedicated to building a full-stack e-commerce agency website, featuring custom templates developed in React & my freelance services i will be offering, secure PayPal payment integration, and reliable AWS storage solutions. This project is designed to offer mostly react websites for my potential customers. I'm excited about the upcoming launch and appreciate your support during this busy but rewarding time.

Stay tuned for more updates!
EKS Pod Identity AddOns
Tags: eks, kubernetes
Published: 2023-12-23 17:47:39

Recently a new EKS addons introduced an addon feature Pod Identities. Basically if the pod want to communicate with other AWS services it will happen through the IAM Roles for service account (IRSA) where the IAM role will be configured as service account and attached to pods and a switch happens between EKS and IAM. Now with Pod Identity addons we can provide granular permissions for the pods.

You can install the addons and verify if it is added to the cluster

`aws eks --region ap-south-1 list-addons --cluster-name demo`

```
{
    "addons": [
        "coredns",
        "eks-pod-identity-agent",
        "kube-proxy",
        "vpc-cni"
    ]
}
```
You can verify the addons running as daemonset in the cluster

`kubectl get daemonset -A`

```

NAMESPACE     NAME                     DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
kube-system   aws-node                 2         2         2       2            2           <none>          51m
kube-system   eks-pod-identity-agent   2         2         2       2            2           <none>          48m
kube-system   kube-proxy               2         2         2       2            2           <none>          51m


```



Let us break down and see how exactly it works, we will try to access S3 bucket from the pod using pod identity.

Step 1. Create test S3 bucket name `test-884`.
Step 2. Create an IAM role `pod-identity-s3-demo` choose trusted entity EKS and EKS pod identity.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fwfyfwcs6tn5hqdnzqc.png 
Step 3. Click next and you could see a trust policy added to the role 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t256uguecyap6gv7jf9n.png) 
Step 4. Click next and create the role.
Step 5. After creating a role we can add inline policy with the bucket name specified as below     
```
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "s3:GetObject",
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::test-884/*",
      "Sid": "PodIdentity"
    }
  ]
}
``` 
 ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7pz3ah18oi7poi2tw10w.png)
 
Step 6. Now associate the IAM role with the EKS pod by using the Pod Identity association, navigate to the eks cluster and access tab and click on  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/axgxour344i7cs93ghyb.png)
 
Step 7. You can specify the existing namespace and service account as below 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3jk333nk21whr83xw8p6.png)

step7: Finally create a pod with the service account and the pod get the temporary access to S3 bucket
HAVE YOU LOST YOUR FUNDS TO TRADING SCAM? - CONTACT DIGITAL WEB RECOVERY
Published: 2023-12-23 17:46:20

Phishing attacks are like Dementors in a world full of internet scammers, robbing unsuspecting victims of their lives. Nevertheless, Digital Web Recovery saved a client who was attacked in this manner. They were able to track down the stolen bitcoin and retrieve the money by using their tracking abilities together with a little bit of magical finesse. The hidden weapon of Digital Web Recovery is their capacity to conduct blockchain transactions as a legal investigation. They can follow the digital trail left by thieves by exploring the intricacies of the blockchain. By means of thorough analysis and proficient investigation, they can expose the network of deceit and locate the stolen bitcoin's original source. Technology magic is nothing new to these wizards. When an exchange is compromised, it can feel like the Gringotts vault doors have been thrown wide open. In one such case, Digital Web Recovery worked their magic to reclaim the funds that had been lost due to a security breach. Through their meticulous investigations and collaboration with the exchange, they managed to restore the stolen bitcoin to the rightful owners, turning a potential disaster into a triumph. Equipped with state-of-the-art instruments and software, they leverage data recovery's potential to uncover concealed details and retrieve misplaced bitcoin. When it comes to recovering money that appears to be lost in the digital void, their proficiency with these cutting-edge technology provides them an advantage. Digital Web Recovery collaborates together with regulatory organizations and law enforcement to bring justice to the world of bitcoin theft. They can guarantee that those responsible for the theft are held accountable and that the money that was taken is returned to its rightful owners by fusing their magic with the power of the law. Hurry now to save your coin before it gets too late. Contact Digital web recovery through: digitalwebrecovery(@)mail-me.com & Signal: +14033060588 Greetings.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ua3cud6j0jgyjcl6wqm0.jpg)
Funds Recovery
Published: 2023-12-23 17:43:34

I urge you to contact a professional hacker if you are a victim of a scam. I lost a huge sum of money to a crypto scammer who lured me to invest in what I later found out to be a scam, but the good news is that HACKWEST AT WRITEME DOT COM recovered all the money back to my blockchain wallet. The fraudster stole about $468k in USDT, BTC, Ethereum and Sol. I strongly recommend West and his team if you’re a victim of crypto scam.
How to make an API using FastAPI
Tags: fastapi, python, webdev, tutorial
Published: 2023-12-23 17:29:51

## Let’s see how we can create a basic API using the FastAPI framework.

First, make sure you have FastAPI and Uvicorn installed. You can install them using:

As the FastAPI documentation suggests you'll need Uvicorn and FastAPI installed you can do so by:

```python
pip install fastapi uvicorn[standard]
```

Now, let’s create a simple FastAPI application where we’ll be setting up our FastAPI app. Create a file named main.py:

```python
# main.py
from fastapi import FastAPI

app = FastAPI()
```
But that’s not all we’re just initializing our FastAPI instance, now we also need to setup something known as CORS (Cross-Origin Resource Sharing).

CORS is important when you want to allow your API to be accessed by web applications from different origins. Modify your main.py file.

```python
# main.py
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

# Configure CORS

origins = ["http://localhost", "http://localhost:3000", "https://yourfrontenddomain.com"]

app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)
```
Replace the allowed origins (origins) with the actual domains of your front-end applications. Or if you’re just testing your app on localhost then you might not need to change much…

Make an API.
```python
@app.get("/")
async def read_root():
    return {"message": "Hello, World!"}
```
Your file should look like this.
```python
# main.py
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

# Configure CORS

origins = ["http://localhost", "http://localhost:3000", "https://yourfrontenddomain.com"]

app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

@app.get("/")
async def read_root():
    return {"message": "Hello, World!"}
```
Call your API of endpoint /. But before that we’ll need to start running the server. Now use the Uvicorn to initiate the FastAPI server.
```python
uvicorn main:app --reload
```
This will start the FastAPI development server, and your API will be accessible at http://127.0.0.1:8000. The CORS middleware will allow requests from the specified origins.

You can access the API by opening your browser or using a tool like curl or Postman. For example, if you’re running it locally, open http://localhost:8000 in your browser, and you should see the “Hello, World!” message.

_Hope this was useful. Thanks for reading._
LET, CONST and TEMPORAL DEAD ZONE (TDZ);
Published: 2023-12-23 17:24:41

In JavaScript hoisting of variables declared with **“var”** is Popular and well known among JavaScript developers.

ES6 Came with two new keywords for variable declaration those are **“let”** and **“const”**, unlike **“var”** declaration the variables declared with **“let” **and **“const”** are not accessible before declaration,

```
console.log(name);
var name = "Shahid"; //undefined


console.log(name);
let name = "Shahid"; //Uncaught ReferenceError

```

Due to this many of developers were lead to the concept that **“let”** and **“const”** declaration are not hoisted.

**IS THIS CONCEPT TRUE ?**
To Understand the answer first you have to understand what Hoisting is?

**HOISTING:**
The allocation of memory to variable before exicuting a single line of code is called hoisting.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0q6xlk7w72tgosrrzn8s.png)

As you can se the variables declared with **“var”** and **“ let”** both are allocated memory and one which is declared with ** “var”** is stored in Global space while the one declared with **“let”** is stored in a seprate space.

Now You have got the answer that the concept (** “let”** and **“const”** declaration are not hoisted.”) is Incorrect.

**TEMPORAL DEAD ZONE (TDZ):**
If **“let”** and **“const” ** declaration are hoisted than why they are not accessible before their declaration? the answer of this depends on concept of TDZ.

“ Time period between Hoisting of a variable and Initializing it with value is Known as Temporal Dead Zone , TDZ”.

```
console.log(name);
//Temporal dead zone
//Temporal dead zone
//Temporal dead zone
//Temporal dead zone
//Temporal dead zone
//Temporal dead zone
//Temporal dead zone
//Temporal dead zone
let name = "Shahid";
```
Thanks For taking the time to explore this Article

originally published on medium
https://medium.com/@bugtimuhammadshahid1/let-const-and-temporal-dead-zone-tdz-f33225aee853

Lets Connect on LinkedIn

www.linkedin.com/in/muhammad-shahid-bugti-2a7b43276