teleren/devto huggingface dataset:
React's `lazy` with Typescript and named exports
Tags: react, reactnative, typescript
Published: 2023-11-14 21:48:55

The `lazy` function in React is a great way to keep your component tree pruned. An example is when your screen has modals that you show/hide depending on some conditions - maybe that modal is invisible until you need it - the user doesn't see it, but it still exists in your component tree, and if that modal is heavy, all of those its components are loaded into memory even if the user can't see any of them.

Example:

```typescript
<Modal
  isVisible={opened}
  onModalHide={onCancelPressed}
>
  {children}
</Modal>
```

What you can do is to lazily load Modal when you need to show it:

```typescript
const Modal = lazy(() => 
  import("../path/to/Modal")
);
```

However, you'll have to make sure that Modal is a default export. If it isn't a default export, your IDE will alert you to this error:

> TS2322 Property 'default' is missing in type 'typeof import("path/to/Modal")' but required in type '{ default: ComponentType<any>; }'.

Default exports might not be what you want. Sometimes default exports make searchability difficult, and your team might prefer named exports. In that case, you can do this: 

```typescript
const Modal = lazy(() => 
  import("../path/to/Modal")
  .then((module) => ({default: module.Modal})),
);
```

This then allows you not only to render the modal but also to only load it when needed:

```typescript
{ opened ? <Modal /> : null}
```

(Inspired by a YT Short by Cosden Solutions)
Painter Perth
Published: 2023-11-14 23:10:10

Painter Perth provides quality residential and commercial painting services around Perth. We provide our clients with all the range of painting services.

Our Perth painters have the best Perth Painters and we give you the top-notch painting service from residential Painting, House Painting, Commercial Painting, Internal Painting, External Painting, Pool Painting to Shipping Container Painting Services.

Painter Perth
25 Ashley Ave., Kewdale, Western Australia, 6105
Contact Number: 0412 691 750
https://www.painterperth.com/
Always Active
Tags: webdev, programming, javascript
Published: 2023-11-14 23:07:49

The internet(social media} has brought both good and bad to the human life we can all agree to that but the question now is has it brought more good than bad but you know you can control the good and bad if you are connected with the right plug for that and i can do just that for you if you are interested try and connect with Brillianthackers800@gmail.com, Whatsapp +14106350697, with the help this group of private investigators you will be receiving more good than bad from the internet.
I want to get feedback about my application. Where could I do that?
Tags: discuss
Published: 2023-11-14 22:23:00

Hi! I'm Pavel and I'm building an application where you could track expenses, subscriptions, and set limits by categories. I also have analytics, like (days to salary, money left for each category) and monthly reports as well (with the information by each category expenses).  The app is still in development and I'd be interested in sharing a link in the nearest feature, where people could join and play with it. Does anyone know a good place to do this? Maybe there are some websites for that are specific on this kind of things.
Information Architecture in UX design
Published: 2023-11-14 22:18:20

Information Architecture is the way you structure contents on your mobile app or website that makes it easier for users to navigate through the app, making it simple to understand and intuitive for the users.
In other words lA is likened to the blueprints of a building. It serves as a guide to all stakeholders involved and working on the building.

When designing your information Architecture, there are two things to consider.
1. Is it easy to understand and navigate?
2. Can it be improved on i.e new features be added to it in the near future? 

Before you start creating an IA,
1.  You need to know the elements it will consist of. You can start by writing a list of all the elements that are supposed to be contained in the app and group similar items together according to hierarchy

2. Take into consideration your wireframes because they are used to  visually present your IA to stakeholders and developers for easy understanding. You can use them to visualize how a certain screen or page will look like.

3. Always keep it simple and straight to the point. You don't want to overload your users with too many information at once.

4. Prioritize the contents on the app. You have to determine which contents you want closer to your users. You do not want your users to navigate to the log out page from the welcome page/home page.

5. Rely on user feedback through user testing to determine how user-friendly your IA is and how it can be improved for better user experience.

