teleren/devto huggingface dataset:
🚀Clean Code y Buenas Prácticas con JavaScript - Reglas del diseño simple
Tags: cleancode, javascript, buenasprácticas, vancorcodes
Published: 2023-12-03 19:19:28

Cuando hablamos de programación, no solo se trata de que funcione; también se trata de hacerlo de la manera más clara, eficiente y sostenible posible. Es por eso que adoptar principios de Clean Code y seguir buenas prácticas en JavaScript se vuelve esencial. Aquí te presentamos cuatro reglas del diseño simple que te ayudarán a elevar la calidad de tu código:

### 1. ✅ Código que pasa los test:

Una señal segura de un código bien diseñado es su capacidad para superar pruebas de manera consistente. Establecer test robustos no solo verifica la corrección de tu código, sino que también contribuye a la seguridad operativa. Un conjunto completo de buenos test proporciona una red de seguridad, asegurando que tu código funcione como se espera y reduciendo el riesgo de errores.

### 2. 🧠 Revela la intención del diseño:

El código debe ser como un libro abierto, revelando claramente la intención detrás de cada línea. Cuando alguien revisa tu código, no debería tener que adivinar qué estás tratando de lograr. Opta por nombres descriptivos para variables, funciones y métodos. Un código autoexplicativo no solo facilita la lectura y el mantenimiento, sino que también mejora la colaboración en equipos.

### 3. 🚫 Respeta el principio DRY: “don't repeat yourself”:

La repetición de código es un enemigo silencioso. Cada duplicación incrementa la posibilidad de errores y dificulta el mantenimiento. Siguiendo el principio DRY, evita repetir fragmentos de código. Abstrae funciones y utiliza la modularidad para compartir lógica común. Al hacerlo, no solo mejoras la coherencia, sino que también facilitas futuras modificaciones y actualizaciones.

### 4. 🧩 Menor número posible de elementos:

La simplicidad es clave. Divide tu código en funciones, cada una realizando una acción específica. Siguiendo el principio "una función = una acción", tu código se vuelve más comprensible y mantenible. Evita funciones abarrotadas que realizan múltiples tareas y busca la elegancia en la simplicidad. Cuantos menos elementos tenga tu código, más fácil será de entender y mantener.

Al adoptar estas reglas del diseño simple, no solo mejorarás la calidad de tu código, sino que también sentarás las bases para un desarrollo más eficiente y colaborativo. ¡A codificar de manera limpia y eficaz en JavaScript! 💻✨
Usando a propriedade CSS currentColor para contruir componentes extensíveis
Tags: programming, css, portugues
Published: 2023-12-03 18:57:26

_**Nota:** apenas traduzi o texto abaixo e postei aqui._

