teleren/devto huggingface dataset:
⚔️ Call to Adventure ⚔️
Tags: developer, cloud, whimsy
Published: 2024-02-04 01:02:18

---
title: ⚔️ Call to Adventure ⚔️
published: true
description: Going to take you on a whimsical ride.
tags: developer, cloud, whimsy
# cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9z9xbhoe4cmdm2k9s26y.jpeg
# Use a ratio of 100:42 for best results.
# published_at: 2024-03-15 00:11 +0000
---
![Bilbo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9z9xbhoe4cmdm2k9s26y.jpeg)

_Disheveled._
_Scared._
_Running in a panic._
_Nervous & yet dare I say gitty._

Greetings! Whether you have landed here intentionally or just came upon this from a random Google search, I appreciate your presence here.

As a quick introduction, the name is Patti. I've been knocking around in the tech industry as a frontend software engineer for a number of years, and more recently came to be into Cloud. 

Any project that melds art & technology, and a dash of whimsy, have always has always had a special place in my heart. This is meant to be a sandbox to exercise sharing that whimsy and if that is your jam, I would be thrilled to connect with you.

> “Go back?” he thought. “No good at all! Go sideways? Impossible! Go forward? Only thing to do! On we go!”
– Bilbo Baggins. Riddles in the Dark.
The Pitfalls of NEXT_PUBLIC_ Environment Variables
Tags: nextjs, react, typescript, javascript
Published: 2024-02-04 01:00:00

---
title: The Pitfalls of NEXT_PUBLIC_ Environment Variables
published: true
description: 
tags: nextjs, react, typescript, javascript
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-02-03 23:56 +0000
---

I ran into a tricky issue in my project where I was using this environment variable:
```
NEXT_PUBLIC_API_BASE_URL=https://~/api
```
This is the base URL for my API endpoints. Here's a super simplified version of how I used this variable:

```typescript

// In src/utils/env.ts
export const getApiBaseUrl = (): string => {
  if (!process.env.NEXT_PUBLIC_API_BASE_URL) {
    throw new Error("NEXT_PUBLIC_API_BASE_URL is undefined");
  }

  return process.env.NEXT_PUBLIC_API_BASE_URL;
};

// In the API call function
// This function is called in server components or server actions
export const getEventByUuidService = async (uuid: string): Promise<Event> => {
  try {
    const res = await fetch(`${getApiBaseUrl()}/event/${uuid}`, { cache: "no-store" });

    if (!res.ok) {
      throw new Error("Failed to get event by uuid");
    }

    return (await res.json()).data;
  } catch (error) {
    throw error;
  }
};
```

Everything worked fine until I deployed it to Vercel. Then, I got this error in the runtime log:
```
TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  cause: Error: connect ECONNREFUSED 127.0.0.1:3000
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
      at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:128:17) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 3000
  }
}
```
Checking Chrome's network tab, I noticed that the request that should have gone to /api/events/{uuid} was instead sent to /events. It looked like NEXT_PUBLIC_API_BASE_URL was being ignored.

So, I did some digging and found this piece in the official docs:

>To expose an environment variable to the browser, it must be prefixed with NEXT_PUBLIC_. However, these public environment variables will be inlined into the JavaScript bundle during the next build.

This means they can't be used on the server side, which I missed because my variable had the prefix.

After I dropped the NEXT_PUBLIC_ prefix, everything worked perfectly, no more errors.

So here is the conclusion.
- Only use the NEXT_PUBLIC_ prefix for environment variables that need to be accessible on the client side.
- For server side environment variables, skip the prefix.
Ibuprofeno.py💊| #44: Explica este código Python
Tags: python, learning, spanish, beginners
Published: 2024-02-04 00:49:12

## **<center>Explica este código Python</center>**
#### <center>**Dificultad:** <mark>Intermedio</mark></center>

```py
## Reto #43
lista_compras = ["huevos", "pan", "tomates", "leche"]
print(lista_compras[100:200:50]) # 🤔
```