6. Always review your information Architecture regularly for possible improvements to keep up with lastest trends and user preferences. Take for example button and bulky phones are becoming a thing of the past and many mobile phone companies are embracing the new trend.

Don't forget the way you organize your app's contents is one of main factors in the success of your app. The importance of Information Architecture can not be overemphasized. 
Always remember to keep it simple, clear and easy to understand for optimum user experience and to serve as a guide to developers and stakeholders.


Additional Resources.
1.https://uxplanet.org/information-architecture-basics-for-designers-b5d43df62e20

2.https://careerfoundry.com/en/blog/ux-design/a-beginners-guide-to-information-architecture/
Is it possible to duplicate some websites code?
Tags: scraping, webdev, javascript, devops
Published: 2023-11-14 21:24:08

Hey guy,

I'm curious if it's possible to build a script which saves a whole Websites code and deploys it automatically afterwards on another server and different domain.

PS: for duplicating existing websites to another server
-> I don't want to include database connections and other APIs, since it isn't really possible.
A KubeCon Wrap Up, of sorts
Tags: kubecon
Published: 2023-11-14 21:22:00

Well, KubeCon North America 2024 is over and done with, and I thought I'd write a short recap of my time there. 

While the final attendance numbers aren't in yet, it's likely that there were between 7,000 and 8,000 attendees in Chicago the week of November 6th. That's a _lot_ of Kubernetes enthusiasts! And the weather could not have been better (I mean, for Chicago, in November). 

At the Otterize booth we were extremely busy too! On day one, November 7th, I personally was in the booth for 11 hours (some of that was booth setup). That's a long day. 

We had some *very* popular swag! The Otter was a huge hit, again, and we handed out about 600 of them over the course of the week. 
![The Otterize Otter plushie that we handed out](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wybkis7dcd8yj0wf0z9q.jpeg)
We also handed out several hundred T-Shirts and an uncountable number of Otterize stickers of various kinds. Ok, enough about the swag, how was the booth otherwise?