Antes, assista esse [vídeo](https://www.youtube.com/watch?v=DznpOT2T5AY).

No vídeo, Steve compartilha como você pode usar a propriedade CSS `currentColor` para que qualquer outra propriedade que use uma cor selecione o valor da `currentColor` do element que você está estilizando. Se nenhuma cor for definida, ele herdará esse valor da árvore DOM.

Por exemplo, digamos que temos dois elementos de texto explicativo.

```html
<div class="callout">
    Olá aí!
</div>

<div class="callout callout-danger">
    Atenção!
</div>
```

Queremos que o `.callout` standard tenha texto azul e uma borda azul, e o elemento `.callout-danger` tenha texto vermelho e uma borda vermelha.

Você pode estilizá-los assim:

```css
.callout {
    border: 1px solid #0074d9;
    color: #0074d9;
    margin-bottom: 1em;
    padding: 1em;
}

.callout-danger {
    border-color: #ff4136;
    color: #ff4136;
}
```

Em vez de especificar a mesma cor para a borda, podemos usar `currentColor`.

```css
.callout {
    border: 1px solid currentColor;
    color: #0074d9;
    margin-bottom: 1em;
    padding: 1em;
}
```

Então, em nosso elemento `.callout-danger`, podemos descartar a propriedade `border-color` porque ela herdará automaticamente esse valor da propriedade `color`.

```css
.callout {
    border: 1px solid currentColor;
    color: #0074d9;
    margin-bottom: 1em;
    padding: 1em;
}

.callout-danger {
    color: #ff4136;
}
```

## Fonte

Newsletter de [Go Make Things](https://gomakethings.com/)
Deploy cal.com on AWS
Published: 2023-12-03 18:39:10

Introduction:

CapRover is an open-source, easy-to-use platform that simplifies the deployment and management of web applications. When combined with Amazon Web Services (AWS) Elastic Compute Cloud (EC2), CapRover provides a powerful and scalable solution for hosting and deploying applications. In this article, we will guide you through the process of deploying applications with CapRover on AWS EC2.

Prerequisites:

    AWS Account: Ensure you have an active AWS account to access the EC2 services.

    AWS EC2 Instance: Launch an EC2 instance using the AWS Management Console.

    Domain Name: Have a registered domain name to associate with your CapRover deployment.

This [article](https://fuzzyblog.io/blog/caprover/2019/11/10/using-caprover-on-aws.html) provides an extensive guide on how to setup caprover on AWS. Once you have caprover running follow my guide on how to use Set up cal.com on caprover that i detailed [here](https://dev.to/smyja/deploy-on-calcom-on-digitalocean-26op).

### Conclusion
Setting up Cal.com is pretty easy once you have a VPS,and with a PAAS like caprover, it makes it even easier to have Cal.com running.
Crypto Theft Recovery: How to recover stolen cryptocurrency
Published: 2023-12-03 18:25:42

We've all heard the terrifying tales of individuals losing their hard-earned Bitcoin because they sent it to the incorrect wallet—a simple error. It's comparable to witnessing your money go into a black hole. But don't worry—Adware Recovery Specialist is ready to come to your rescue! In order to protect your digital assets, it is imperative that you comprehend the significance of Bitcoin recovery. Even highly experienced individuals may send Bitcoin to the incorrect wallet. Perhaps you copied and pasted something incorrectly, or you made a minor typo in the recipient's address. Sometimes, a malevolent third party intercepting your transaction or a phishing attempt are to blame. What matters is that, whatever the reason, you are left with a sinking sensation in the pit of your stomach and your Bitcoin is forfeited. Losing Bitcoin can be a costly mistake. Not only do you lose the actual value of the Bitcoin, but you also miss out on potential future gains. It's like accidentally setting fire to a pile of money – it's gone forever. The financial impact can be significant, causing stress and frustration. But don't despair! With the help of Adware Recovery Specialist, there is hope for reclaiming what was once lost. When Bitcoin is inadvertently transferred to the incorrect wallet, adwarerecoveryspecialist.expert, is a reliable resource that may assist users in getting their money back. Adware Recovery Specialist employs a systematic and efficient approach to recover your lost Bitcoin. Their expert team starts by analyzing the details of the transaction, including the sender, recipient, and any additional information you provide. They provide folks who are in the upsetting circumstance of losing or misplacing Bitcoin with a glimmer of hope thanks to their experience and cutting-edge equipment. For those who have made an expensive mistake and require some magic to retrieve their Bitcoin, Adware Recovery Specialist is the solution as you can contact them through email: ‪Adwarerecoveryspecialist@auctioneer.net  &  WhatsApp +1 (937) 500‑9144
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fp88jkx1sknwhy3t5y2z.jpg)
Usando o local storage a seu favor
Tags: javascript, api, typescript, programming
Published: 2023-12-03 18:25:14

Olá, imagine a seguinte situação, você tem que implementar os dados das taxas básicas do Brasil (Selic, CDB, IPCA, etc...) em uma dashboard, em algum momento você vai precisar bater em um endpoint externo. Chamar esse endpoint a cada carregamento dessa página não é uma opção...

Colocar em local storagem é uma ótima opção, mas para renovar esse item no local storage temos que ter um certo controle sobre esse item.

para isso em minha aplicação eu desenvolvi uma classe que fica responsável por colocar e recuperar itens do local storage.

Vamos ao código:

```
import CalendarTools from './calendarTools'

const LocalStorageTools = {
    storage: {
        getStorageItem: function(key) {
            const itemInStorage = localStorage.getItem(key)
            if (itemInStorage) {
                const itemParsed = JSON.parse(itemInStorage)
                const now = CalendarTools.getToday()
                if (now.getTime() < itemParsed.expiry) {
                    return itemParsed.value
                }
                this.removeStorageItems(key)
            }
            return null
        },
        setStorageItem: function(key, value, expireTimeMs) {
            const expiry = expireTimeMs ?? CalendarTools.threeHoursInMs()
            localStorage.setItem(key, JSON.stringify({
                value,
                expiry: CalendarTools.getToday().getTime() + expiry
            }))
        },
        removeStorageItems: function(...keys) {
            keys.forEach((key) => {
                localStorage.removeItem(key)
            })
        }
    }
}

export default LocalStorageTools
```

Vamos a explicação, como controle eu uso uma string que armazena o tempo que o item irá expirar, que sempre será o tempo atual somado com um tempo de expiração em ms, com isso, no local storage sempre teremos o item como objeto com dois atributos, um **expiry** e um **value**, que é onde vai ficar o que queremos armazenar.

Sendo assim a função de salvar o item em local storage vai ficar responsável por salvar no formato mencionado acima. A função de buscar vai ter que validar se o item está expirado, se não tiver devolve o atributo **value**, se tiver, retorna null e apaga o item do storage.

Com isso temos um cache em local storage para coisas simples como por exemplo esses dados das taxas, já que é algo que não muda toda hora e não queremos bater na API externa a todo momento.
ReactJs Course for Beginners
Tags: react, programming, tutorial, learning
Published: 2023-12-03 18:04:06

Exciting News: Our React Course is Now Live! 🚀



I'm thrilled to share some exciting news with you – [Melbite](https://melbite.com) in collaboration with progskill is highly anticipated to announce the [React course](https://progskill.com/courses/react-basics) which is now live on progskill website!

[Enroll Today](https://progskill.com/courses/react-basics)

 

Whether you're a beginner looking to kickstart your journey into React development or an experienced developer seeking to enhance your skills, progskill course has something for everyone.

 

🚀 **Course Highlights:**

- **Modern React Development**: Learn the latest features and best practices.
- **Comprehensive Modules**: From JSX to React Hooks, we've got you covered.
- **Expert Instruction**: Benefit from the expertise of a seasoned React developer.


🚀 **Special Launch Offer**: To celebrate the launch, we're offering free access to the course for the first 100 people.

[Enroll Today](https://progskill.com/courses/react-basics)

Join us on this exciting learning journey!

Happy coding!
HIRE THE MOST GUARANTEED BITCOIN RECOVERY EXPERT
Published: 2023-12-03 18:00:49

As a regular person who made Bitcoin investments back when they were barely noticeable in the financial world. After a few years, you can no longer access your valuable Bitcoin wallet. You begin to wonder if your hard-earned digital gold is lost forever as panic sets in. When it comes to Bitcoin recovery, one must navigate through a labyrinth of encryption and security measures that guard the digital currency. These protective layers, while essential for the safety of Bitcoin users, pose a significant challenge for recovery experts like Digital Web Recovery. Even Bitcoin exchanges aren't immune to the occasional heist. In comes Digital Web Recovery, cape flowing in the virtual breeze, ready to save the day. They lend their expertise to the exchange, employing their cutting-edge techniques to track down the stolen funds. Digital Web Recovery successfully recovers the stolen Bitcoin, regaining the exchange's trust and money because of their unmatched abilities and perseverance. This victory confirms their status as the go-to experts for all things Bitcoin retrieval and shows how successful their recovery techniques are. Digital Web Recovery, however, doesn't shy away from the legal complexities of the Bitcoin world. With their extensive knowledge and understanding of the legal landscape, they navigate the murky waters of legislation and jurisdiction, ensuring that their recovery methods remain compliant while still delivering exceptional results. For the purpose of recovering your lost Bitcoin, Digital Web Recovery uses an astounding variety of methods and resources. They cover every digital angle, from expert cryptographic analysis to cutting edge data recovery software. They truly are the magicians of the Bitcoin recovery world with their knowledge and abilities.  Digital Web Recovery shines brightly in a world where misplaced or pilfered Bitcoin can spell financial ruin or lost chances. They have successfully changed the game in the field of Bitcoin recovery with their unmatched knowledge, creative methods, and unshakable dedication to their clients. Contact info; digitalwebrecovery@)mail-me.com  & WhatsApp Number: +14033060588 Warm greetings.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xt4ck0ryfue7nv42k5a8.jpg)
HIRE THE MOST GUARANTEED BITCOIN RECOVERY EXPERT
Published: 2023-12-03 17:52:47

As a regular person who made Bitcoin investments back when they were barely noticeable in the financial world. After a few years, you can no longer access your valuable Bitcoin wallet. You begin to wonder if your hard-earned digital gold is lost forever as panic sets in. When it comes to Bitcoin recovery, one must navigate through a labyrinth of encryption and security measures that guard the digital currency. These protective layers, while essential for the safety of Bitcoin users, pose a significant challenge for recovery experts like Digital Web Recovery. Even Bitcoin exchanges aren't immune to the occasional heist. In comes Digital Web Recovery, cape flowing in the virtual breeze, ready to save the day. They lend their expertise to the exchange, employing their cutting-edge techniques to track down the stolen funds. Digital Web Recovery successfully recovers the stolen Bitcoin, regaining the exchange's trust and money because of their unmatched abilities and perseverance. This victory confirms their status as the go-to experts for all things Bitcoin retrieval and shows how successful their recovery techniques are. Digital Web Recovery, however, doesn't shy away from the legal complexities of the Bitcoin world. With their extensive knowledge and understanding of the legal landscape, they navigate the murky waters of legislation and jurisdiction, ensuring that their recovery methods remain compliant while still delivering exceptional results. For the purpose of recovering your lost Bitcoin, Digital Web Recovery uses an astounding variety of methods and resources. They cover every digital angle, from expert cryptographic analysis to cutting edge data recovery software. They truly are the magicians of the Bitcoin recovery world with their knowledge and abilities.  Digital Web Recovery shines brightly in a world where misplaced or pilfered Bitcoin can spell financial ruin or lost chances. They have successfully changed the game in the field of Bitcoin recovery with their unmatched knowledge, creative methods, and unshakable dedication to their clients. Contact info; digitalwebrecovery@)mail-me.com  & WhatsApp Number: +14033060588 Warm greetings.
Deploy on Cal.com on Hetzner
Published: 2023-12-03 17:14:32

In my previous article, i explained how to deploy cal.com on digitalocean using caprover.In this article, I'll explain how to do the same thing on hetzner.

Cal.com is an open source scheduling platform that enables you to take bookings on your own terms. Set your availability, connect your favorite calendar and video conferencing platforms, and share your link. It's that simple.

### What is Caprover
Caprover is an Opensource Platform as a service like Heroku that allows you deploy web apps on a vps, Caprover uses docker to manage this and issues free ssl certificates powered by letsencrypt.

Follow this [guide](https://community.hetzner.com/tutorials/install-caprover) i worked on to set caprover up on Hetzner.

Once you have caprover running, Follow the exact same steps i detailed in the digitalocean guide. Ensure you have your environment variables added.

### Conclusion
In this we have beenn able to deploy Cal.com on Hetzner using Caprover.
Pros and Cons of Remote Work
Tags: discuss, coding, programming, career
Published: 2023-12-03 17:08:57

As a person who works remotely for most of the month, I have observed some pros and cons of working remotely. I have listed them below.

## Pros of remote work:

- Flexibility: You can work anytime and from anywhere.
- Work Life Balance: You can spend time with your family and engage in activities which interest you.
- No Commute: You save time on travelling to and from work. You also save fuel and protect the planet from air pollution, noise pollution, etc. Plus you save money.
- More time: You have more time to work on yourself and your side hustles. 

## Cons of remote work:

- Procrastination: It is easy to procrastinate since no one is watching over you.
- No sense of community: You don't see your colleagues in person and might lose touch with them. You won't have a feeling of connection with your colleagues and peers.
- Isolation: You might feel isolated since no one is working around you, they are all working from their own homes. So you feel alone and unmotivated.

What are the pros and cons of remote work which you have experienced? Let us know in the comments!
Getting the IP Address of a Website in Python
Published: 2023-12-03 16:45:12


To check the IP address of a website in Python, you can use the `socket` library. The following code demonstrates how to obtain the IP address of a specified website and provides explanations for each step:

```python
import socket

def get_ip_address(domain):
    try:
        # Use socket.gethostbyname() to retrieve the IP address of the domain
        ip_address = socket.gethostbyname(domain)
        return ip_address
    except socket.error as e:
        # Handle any potential errors, such as an invalid domain
        return f"Error: {e}"

# Example usage:
website_domain = "www.codeswithpankaj.com"

# Call the get_ip_address function to get the IP address of the specified website
ip_address = get_ip_address(website_domain)

# Print the result
print(f"The IP address of {website_domain} is: {ip_address}")
```

#### Explanation:

1. **Importing the `socket` Module:**
   ```python
   import socket
   ```
   Import the `socket` module, which provides access to the low-level networking interface of the operating system.

2. **Defining the `get_ip_address` Function:**
   ```python
   def get_ip_address(domain):
   ```
   Define a function named `get_ip_address` that takes a domain name as its parameter.

3. **Using `socket.gethostbyname()`:**
   ```python
   try:
       ip_address = socket.gethostbyname(domain)
       return ip_address
   ```
   Inside the function, use the `socket.gethostbyname()` method to retrieve the IP address associated with the specified domain. This method translates a host name to its corresponding IP address.

4. **Handling Errors:**
   ```python
   except socket.error as e:
       return f"Error: {e}"
   ```
   Use a try-except block to catch any potential errors that may occur during the execution, such as an invalid domain. If an error occurs, return an error message.

5. **Example Usage:**
   ```python
   website_domain = "www.codeswithpankaj.com"
   ip_address = get_ip_address(website_domain)
   ```
   Replace the `website_domain` variable with the desired website's domain. Call the `get_ip_address` function to obtain the corresponding IP address.

6. **Print the Result:**
   ```python
   print(f"The IP address of {website_domain} is: {ip_address}")
   ```
   Print the obtained IP address of the specified website.

When you run this script, it will output the IP address of the specified website.

### [Download code](https://github.com/Pankaj-Str/Complete-Python-Mastery/tree/main/Tips%20and%20Trick)
Дорамы
Published: 2023-12-03 16:43:09

Дорамы, или корейские телесериалы, завоевали сердца зрителей по всему миру своей уникальной атмосферой, захватывающими сюжетами и прекрасными исполнениями актеров. Однако, для русскоязычных зрителей появилась возможность наслаждаться этим искусством в еще более привычной форме – с русской озвучкой.

Одной из главных привлекательных сторон дорам является их способность переносить зрителя в удивительный мир, наполненный любовью, дружбой и волнующими приключениями. Русская озвучка придает этим историям еще больше гармонии и близости, что открывает перед русскоязычной аудиторией новые грани эмоций.

Один из блестящих примеров успешного сочетания дорам и русской озвучки – дорама "Любовь напрокат". Эта история о том, как случайная встреча двух сердец, сначала даже не подозревающих о своих чувствах, приводит к настоящей любви. Русская озвучка придает героям особый колорит, раскрывая их души на новом уровне, что сделало этот сериал еще ближе и понятнее для русскоязычных зрителей.

Еще одним ярким примером является дорама "Она великолепна". Здесь русская озвучка подчеркивает тонкие нюансы отношений главных персонажей, создавая у зрителя ощущение, что он сам стал частью этой романтической истории. Благодаря профессионализму озвучивающих актеров, каждая эмоция передается точно и с трогательной искренностью.

Также следует упомянуть дораму "Любовь после свадьбы", которая, несмотря на свою кажущуюся обыденность, становится исключительной благодаря русской озвучке. Она привносит в этот рассказ о любви и семейных ценностях дополнительный шарм и делает его ближе к сердцу каждого зрителя.

Русская озвучка дорам стала настоящим подарком для любителей этого жанра, предоставляя возможность погрузиться в захватывающие истории без языкового барьера. Это не просто перевод слов, это новое воплощение эмоций и чувств, делающее просмотр дорам еще более насыщенным и увлекательным для русскоязычной аудитории. Русская озвучка - это магия, которая делает дорамы еще ближе и дорогими для нас. источник [дорамы с русской озвучкой](https://smotret-doramy.ru/)
Ingredients for World-Class Software - Experiences from Spotify, Riot Games, Microsoft and Ericsson
Tags: programming, softwareengineering, softwaredevelopment, software
Published: 2023-12-03 16:35:34

Are you curious about your craft and want to get better at building services, products and solutions using software? Then please join Erik Schön (hacker, software researcher, system engineer, product manager, engineering manager, executive, writer) on a journey from Hell’s Kitchen to MasterChefs — based on experiences from Steve Denning’s Learning Consortium where leading companies like Spotify, Riot Games, Microsoft and Ericsson share successes and failures during regular, global site visits with the mission to change the world of work. Check it out here: {% embed https://blog.stackademic.com/ingredients-for-world-class-software-9a2f7e4d1505 %}