👉 A. `IndexError`
👉 B. `SyntaxError`
👉 C. `["huevos", "pan", "tomates", "leche"]`
👉 D. `[]`

---

Respuesta en el primer comentario.
A Simple Guide on Migrating to React Query v5
Tags: react, nextjs, webdev, javascript
Published: 2024-02-04 00:34:34

**Introduction:**
React Query has revolutionized server-state management in React applications, and the recent release of version 5 takes it a step further with enhanced power and user-friendliness. If you're contemplating migrating from React Query v4 to v5, you've come to the right place. This guide will lead you through the process, detailing key changes and offering code snippets for a seamless transition.

**Introduction to React Query v5:**
React Query v5 introduces exciting features and improvements, focusing on API streamlining and enhanced usability. Some highlights include:
- Simplified Optimistic Updates
- Infinite Queries with maxPages
- Infinite Queries Prefetch Multiple Pages
- Fine-Grained Storage Persister
- Typesafe Query Options
- New Hooks for Suspense

While these additions make v5 an enticing upgrade, it's crucial to be aware of the breaking changes.

**Breaking Changes:**
- Hooks now have a Single Signature
- Callbacks on useQuery Removed
- RefetchInterval Callback Function Change

These changes simplify the interaction with queries, offering a more consistent API. Review the complete list of breaking changes in the [official migration guide](https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5).

**Migrating to React Query v5: A Step-by-Step Guide:**
Now, let's navigate the migration process step by step, providing code snippets for a smooth transition.

*Step 1: Install React Query v5*
Assuming npm usage, install the latest version of React Query (v5.18.1 at the time of writing) with the command:
```
npm i @tanstack/react-query@latest
```
Optional: For the updated React Query DevTools, use:
```
npm i @tanstack/react-query-devtools@latest
```

*Step 2: Fix Breaking Changes*
Manually address breaking changes or use the provided codemod for an automated update. Remember to run prettier and eslint for consistent code formatting.

**New Features in v5:**
Now that you've upgraded to v5 and addressed breaking changes, explore some new features:
- Simplified Optimistic Updates
- Infinite Queries with maxPages
- Infinite Queries Prefetch Multiple Pages
- New Hooks for Suspense

**Conclusion:**
Migrating to React Query v5 unlocks a world of possibilities, streamlining development. Despite breaking changes, the benefits outweigh the effort. Take your time, consult the migration guide, and use the codemod for a smoother process.