Well, we scanned over 450 badges (last I checked) and had some really interesting conversations with a lot of super interesting people. We gave over 100 demos (at least, I didn't count them all) to some very enthusiastic attendees and overall got some great feedback. 

A rundown of some numbers: 
- 600 otters given out
- 200+ T-shirts given out
- 36 new members joined our [Community](https://otrz.md/3QLMYFY)

I've done a lot of booth duty in my years in this business, and I can honestly say that this KubeCon NA Otterize booth was one of the most successful, fun, and productive booths I've ever done. 

It was, of course, due in large part to the amazing group of Otters that were there.


![Otters (Otterize employees) at the KubeCon Booth from left to right: David G. Simmons, Tomer Greenwald - CEO, Ori Shavit, Neha Varshneya, and Omri Shani. Not Pictured: Ori Shoshan, CTO](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xxbeuf68ehgvnnj76wgt.png)

I think we may have more fun than anyone though! 

If you didn't get a chance to stop by the booth and see us, please, join our [Community](https://otrz.md/3QLMYFY), ⭐️ us on [GitHub](https://github.com/otterize), and reach out to [set up a demo](https://otrz.md/47blrVm)!
Thumbs Up Milestone Badges! 👍
Tags: meta, design, badges, moderation
Published: 2023-11-14 21:18:33

We're back again with more badges! 🙌

These new ones are exclusive to [DEV Moderators](https://dev.to/community-moderation), and thus can only be earned by those with [Trusted Member](https://dev.to/trusted-member) or [Tag Mod](https://dev.to/tag-moderation) privileges.

So, without further adieu... 🥁

## Introducing Our Thumbs Up Milestone Streak Badges!


![A picture of all 6 Thumbs Up Milestone Badges next to each other.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/evv6d4djdoyd1km554w0.jpg)

**These badges are awarded for giving thumbs ups (👍) to a variety of posts across DEV.**

---

To be clear, each badge is awarded as folks reach the corresponding 👍 milestone — 100, 500, 1000, 5000, and 10,000. As noted before, this is a mod-exclusive badge and so can only be earned by those who are part of our team of moderators.

## Why did we create these badges? 

With these badges, our primary goal is to show some love to our most helpful DEV mods. In particular, we wanted to highlight those behind-the-scenes folks who assist us by promoting good content on DEV. 

Every time a DEV mod leaves a thumbs up on a post, it boosts that article's feature score. If several mods leave thumbs ups on an article, it becomes heavily weighted making it more likely to show up in folks' feeds and be discovered. We trust the wisdom of the mods to help us uplift the best content on DEV.

---

**NOTE: if you're a moderator hoping to earn these badges, we're taking into account all of your previous thumbs ups. So, if you've regularly been boosting content in this way, you'll be rewarded for your past activity.** 🙌

---

## Wrapping Up

And that's pretty much it!

![Several Girl Scouts geared up in their outfits, standing around and looking unamused. One Girl Scout is saying "Can we get our badges now?"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5pzeuht5ha67bqehd1q.gif)

If this is you ☝️, just keep on thumbsing up any good posts you come across and the badges will come. For those folks who are interested but aren't mods, take a look at our [Community Moderation page](https://dev.to/community-moderation) for more information about how we choose our moderators and consider applying to be a Tag Mod.

As always, we welcome your thoughts and feedback! If you have any ideas for badges that you think we should add or actions you feel would be worthy of rewarding, don't hesitate to share your thoughts in [this post](https://dev.to/devteam/explore-our-world-of-badges-influence-the-next-addition-1fnf).

**Cheers,
The DEV Team**
$10 Daily in Easy Home Copy-Paste Job!"
Tags: beginners, productivity, news, database
Published: 2023-11-14 21:11:33


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/97lg89alzgb0dbr79ngm.jpg)

$10 a day with easy copy-and-paste tasks! No advanced knowledge is needed. Produce revenue from home with ease. Simple tasks, flexible hours. Get started right now to start earning every day while working in comfort. Become one among the many prosperous earners with simple, convenient copy-and-paste tasks!"
Click Visit 
https://bit.ly/46aXmfU
Mastering ES6: Elevate Your Code to the Next Level! 🚀
Published: 2023-11-14 20:59:27


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

## String Interpolation
Much cleaner when concatenating many variables into a string.

```javascript
// Before
function getName(p) {
  return p.firstName + ' ' + p.lastName;
}

// After
function getName(p) {
  return `${p.firstName} ${p.lastName}`;
}
```

## Arrow Functions
A clean way to declare functions; they set up auto return.

```javascript
// Before
const getName = (p) => {
  return p.firstName + ' ' + p.lastName;
}

// After
const getName = (p) => `${p.firstName} ${p.lastName}`;
```

## Unary + Operator
A beautiful and elegant way of casting a string variable to a number.

```javascript
// Before
const handleChange = (e) => {
  setAge(parseInt(e.target.value));
}

// After
const handleChange = (e) => {
  setAge(Number(e.target.value));
}
```

## Conditional Ternary
Write less code by using this technique; they can even be nested.

```javascript
// Before
const hasFlags = (p) => {
  if (p.warnings || p.errors) {
    return true;
  } else {
    return false;
  }
}

// After
const hasFlags = (p) => p.warnings || p.errors ? true : false;
```

## Auto Return Functions
Save another line of code with this super clean technique.

```javascript
// Before
const hasFlags = (p) => {
  return p.warnings || p.errors;
}

// After
const hasFlags = (p) => p.warnings || p.errors;
```

## Auto Return Objects
Results in less code; wrap your object in brackets.

```javascript
// Before
const editedUsers = users.map(u => {
  return {
    ...u,
    status: u.age >= 18 && "18+"
  };
});

// After
const editedUsers = users.map(u => ({
  ...u,
  status: u.age >= 18 && "18+"
}));
```

## Check Length
In ES6/JS, "0" equates to "false" - therefore, checking if a length is "> 0" is redundant.

```javascript
// Before
const hasHistory = (p) => {
  return p.history.length > 0 ? true : false;
}

// After
const hasHistory = (p) => p.history.length ? true : false;
```

## Array Includes
In 99% of cases, both methods work perfectly and look clean.

```javascript
// Before
const filteredUsers = (term) => {
  return users.filter(u => u.name.indexOf(term) > -1);
}

// After
const filteredUsers = (term) => users.filter(u => u.name.includes(term));`



If you have any questions or need further assistance, feel free to reach out:

Website: otmane.tech
Email: elhaddajiotmane@gmail.com
LinkedIn: elhaddaji-otmane
Happy coding!
_Projeto Teste - Anos Luz em JS - Projeto - KellyR
Tags: codepen
Published: 2023-11-14 20:57:44

_Projeto Teste - Anos Luz em JS - Projeto - KellyR
Conversão de Anos Luz para Quilometros.  E uma mensagem especial para DAY que sonha em conhecer a lua de pertinho ;)

{% codepen https://codepen.io/KelRosicler/pen/xxMXOVZ %}
Resolve QuickBooks Error 7149 with Expert-Recommended Solutions
Tags: quickbooks, qb
Published: 2023-11-14 20:57:06

QuickBooks Error Code 7149, a runtime issue linked to damaged program or registry files, can lead to system crashes, especially during QuickBooks launch. The error prompts a message like "QuickBooks has encountered a problem and needs to close. We are sorry for the inconvenience." This disruption may stem from various causes, detailed below.

To address **[QuickBooks Error Code 7149](https://dataservicesolutions.com/blog/quickbooks-error-7149/)**, follow comprehensive troubleshooting steps outlined in this article. For further technical assistance, readers can contact the QuickBooks support team at **+1-(855)-955-1942**. Our adept QuickBooks professionals are ready to offer immediate assistance and guide users through resolution steps. For a more in-depth understanding, read the entire article.
Effective exception handling in browser and Node.js
Tags: node, browser, exceptions, errors
Published: 2023-11-14 20:35:27

Exceptions in code are common, and sometimes they sneak by, causing problems for users that we might not see right away. In this article, I'm going to show you how to catch these tricky errors. This is also how tools like [Sentry](https://sentry.io) or [WatchCat](https://watchcat.io) track and report them.

In javascript world, we deal with two main environments: **Node.js** running on servers and **browsers** running on users' devices. Each handles errors differently because of how they work.

## Catching exceptions in browser

In the browser, handling exceptions revolves around the `window.addEventListener` method. This technique involves listening for the "error" event at the window level:

```javascript
window.addEventListener("error", function (event) {
  console.error("Caught in browser:", event.message);
  // Additional error handling logic here
});
```

See: https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event

## Node.js exception handling

For Node.js, there is the `process.on` method. This approach is split into handling synchronous exceptions with `process.on("uncaughtException", ...)` and asynchronous promise rejections with `process.on("unhandledRejection", ...)`:

**Uncaught Exception Handling:**

```javascript
process.on("uncaughtException", error => {
  console.error("Caught in Node.js:", error);
  // Error logging and cleanup before a graceful shutdown
});
```

See: https://nodejs.org/api/process.html#event-uncaughtexception

**Unhandled Rejection Handling:**

```javascript
process.on("unhandledRejection", (reason, promise) => {
  console.error("Unhandled Rejection:", reason);
  // Handle the unfulfilled promise here
});
```

See: https://nodejs.org/api/process.html#event-unhandledrejection

In wrapping up, getting a handle on these error-catching methods for both browsers and Node.js can really make your web apps more solid and user-friendly. It's all about using the right approach for each environment to quickly catch and deal with those sneaky errors, improving our app's overall user experience.
Building Cross-Platform Desktop Apps with Electron: A Comprehensive Guide
Published: 2023-11-14 20:32:43





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

Electron has revolutionized desktop application development by enabling developers to use familiar web technologies like JavaScript, HTML, and CSS. In this post, we'll explore the power of Electron and walk through the process of creating cross-platform desktop apps.



## What is Electron?



Electron is an open-source framework developed by GitHub that allows you to build desktop applications using web technologies. It combines the Chromium rendering engine and Node.js, providing a seamless environment for creating feature-rich applications.



## Benefits of Electron:



- Cross-platform compatibility: Write once, run anywhere.

- Access to native APIs: Utilize system resources and features.

- Large developer community: Find support and resources easily.



## Getting Started:



1. **Install Node.js and npm:**

   Ensure you have Node.js and npm installed on your machine. You can download them from [nodejs.org](https://nodejs.org/).



2. **Initialize your project:**

   Create a new directory for your project and run `npm init` to set up your project.



3. **Install Electron:**

   Run `npm install electron` to install Electron as a dependency.



4. **Create your main file:**

   Create a main JavaScript file (e.g., `main.js`) to initialize your Electron app.



```javascript

const { app, BrowserWindow } = require('electron');



let mainWindow;



app.on('ready', () => {

  mainWindow = new BrowserWindow({ width: 800, height: 600 });

  mainWindow.loadFile('index.html');

});

```



5. **Create your HTML file:**

   Create an HTML file (e.g., `index.html`) to design the interface of your app.



```html

<!DOCTYPE html>

<html>

  <head>

    <title>Your Electron App</title>

  </head>

  <body>

    <h1>Hello Electron!</h1>

  </body>

</html>

```



6. **Run your app:**

   Add a start script to your `package.json` file: `"start": "electron main.js"`. Then, run `npm start` to launch your Electron app.



## Advanced Features:



Explore Electron's capabilities by integrating features like:



- **Electron API:**

  Use Electron's APIs to interact with the file system, system tray, and more.



- **Native Modules:**

  Leverage native modules to extend your app's functionality.



- **Packaging and Distribution:**

  Package your app for distribution on various platforms.



## Conclusion:



With Electron, building cross-platform desktop apps has never been easier. Its flexibility and extensive community support make it a powerful choice for developers. Start experimenting, and turn your web skills into powerful desktop applications!




If you have any questions or need further assistance, feel free to reach out:

- **Website:** [otmane.tech](https://otmane.tech)
- **Email:** elhaddajiotmane@gmail.com
- **LinkedIn:** [elhaddaji-otmane](https://ma.linkedin.com/in/elhaddaji-otmane)

Happy coding!
File upload to Azure Storage Blob using Node JS Application
Published: 2023-11-14 19:58:05

# File upload to Azure Storage Blob using Node JS Application

This is a simple Node.js project that allows you to fill a basic form and submit. On Submit action input variables are processed and stored as a Yaml file in an Azure Blob Storage.

## Getting Started

### Prerequisites

- Node.js installed on your machine. You can download it from [https://nodejs.org/](https://nodejs.org/).
- An Azure Storage Account. If you don't have one, you can create it in the [Azure Portal](https://portal.azure.com/).
- Update file `.env` and replace `AZURE_STORAGE_CONNECTION_STRING` with your Azure Storage Account connection string.

### Installation

1. Clone the repository:

    ```bash
    git clone https://github.com/skumaraz2k7/nodejs-azure-ad-group-project.git
    cd nodejs-azure-ad-group-project
    ```

2. Install dependencies:

    ```bash
    npm install
    ```

3. Run the application:

    ```bash
    node app.js
    ```

4. Visit [http://localhost:3000](http://localhost:3000) in your web browser to access the form.

## Usage

1. Open your web browser and navigate to [http://localhost:3000](http://localhost:3000).
2. Fill in the form with the required information (AD Group Name and Group Type).
3. Click the "Create Group" button to submit the form.
4. The form data will be saved to a `test.tfvars` file and uploaded to the specified Azure Storage Account container.

## Contributing

If you'd like to contribute to this project, please follow these guidelines:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Commit your changes and push them to your fork.
4. Create a pull request.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.