teleren/devto huggingface dataset:
Why Can't I Land a Programming Job Despite 3 Years of Experience? 🤔😱
Tags: webdev, beginners, discuss, frontend
Published: 2023-07-05 01:03:22

I am experiencing a hard time 😔 to find a job as a programmer and I don't know why. Let's see what I am doing wrong. 🤔

I have been programming for **3 years** ⏱️, I started in 2020. Since then, I have only got one "job" experience in a company. I used **colons** 📆 because it was more like a freelance job where every month I get a little pay 💰 but without a contract, so it is more like a freelance experience.

**Don't get me wrong** ❗, I have had a few freelance jobs, from landing pages to CRUD frontend apps, but nothing really amazing, just freelance jobs to buy some stuff, less than $300 💸.

People that I know, who know **less** than me about code, are getting their first job and I am really enjoying that. I am **very proud** 🙌, but I'd like to know why things happen, so I made comparisons with them.

# Let's take an example of one of my friends:

- He knows only a few JavaScript, HTML, and CSS, with nothing fancy.
- I have made a bunch of really good projects with complicated designs using frameworks, libraries, etc.

- His CV is literally two pages and is full of Udemy courses with nothing interesting and any experience.
- My CV is really user-friendly, and many people have told me that it looks nice.

My CV:
![jose latines curriculum full stack developer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ab1mid5gqkwnc948g0i.png)

- He does not have a portfolio.
- I have a really good-looking portfolio. 😎