For more details, refer to the complete blog post on [BlueSockets](https://bluesockets.com/react/the-easiest-guide-on-migrating-to-react-query-v5/).
Effective Debugging Techniques in JavaScript
Tags: javascript, webdev, programming, tutorial
Published: 2024-02-04 00:31:59

## Introduction

Debugging is an essential aspect of software development, especially in JavaScript, which is known for its dynamic and complex nature. It is the process of identifying and resolving errors or bugs in a program. Effective debugging techniques can save developers time and effort and ultimately result in better functioning applications. In this article, we will discuss some of the most effective debugging techniques in JavaScript.

## Advantages

1. **Consistent Console Logging:** The console log is the most basic but powerful debugging tool. By logging messages to the browser console, developers can track the execution flow of their code and identify any unexpected behavior.

2. **Using Breakpoints:** Breakpoints allow developers to pause the execution of their code at a specific line and inspect the values of variables. This technique is helpful in pinpointing the exact location of a bug.

3. **Utilizing the Browser's Debugger:** Most modern browsers come with built-in debugging tools that offer a wealth of features such as step-by-step execution, code inspection, and error tracing.

## Disadvantages

1. **Inefficient Use of Console Logging:** While console logging is a useful tool, overusing it can clutter the console and make it challenging to identify relevant messages.

2. **Steep Learning Curve:** Debugging techniques in JavaScript require a certain level of expertise, and it can take some time for beginners to understand and effectively use them.

## Features

### Runtime and Syntax Error Handling

JavaScript has built-in error objects that can help developers handle runtime and syntax errors gracefully.

```javascript
try {
  // Code that may throw an error
} catch (error) {
  console.error("An error occurred:", error);
}
```

This code snippet demonstrates how to use try-catch blocks to handle exceptions and errors gracefully.

## Source Maps

Source maps can map the minified or transpiled code to the original source code, making it easier to debug in a production environment.

```javascript
{
  "version": 3,
  "file": "out.js",
  "sourceRoot": "",
  "sources": ["foo.js", "bar.js"],
  "names": ["src", "maps", "are", "fun"],
  "mappings": "AAgBC,SAAQ,CAAEA"
}
```

This JSON structure represents a simple source map that links the generated code (**out.js**) back to the original source files (**foo.js** and **bar.js**).

## Conclusion

Debugging is an integral part of the software development process, and mastering effective debugging techniques can greatly improve a developer's efficiency and productivity. By consistently utilizing tools like console logging, breakpoints, and browser debuggers, developers can easily identify and resolve errors in their code. However, it is essential to understand that debugging is a skill that takes time and practice to perfect, and it is always a work in progress.
When Was the Last Time You Felt Truly Alive?
Tags: discuss
Published: 2024-02-04 00:00:00

---
published_at : 2024-02-04 00:00 +0000
---
Recall times when you felt most alive. What were you doing, and how can you incorporate more of those activities into your life?
<br>
Follow the DEVteam for more discussions and online camaraderie! https://dev.to/devteam
AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Nowbv 
Tags: javascript, webdev, tutorial, react
Published: 2024-02-03 23:29:02

AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Now AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Now AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Now hgf
AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Now g
Tags: webdev, javascript, beginners, programming
Published: 2024-02-03 23:26:02

AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Now AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Now AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Now
AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Now 
Tags: webdev, javascript, beginners, programming
Published: 2024-02-03 23:23:40

AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Now AMP Credit Loan app customer. care helpline number Call ( 7870547053 ) ( 7866069405 ) Call Now
Phase-2-FlatIron
Published: 2024-01-27 18:17:00

The reason why phase-2 was impactful was because it allowed us to make our website still a one page application but allowed us to further practice our html, css, and javascript. 

At the very beginning hearing about React being able to have different components so I know what file does what individually allows any programmer/coder where there potential syntax error may lie because it tells you where specifically the error is coming from. Within React we learned about components, props, lists, keys, states and events. When learning javascript from phase-1 and further learning the skills within React I have used, understanding props and getting the information I need from the data I was working it. I felt more comfortable mapping throughout the objects or an array of objects I was working with. At first again I did struggle but then after practicing with different labs I was able to understand how to do the mapping and it made it a little bit easier because I went back and kept practicing what I was really struggling with. 

Unlike JavaScript having on j.s file we had components. When using coming and having the ability to know what components are doing what you can see whats happing within one file. The unique thing about working with react we have to create a state in the app and having to send props to different children’s and its parents in order to send functionality to different components. Doing this was very similar to callback functions to other components. Doing this does get tricky because the user has to understand how the tree of the component flows.

Towards the end of learning React we learned how to do routes so when the user presses on lets say the login feature, the about, products or cart depending what the website has it allows us to redirect the user to a different page on the application making it easier to pass information. Overall React is a great library for someone who knows Javascript because it allows the user flexibility’s.
Race condition em sistemas distribuídos
Tags: racecondition, rabbit, go
Published: 2024-02-03 23:06:48

## Cenário:

Temos um serviço de pagamento que consome dados de duas filas:

`clients-processor`: fila com dados de clientes para cadastrar
`payment-processor`: fila com dados de um pagamento para ser processado

Esse serviço processa os pagamentos, porém ele só processa pagamentos de clientes que estão cadastrados.

## Problema:

Como tratar o problema de race condition quando um evento de pagamento é recebido primeiro que o evento de cadastro de clientes (sem utilizar bancos de dados). Para simplificar mais temos a premissa que o evento de cadastro de cliente sempre será recebido.

## A solução:

`clients-processor`: Uma fila para evento de cadastro de clientes
`payment-processor`: Uma fila para evento de pagamentos
`payment-reprocessor`: Uma fila para reprocessar eventos de pagamentos utilizando o plugin [`delayed_message_exchange`](https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases) do RabbitMQ

Quando um evento de pagamento é recebido e o cliente ainda não está cadastrado, aumentamos o valor do `delay` da mensagem em `1 segundo`. A mensagem é então encaminhada para a fila de reprocessamento. Em algum momento, quando um cliente for efetivamente cadastrado, o pagamento correspondente será processado.

Para exemplificar melhor, o fluxo grama abaixo mostra a abordagem utilizada:

![Race condition](https://raw.githubusercontent.com/Sup3r-Us3r/race-condition/4cad415e4b7908ce49137d6feed7203cf0371a4e/.github/assets/race-condition.svg)

## Exemplo:

Crie uma aplicação com Golang + RabbitMQ para implementar toda abordagem comentada acima, você pode encontrá-la no meu [GitHub](https://github.com/Sup3r-Us3r/race-condition), e lá terá as instruções para rodar.

Para o exemplo, vamos enviar duas mensagens, uma com o pagamento e outra com o novo cliente.

Ao receber um pagamento de um cliente com o **ID 1**, o pagamento não vai ser processado, a mensagem é enviada para uma fila e o delay vai aumentando, até que a mensagem de cadastro do cliente é recebida, no proximo recebimento do pagamento ele será processado e a operação finaliza.

Vídeo da aplicação:

{% vimeo 909567763 %}

Bom é isso, espero que tenha gostado da estratégia, sobre a aplicação, a mesma foi escrita em Golang, mas mesmo que você não desenvolva com Go, é uma aplicação muito simples e acredito que não terá problema em entender o código.
How To Set the Style of a Button in html.
Tags: html, howto, coding
Published: 2024-02-03 22:49:52

This tutorial was suggested by @veshremyfan in my last tutorial, So shout out to him/her. Anyways, here's the tutorial.

Have you ever wondered why your HTML button looks so ugly? Do you ever wonder how to change how it looks? Well the answer to that question is probably yes. If no, I suggest you get off of this tutorial.
Anyways, and this tutorial I will teach you how to set the style of your button in HTML. You will learn what to do and what not to do when setting the style for your button in HTML.

1. What not to do: 
```html
<!DOCTYPE HTML>
<html>
  <head></head>
  <body>
    <style>
      <button>your text here</button> <!-- NEVER put a button inside of a style! -->
    </style>
  </body>
</html>
```
1. Solution:
```html
<!DOCTYPE HTML>
<html>
  <head></head>
  <body>
    <style>
      btn { <!-- change btn to the nickname for your div class. -->
         Backround-color
        }
    </style>
    <div class="btn">
      <!-- "class" gives a nickname for it's only child. "btn" is the nickname I gave for the button. You can choose any nickname for your text. -->
      <button>your text here</button>
    </div>
  </body>
</html>
```
Cash Box Loan Customer Care Number 7359064124
Tags: webdev, beginners
Published: 2024-02-03 22:49:05

Cash Box Loan Customer Care Number 7359064124

Cash Box Loan Customer Care Number 7359064124

Cash Box Loan Customer Care Number 7359064124


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2sm02zwhi1bxf7d3crl2.jpg)
Monthly Amazon Location Service Updates - 2024.01
Tags: amazonlocationservice, amplifygeo, amplify, amazonlocationserviceupdates
Published: 2024-02-03 22:39:53

![img](https://day-journal.com/memo/images/logo/aws/location-service.png)

### Monthly Amazon Location Service Updates - 2024.01

<br>

This is a summary of the January updates for Amazon Location Service.

<br>

## 2024.01 Updates

[Amazon Location Service now supports additional places content in Maps](https://aws.amazon.com/about-aws/whats-new/2024/01/amazon-location-service-places-content-maps/)
Store and other point information has been added to Esri Navigation style.

[Amazon Location Service launches CloudFormation support for API keys and resource management](https://aws.amazon.com/about-aws/whats-new/2024/01/amazon-location-service-cloudformation-keys-management/?nc1=h_ls)
API keys can now be managed in CloudFormation.

<br>

## Other Info

[Amazon Location Service Demo](https://location.aws.com)
Official Amazon Location Service demo.

[Amazon Location Service Developer Guide](https://docs.aws.amazon.com/location/latest/developerguide)
Official Amazon Location Service Documentation.

[AWS Geospatial](https://github.com/aws-geospatial)
Official AWS Geospatial samples.

[Amplify Geo Docs](https://docs.amplify.aws/lib/geo/getting-started/q/platform/js)
Official Amplify Geo Docs.

[amazon-location-service-starter](https://github.com/dayjournal/amazon-location-service-starter)
Build environment to get started with Amazon Location Service.

[dev.to](https://dev.to/dayjournal)
Articles on Amazon Location Service.

[tags - Amazon Location Service](https://day-journal.com/memo/tags/Amazon-Location-Service)
[tags - Try](https://day-journal.com/memo/tags/Try)
Notes on Amazon Location Service. (Japanese)

<br>

## Related Articles

{% link https://dev.to/aws-heroes/monthly-amazon-location-service-updates-202312-1abh %}
Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Tags: webdev, javascript, beginners, tutorial
Published: 2024-02-03 22:21:27

Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Tags: webdev, javascript, beginners, programming
Published: 2024-02-03 22:18:39

Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22gxhyv4hof0tjigthq8.jpg)
Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Tags: webdev, javascript, beginners, programming
Published: 2024-02-03 22:14:55

Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wozals0x0dx4m3cnzyor.jpg)
Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Tags: webdev, javascript, beginners, programming
Published: 2024-02-03 22:13:30


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n74e6nx5bz169lpbi4x1.jpg)Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Tags: javascript, beginners, tutorial, react
Published: 2024-02-03 22:08:35

Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Tags: webdev, javascript, beginners, programming
Published: 2024-02-03 22:07:35

Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Tags: webdev, beginners, javascript, programming
Published: 2024-02-03 21:57:26

Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Tags: webdev, javascript, tutorial, react
Published: 2024-02-03 21:55:00

Amp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact callAmp Credit LoAn Customer Care helpline number ( 7349064124 ))7349064124contact call
Amp Credit LoAn Customer Care Helpline Number☎️ //7349064124// call me now
Tags: javascript, webdev, beginners, programming
Published: 2024-02-03 21:47:31

Amp Credit LoAn Customer Care Helpline Number☎️➐➌➍➒⓪➏➍➊➋➍//7349064124// call me now Amp Credit LoAn Customer Care Helpline Number☎️➐➌➍➒⓪➏➍➊➋➍//7349064124// call me now Amp Credit LoAn Customer Care Helpline Number☎️➐➌➍➒⓪➏➍➊➋➍//7349064124// call me now
Amp Credit LoAn Customer Care Helpline Number☎️ //7349064124// call me now
Tags: webdev, beginners, react
Published: 2024-02-03 21:45:26

Amp Credit LoAn Customer Care Helpline Number☎️➐➌➍➒⓪➏➍➊➋➍//7349064124// call me now Amp Credit LoAn Customer Care Helpline Number☎️➐➌➍➒⓪➏➍➊➋➍//7349064124// call me now Amp Credit LoAn Customer Care Helpline Number☎️➐➌➍➒⓪➏➍➊➋➍//7349064124// call me now
Amp Credit LoAn Customer Care Helpline Number☎️ //7349064124// call me
Tags: javascript, programming, python, productivity
Published: 2024-02-03 21:44:42

Amp Credit LoAn Customer Care Helpline Number☎️➐➌➍➒⓪➏➍➊➋➍//7349064124// call me now Amp Credit LoAn Customer Care Helpline Number☎️➐➌➍➒⓪➏➍➊➋➍//7349064124// call me now Amp Credit LoAn Customer Care Helpline Number☎️➐➌➍➒⓪➏➍➊➋➍//7349064124// call me now the day of my life is not