Show number of tests executed and passed in SonarQube with Jest, Vitest and Pytest

Show number of tests executed and passed in SonarQube with Jest, Vitest and Pytest

Tiempo de lectura: 2 minutos Today we are going to learn how to pass and display the number of tests that have been covered in SonarQube. For React with Vite: First, we install: npm install -D vitest-sonar-reporter Now, we go to the vitest.config.ts We add: html reporters: [‘default’, ‘vitest-sonar-reporter’], // JUnit reporter to generate test reports outputFile: ‘test-results/test-results.xml’, // XML … Read more

Function for changing the brightness on a OLED screen from an Arduino 96 in (inches) display (SSD1306)

Function for changing the brightness on a OLED screen from an Arduino 96 in (inches) display (SSD1306)

Tiempo de lectura: < 1 minuto We bring you a function that allows to reduce the brightness of the OLED SSD1306 screen connected to our Arduino. We add this code using the Adafruit library: adafruit/Adafruit SSD1306@^2.5.7 adafruit/Adafruit GFX Library@^1.11.9 We create this function: void OledDisplay::brightness(uint8_t level) {     display.ssd1306_command(SSD1306_SETCONTRAST);     display.ssd1306_command(level); } We can add values in the range: 0-255 For level = 255, all … Read more

Sending data from a WordPress post to a webhook upon post publication

Sending data from a WordPress post to a webhook upon post publication

Tiempo de lectura: 2 minutos Today we’re going to see how we can send data from WordPress to a webhook when a publication is made. The first thing we’ll do is install the plugin called Code Snippet, which allows us to add code. We are adding new code: add_action(‘transition_post_status’, ‘enviar_a_a_webhook’, 10, 3); function enviar_a_webhook($new_status, $old_status, $post) { // Verificar que … Read more

How to Change the Version of Kotlin using Expo React Native

How to Change the Version of Kotlin using Expo React Native

Tiempo de lectura: < 1 minuto We will today learn how to change the Kotlin version used in Expo. First, we need to install expo-build-properties, which will allow us to edit native project properties without modifying anything in the android folder. html npm run expo install expo-build-properties And then we modified inside our app.json and could add the kotlinVersion:

Fixing error: Text content does not match server-rendered HTML in Next.js

Fixing error: Text content does not match server-rendered HTML in Next.js

Tiempo de lectura: < 1 minuto Today we are going to fix the common error that may occur when implementing i18n in our React environment with Next.js. This is the error: Unhandled Runtime Error Error: Text content does not match server-rendered HTML. Warning: Text content did not match. Server: “” Client: “” See more info here: https://nextjs.org/docs/messages/react-hydration-error Returns only the HTML … Read more

Button component using Flutter in the Dart programming language.

Button component using Flutter in the Dart programming language.

Tiempo de lectura: 2 minutos In this post, we will create a customizable button component in Flutter using the ElevatedButton widget. This component will allow us to create buttons with text, icon, and customize various aspects like color, text size, and button width. import ‘package:flutter/material.dart’; import ‘../util/constantes/Colores.dart’; class Boton extends StatelessWidget { final Color? color; // Ahora es opcional y … Read more

Middleware file in Next.js

Middleware file in Next.js

Tiempo de lectura: < 1 minuto Today I’m going to explain and provide an example of middleware in Next.js A middleware in Next.js is a function that runs before a request reaches your Next.js route or API. You can use middleware to handle and manipulate incoming requests. Cookie Management: You can read, modify, or set cookies in incoming requests. Redirects: You … Read more

Default App File for Next.js

Default App File for Next.js

Tiempo de lectura: < 1 minuto Today I bring you this _app.tsx file by default in case your Next.js project doesn’t create it. This _app.tsx file is the top-level component in Next.js. All page components are rendered through this file, making it useful for global configurations. You should place this file inside pages/_app.tsx import { AppProps } from ‘next/app’ import ‘../styles/globals.css’ … Read more

Adding path-based internationalization with i18next in React and Next.js Server Side (SSR)

Adding path-based internationalization with i18next in React and Next.js Server Side (SSR)

Tiempo de lectura: 4 minutos Returns only the HTML translated, without any added content. The first thing we have to do is to install the necessary dependencies: npm install i18next next-i18next @types/i18next @types/react-i18next –save Then we are going to create a configuration file next-i18next.config.js at the root of the project: module.exports = { debug: process.env.NODE_ENV === ‘development’, i18n: { locales: … Read more

How to stop a Docker Compose container and delete the associated image, then create a new build

How to stop a Docker Compose container and delete the associated image, then create a new build

Tiempo de lectura: < 1 minuto Today we’re going to learn how to delete the Docker image when performing a Docker Compose down to then regenerate an update without generating garbage. The command we should use to stop the container and delete the associated image is: docker-compose down –rmi all This will remove the associated images of that Docker Compose. To … Read more