[See portfolio](https://www.joselatines.com/)

![joselatines portfolio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/luj17zb55bd4wabqz4mu.png)

- He doesn't create content for social media.
- I create content for social media (Like this. 😉)
Follow me!

- He doesn't have a good LinkedIn profile.
- I think that I have a good LinkedIn profile.

[See my LinkedIn](https://www.linkedin.com/in/joselatines/)

I also send a bunch of CVs to any position, write on Discord communities, and send messages to recruiters on LinkedIn.

So, there are a bunch of reasons that make me think. Maybe he is luckier than me, and well... I cannot handle that, but I really want to know what I am doing wrong because I have to be doing something wrong for not getting any job in **3 years** ⌛.

I am **happy** 😃 that my friends are getting really good jobs, but I want to as well because I love programming, and just thinking of working on this makes me full of excitement and keeps me working.

So, my question for you is... What do you think I am doing wrong? What do you recommend to me? 😕🤔
O que um juninho entende sobre Clean Code
Tags: braziliandevs, codenewbie, cleancode
Published: 2023-07-04 23:29:50

Como um novato nessa área de programação, que mal sabe por onde começar em meio a tanta informação, deparei-me com um termo muito comum nos requisitos de emprego: o famoso "Clean code". Então, de forma simples, o que um iniciante como eu pode fazer para entender algo que parece tão confuso, já que durante os cursos raramente nos deparamos com os problemas que essa metodologia visa resolver? Mas vamos lá, primeiro precisamos entender o que é esse tal "maldito" Clean code e por que as empresas enfatizam tanto a necessidade de conhecê-lo, pelo menos o básico, para começar.


![Clean Soap Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v4lm5cvudep1sjg43r9w.jpeg)

Basicamente, o Clean code é um "estilo" de programação que visa manter a legibilidade, simplicidade e manutenibilidade do nosso código. Mas como podemos alcançar isso?

**Legibilidade**
Aqui entra a escolha de variáveis que sejam claras e descritivas. Por exemplo, em vez de nomear uma variável para definir a altura como 'a', por que não simplesmente escrever 'altura'? No entanto, a legibilidade não se limita apenas a essas variáveis. Escrever um código cheio de ternários que ninguém consegue entender será mais claro do que um 'if' ou 'else'? A legibilidade está intimamente ligada à simplicidade!

**Simplicidade**
Modularize seu código e evite criar abstrações complexas. Por que complicar, meu chapa? A vida é simples e direta. Sempre que possível, mantenha seu código simples para que outras pessoas possam entender e dar manutenção. Quanto menos comentários forem necessários para explicar suas soluções temporárias, mais legível seu código ficará. Eu entendo que, como iniciante, pode ser difícil refatorar e simplificar o código, mas à medida que você tenta, com o tempo, vai melhorando.

**Testabilidade**
No início, pensar em todos os casos de uso para testar pode ser cansativo, não é mesmo? Eu entendo. Mas lembre-se de que, quanto mais modular for seu código, mais testável ele será. Se você puder dividi-lo em partes menores, os testes se tornarão mais simples. Faça uma pesquisa e aprenda como implementar casos de uso. Isso facilitará muito o entendimento de como um código bem dividido é benéfico para a manutenção do produto. (Se você programa no VSCode, procure pela extensão CodiumAI. Ela é muito útil para realizar testes básicos em métodos ou classes! Mas use-a com cuidado, para entender o propósito dos testes e ter uma direção sobre o que precisa ser testado. Quanto mais você souber sobre as regras de negócio do que está desenvolvendo, mais fácil será.)

Para concluir, aproveite e leia o livro Clean code. É ótimo para quem está começando na área. Talvez seja um pouco difícil entender os conceitos no início, mas quando você estiver envolvido em um projeto, tudo fará mais sentido.

Agradeço a todos que leram até aqui. Se você é um desenvolvedor mais experiente e quiser acrescentar algo, fique à vontade. Se achar que falei besteira, também não tem problema. O que importa é nossa evolução, e todas as opiniões são bem-vindas!
Generate Random Password in Laravel
Tags: php, laravel, backend
Published: 2023-07-04 22:24:14

---
title: Generate Random Password in Laravel
published: true
description: The `password()` helper generates a secure password that is 32 characters long by default.  
tags: php, laravel, backend
# published_at: 2023-07-04 21:47 +0000
---


In Laravel, you can generate a random password using the `password()` helper function provided by the `Illuminate\Support\Str` class. 

This function generates a secure password that is 32 characters long by default.

To use this function, you need to import the `Illuminate\Support\Str` class at the top of your PHP file:

```php
use Illuminate\Support\Str;
```

Once you have imported the `Str` class, you can call the `password()` method to generate a random password:

```php
$password = Str::password();
```

By default, the generated password will be 32 characters long and will include letters, numbers, and symbols. However, you can customize the behavior of the `password()` function by passing in up to five parameters:

1. **Length**: This parameter specifies the length of the password you want to generate. By default, the length is set to 32 characters.

2. **Letters**: This parameter determines whether or not to include letters in the generated password. By default, letters are included.

3. **Numbers**: This parameter determines whether or not to include numbers in the generated password. By default, numbers are included.

4. **Symbols**: This parameter determines whether or not to include symbols in the generated password. By default, symbols are included.

5. **Spaces**: This parameter determines whether or not to include spaces in the generated password. By default, spaces are not included.

You can customize the behavior of the `password()` function by passing in the desired values for each of these parameters.

For example, if you want to generate a password that is 16 characters long and only includes letters and numbers, you can call the `password()` function like this:

```php
$password = Str::password(16, true, true, false, false);
```

This will generate a random password that is 16 characters long and includes only letters and numbers.

Function accept first parameter as Integer and other parameters as boolean Which mean you can use true or false to include it to your returned result.
Using an ORM over writing raw SQL queries ...
Tags: webdev, python, django
Published: 2023-07-04 21:54:24

I hear strong opinions among developers for both ways of working with relational database.

Common reasons in favour of raw SQL:
- We can optimise queries for performance. ORMs can be limited in ways they can be customised, and writing raw SQL allows more control over the craft.
- We have less overhead. ORM, which stands for object-relational mapping, creates an object (like a Python object) for each of the database records. This additional processing time in object creation can become significant, particularly for queries with large result sets.

These are the main technical reasons. However, I think there is a reluctance among developers who have already mastered the craft of SQL to adopt ORMs. As someone who started their programming career writing PL/SQL, I was skeptical when I first encountered an ORM. I wasn't willing to surrender the joy of meticulously crafting the perfect SQL and let ORM do all the work.

Nevertheless, my perspective on ORMs has evolved. I have realised they are useful abstractions. They help in effective software development. ORMs give us minimal context switching between our chosen programming language and SQL.

I observed that, even with less control over fine-tuning, I could write code more succinctly. I also reused my code conveniently, which meant that I developed software faster. On Django web framework's ORM, I use it's Manager and QuerySet classes to chain SQL clauses, reuse methods across the codebase, work well with other aspects like pagination or authorization. Additionally, auto-generated database migration files are wonderful.

That being said, it does not mean that I can disregard SQL. Like any other tool, an ORM's effectiveness depends on how I use it. It's easy to unwittingly write ORM queries that result in unseen queries or fetch large amounts of data. For more complex use cases, having full control over the executed queries is crucial.

ORM serves as an abstraction. We use abstractions all the time in software. SQL is also an abstraction over the internals of a database. Sometimes we build our own abstractions and sometimes it makes more sense to use existing ones.

As Joel Spolsky stated in his "law of leaky abstractions" all non-trivial abstractions are leaky. When such leaks occur in my ORM, I will be prepared to put on my SQL plumbing hat.
CryptoJobster - Find crypto jobs in web3 and blockchain companies
Tags: cryptocurrency, blockchain, jobs
Published: 2023-07-04 21:49:08

At CryptoJobster, we believe that blockchain technology is the world's future. That's why we are dedicated to curating the best new blockchain jobs available at leading companies and startups utilizing this technology.

If you are passionate about blockchain and want to work at industry-leading companies and startups, we invite you to explore our job board and apply for positions that align with your interests.

[https://cryptojobster.com](https://cryptojobster.com)
Every language is like a god
Tags: language, watercooler
Published: 2023-07-03 16:53:51

My first post. A philological one. After this, I go PHP/Laravel. 

## What is a language?

Any language, is it human or programming, have some things in common. Attention. Effort. 

Is it Spanish you are learning. Or JavaScript. There is not much of a difference. The more time you put in it, the higher the probability you will learn it. The better the end result. 

## Is a language a god?

Yes, with small 'g'. Because there are so many. I speak 4 languages more or less fluently. I program 4 languages. The path to get there is very similar. 

At first you don't understand squat. Isn't it? _It sounds like Chinese to me._

Nobody is born with a laptop and a degree in computer science into their lap. 

## So where should I start?

The beauty is: anywhere you want. Unless you are forced to. Learning a new language is easier if it is something you **really** want to learn. 

Some people, and we all know some, are simply not suitable to become programmers. They probably think we are crazy to put so much time in coding. If we even share our daily occupancy with them. (Which is fine)

## How to convince yourselves?

To our time? Effort? Income? Simple: the outcome. The satisfaction that thousands, if not, millions of people will enjoy our work.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/29dwblb96lzl2ctufiad.png)
Desplegando un proyectos en multiples frameworks SPA en AWS Amplify y múltiples ambientes - Parte 2: ReactJs
Published: 2023-07-04 21:12:05

AWS Amplify es una serie de herramientas y servicios que puede ayudar a los desarrolladores web y móviles a crear aplicaciones escalables y completas. AWS Amplify facilita el despliegue y la actualización de aplicaciones web, incluyendo aplicaciones React creadas con TypeScript. En este artículo, aprenderás cómo desplegar una aplicación React con TypeScript en AWS Amplify con múltiples ambientes a través del comando de construcción y cómo conectarlo con GitHub para la integración continua y la entrega (CI/CD).

Antes de comenzar, debes tener un proyecto de React creado con TypeScript y subido a un repositorio de GitHub. También necesitas una cuenta de AWS y debes haber configurado AWS Amplify.

### 1. Conectar tu repositorio de GitHub con AWS Amplify

1. Inicia sesión en tu consola de AWS y ve a AWS Amplify.
2. Haz clic en 'Connect App'.
3. Selecciona 'GitHub' como el proveedor de repositorio.
4. Autentica tu cuenta de GitHub y selecciona el repositorio y la rama que deseas conectar. 

### 2. Configuración del entorno de compilación

Aquí es donde especificamos el comando de compilación dependiendo de la rama que se despliega. Para hacer esto, necesitas crear un archivo `amplify.yml` en la raíz de tu repositorio. Este archivo debe tener un contenido similar al siguiente:

```yml
version: 1
backend:
  phases:
    build:
      commands:
        - '# No Backend'
frontend:
  phases:
    preBuild:
      commands:
        - if [ "${AWS_BRANCH}" = "master" ]; then npm install && npm run build:prod; fi
        - if [ "${AWS_BRANCH}" = "dev" ]; then npm install && npm run build:dev; fi
    build:
      commands:
        - '# No build commands'
  artifacts:
    baseDirectory: build
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*
```

En este ejemplo, si la rama es "master", se ejecutará el comando `npm run build:prod` y si la rama es "dev", se ejecutará el comando `npm run build:dev`.

### 3. Crear múltiples ambientes

Ahora, tienes que configurar diferentes entornos en AWS Amplify. Puedes hacer esto desde la consola de AWS Amplify:

1. Ve a tu aplicación en AWS Amplify.
2. Haz clic en 'All apps', luego en tu aplicación y finalmente en 'Backend environments'.
3. Haz clic en 'Add environment' y sigue las instrucciones para crear un nuevo entorno.

### 4. Asignar un dominio personalizado

Para asignar un dominio personalizado a tu aplicación:

1. Navega a tu aplicación en AWS Amplify y haz clic en 'Domain management' en el menú de la izquierda.
2. Haz clic en 'Add domain' y sigue las instrucciones para agregar tu dominio personalizado.
3. Después de agregar tu dominio, puedes configurar las rutas a tus diferentes entornos.

¡Y eso es todo! Ahora deberías ser capaz de desplegar tu proyecto de React con TypeScript en AWS Amplify con múltiples ambientes, utilizando diferentes comandos de compilación dependiendo de la rama que se despliegue, todo

 conectado con GitHub para CI/CD. Además, también puedes asignar un dominio personalizado a tu aplicación.
Desplegando proyectos en multiples frameworks SSR en AWS Amplify y múltiples ambientes - Parte 2: Gastby
Published: 2023-07-04 21:07:39

AWS Amplify es una herramienta de desarrollo que permite crear y desplegar aplicaciones móviles y web en la nube. En esta guía, desplegaremos un proyecto Gatsby en AWS Amplify con múltiples ambientes, cambiando el script de ejecución según la rama que se despliega. Para nuestro escenario, utilizaremos la integración con GitHub.

## Requisitos Previos

1. Una cuenta de AWS.
2. Un repositorio GitHub con un proyecto Gatsby.
3. Un dominio personalizado.

## Crear un App en AWS Amplify

1. Inicia sesión en tu cuenta de AWS y ve a la consola de AWS Amplify.
2. Haz clic en "Connect app" y luego selecciona "GitHub" como tu proveedor de repositorio.
3. En la pantalla de autorización de GitHub, proporciona las credenciales y selecciona el repositorio y la rama de tu proyecto Gatsby.

## Configurar el Build Spec de Amplify

El archivo `amplify.yml` se usa para definir cómo AWS Amplify construye y despliega tu aplicación. Aquí es donde podemos definir diferentes scripts de compilación para diferentes ramas.

En la raíz de tu proyecto, crea un archivo llamado `amplify.yml` con el siguiente contenido:

```yml
version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - 'case $AWS_BRANCH in 
            "main") 
              npm run build:prod 
              ;; 
            "develop") 
              npm run build:dev 
              ;; 
            *) 
              npm run build:prod 
              ;; 
           esac'
  artifacts:
    baseDirectory: public
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*
```

Este archivo `amplify.yml` ejecuta diferentes comandos de compilación en función de la rama que se está desplegando. Asegúrate de tener definidos estos scripts en tu `package.json`.

## Crear Múltiples Ambientes

1. En la consola de AWS Amplify, selecciona la aplicación que acabas de crear.
2. Haz clic en "Branches" en el panel izquierdo.
3. Haz clic en "Connect branch" para conectar una nueva rama.
4. Sigue los mismos pasos que usaste para conectar tu rama principal, pero esta vez selecciona tu rama de desarrollo.

Cada rama que conectes en AWS Amplify será tratada como un entorno separado. AWS Amplify creará una URL única para cada ambiente, permitiéndote tener una versión separada de tu aplicación para cada rama.

## Apuntar un Dominio Personalizado

1. En la consola de AWS Amplify, selecciona tu aplicación.
2. Haz clic en "Domain management" en el panel izquierdo.
3. Haz clic en "Add domain" y sigue los pasos para agregar tu dominio personalizado.
4. Una vez que hayas agregado tu dominio, puedes configurar el mapeo de rutas para apuntar diferentes subdominios a diferentes ambientes.

Con esto, tienes configurado un despliegue de múltiples ambientes para tu proyecto Gatsby en AWS Amplify. La integración con GitHub permite que cada cambio de código en tus ramas desencadene un nuevo despl

iegue automáticamente, haciendo que la actualización y el mantenimiento de tus aplicaciones sean fluidos y eficientes.
JavaScript's Immutable Arrays Revolution.
Tags: javascript, programming, news, webdev
Published: 2023-07-04 20:49:10

Javascript introduced the powerful feature of changing elements, sort,reverse and splice arrays without changing the original, thus giving it immutability. 

Four new methods allow you to change arrays without having to create a copy first.

The new methods are:

## 1. with()
`with()` method creates a copy and allows changing the value at a specific **index**. It produces a new array where the element at the specified index is replaced by the provided value.

```javascript
const arr = ["I", "B", "R", "A", "H", "I", "M"];
console.log(arr.with(2, "b")); // ["I", "B", "b", "A", "H", "I", "M"]
// replace the second index with the provided value "b"
console.log(arr); // ["I", "B", "R", "A", "H", "I", "M"];
```

## 2. toSorted()
`toSorted()` method returns a brand new array, and the elements in that array are arranged in ascending order.

```javascript
const arr = ["I", "B", "R", "A", "H", "I", "M"];
console.log(arr.toSorted()); // ['A', 'B', 'H', 'I', 'I', 'M', 'R']
console.log(arr); // ["I", "B", "R", "A", "H", "I", "M"];


const numbers = [1, 10, 21, 2];
console.log(numbers.toSorted((a, b) => a - b)) //[1, 2, 10, 21]
```

## 3. toReversed()
`toReversed()` method returns a new array with the elements in reversed order.

```javascript
const arr = ["I", "B", "R", "A", "H", "I", "M"];
console.log(arr.toReversed()); // ['M', 'I', 'H', 'A', 'R', 'B', 'I']

const numbers = [1, 10, 21, 2];
console.log(numbers.toReversed()) //[2, 21, 10, 1]
```

## 4. toSpliced()
`toSpliced()` method returns a new array with some elements removed and/or replaced at a given index.

```javascript
const arr = ["I", "B", "R", "A", "H", "I", "M"];
console.log(arr.toSpliced(3, 3, "BAG")); // ['I', 'B', 'R', 'BAG', 'M']

const months = ["Jan", "Mar", "Apr", "May"];
console.log(months.toSpliced(1, 0, "Feb")) // ["Jan", "Feb", "Mar", "Apr", "May"]

```

No need to create a copy of an array with `[...arr]` first before modifying it.
Problem with react-native-ble-plx library when receiving data
Tags: reactnative, ble, javascript
Published: 2023-07-04 20:28:56

I have a problem with my react native app when receiving data, since I cannot see the complete message that is sent to me, I can only see a part of the message, this is not a problem of where the message is sent since I can see in another app and if the complete message is sent.

I want to know if there is any type of additional configuration to be able to receive the complete message

I put the part of the code where I receive the data

```
  //Connect the device and start monitoring characteristics
  async function connectDevice(device) {
    
    device
      .connect()
      .then(device => {
        setConnectedDevice(device);
        setIsConnected(true);
        return device.discoverAllServicesAndCharacteristics();
      })
      .then(device => {
        //  Set what to do when DC is detected
        BLTManager.onDeviceDisconnected(device.id, (error, device) => {
          
          setIsConnected(false);
        });

        //Read inital values
        //Message
        device
          .readCharacteristicForService(SERVICE_UUID, MESSAGE_UUID)
          .then(valenc => {
            setMessage(base64.decode(valenc?.value));
          });

          //monitor values and tell what to do when receiving an update
          const MAX_MESSAGES = 11; // Número máximo de mensajes a almacenar
          const messages = {}; // Diccionario para almacenar los mensajes recibidos
          let currentIndex = 0; // Índice actual en el diccionario
          //Message
          device.monitorCharacteristicForService(
            SERVICE_UUID,
            MESSAGE_UUID,
            (error, characteristic) => {
              if (characteristic?.value != null) {
                const decodedMessage = base64.decode(characteristic?.value);

                messages[currentIndex] = decodedMessage; // Almacenar el mensaje en el diccionario
                currentIndex = (currentIndex + 1) % MAX_MESSAGES; // Actualizar el índice circularmente
                
                setVolt(messages[0]);
                setFre(messages[1]);
                setFac(messages[2]);
                setRLC1(messages[3]);
                setCor(messages[4]);
                setPot(messages[5]);
                setPRea(messages[6]);
                setPApa(messages[7]);
                setEAct(messages[8]);
                setERea(messages[9]);
                setT(messages[10]);
  
              }
            },
            'messagetransaction',
          );
      });
  }
```

Since I can't see the whole message, the solution of my code is to send it divided into 11 parts and in code to separate the data and put it in the corresponding place, but I want to know if there is any way to receive a single long message with all content