teleren/devto huggingface dataset:
Amazon Managed Streaming Summary
Published: 2024-01-05 20:35:00

Another analytics service you will see is Amazon Managed Streaming for Apache Kafka, also called Amazon MSK.

what is Kafka?
Well, Kafka is an alternative to Amazon Kinesis.
Kafka and Kinesis both allow you to stream data.
So, MSK is the ability to get a fully-managed Kafka cluster on AWS, and it allows you to create, update and delete clusters on the fly.

And MSK is going to create and manage Kafka broker nodes and Zookeeper broker nodes in your cluster for you and you deploy the cluster in your VPC, across multiple AZ, up to three for **high availability**.

You also have automatic recovery from common Kafka failures and the data is stored on EBS volumes for as long as you want.

It's very difficult to set up Apache Kafka and the fact you can just do one click and then deploy Kafka on AWS is great and this is the Amazon MSK service.

So on top of it, you have the option to use MSK **Serverless**, and this is that you run Apache Kafka on MSK, but this time you don't provision servers, you don't manage capacity, automatically MSK will provision resources and scale, compute and storage for you.

So what is Apache Kafka then?
Apache Kafka is a way for you to stream data and a Kafka cluster is made of multiple brokers and then you will have producers that will produce data and so they will have to ingest data from places, such as Kinesis, IoT RDS, et cetera, et cetera, and they will send the data directly into a Kafka topic that is going to be fully replicated into other brokers.

Now, this Kafka topic is having **real-time streaming** of data and consumers will pull from the **topic** to consume the data itself and then your consumer can do whatever he wants, process it or send it to various destinations, such as EMR, S3, SageMaker, Kinesis and RDS.

So the idea is that Kafka is quite similar to Kinesis, but there are differences to look out for.
So what are the differences between Kinesis Data Streams and Amazon MSK?

Well, in Kinesis Data Streams, you have one megabyte message limit, which is the default in Amazon MSK, but you can configure it for a higher message retention, for example, 10 megabytes.

You can have Data Streams with Shards in Kinesis Data Streams or in MSK, it's called Kafka Topics with Partitions, but the concept are sort of similar.
To scale Kinesis Data Stream, you need to do Shard Splitting and to scale it down Merging.
But in Amazon MSK to scale a topic, you can only add partitions.
You cannot remove partitions.

You have in-flight encryption for Kinesis data streams and then you have either plain text or TLS in-flight encryption for MSK.
You get at-risk encryption for both of these clusters and, in the exam level, this is enough.


[GitHub](https://github.com/a00ayad00)
[LinkedIn](https://www.linkedin.com/in/a00ayad00)
[Facebook](https://m.facebook.com/a00ayad00)
[Medium](https://a00ayad00.medium.com/)
Profile: Introduction to a Full-stack Enthusiast from Lisbon 🇵🇹
Tags: webdev, typescript, nextjs, react
Published: 2024-01-05 20:20:40

Hey DEV community! 👋 I'm Ricardo Esteves, a software engineer based in the captivating city of Lisbon, Portugal. I'm all about crafting delightful user experiences and building robust applications.

🌟 About Me
I'm deeply passionate about the frontend world and creating captivating interfaces. Lisbon is my base, but my work transcends borders thanks to technology. Feel free to explore my portfolio at [GitHub](https://github.com/RicardoGEsteves) (website coming soon!) and drop me a line at codebar.at.dev@gmail.com or at [Twitter](https://twitter.com/RicardoGEsteves).

🚀 Current Focus
Currently, I'm diving into Insightful, where I'm amplifying user experiences with a stack featuring 
React, Next.js, and Node.js. Learning is a constant in my journey, and I'm always on the lookout for new technologies to level up my skills.

🌐 Tech Toolbox
My expertise lies in JavaScript, TypeScript, React, and a range of related tools and frameworks. From frontend marvels like React Query and Tailwind CSS to backend prowess with NodeJS and databases like MongoDB and PostgreSQL—I'm here for it all!

💼 Experience & Projects
I've been involved in diverse projects, from fundamental landing pages to intricate full-stack endeavors. Some recent highlights include Storyscape, SpreadIt, S3MER, Intertwine, SprintEase, Omniscient, and more. Each project has added layers to my expertise, honing my skills in various domains.

🌟 How I Work
Clean, efficient code is my mantra, and I'm always eager to embrace the latest technologies to craft seamless solutions. Collaboration, open-source contributions, and a hunger for continuous learning define my approach to software engineering.

🤝 Let's Connect
I'm on the lookout for exciting opportunities to contribute meaningfully to projects and collaborate with passionate developers. Explore my work on [GitHub](https://github.com/RicardoGEsteves) and let's connect on [LinkedIn](https://www.linkedin.com/in/ricardogesteves) or [Twitter](https://twitter.com/RicardoGEsteves) to explore potential collaborations!

Looking forward to creating impactful solutions together! 😊✨
Containerization of PHP and Nginx
Tags: docker, php, nginx, containers
Published: 2024-01-05 20:02:36

Containerizing PHP and Nginx involves creating Docker containers for each service and configuring them to work together. Below are the steps involved in creating a basic Docker configuration for PHP and Nginx. This example is based on a simple PHP application.

**1- Create the project structure :**
Start by creating the project with the following structure:

```
//projet
├── index.php
├── nginx
│   └── nginx.conf
├── Dockerfile
├── Dockerfile-nginx
└── docker-compose.yml
```

**2- Create a PHP application :**
Create a simple PHP application. For example, in the root "./index.php" :

```
<?php
echo "Hello!";
```

**3- Configure Nginx :**
Create an Nginx configuration file in nginx/nginx.conf :

```
server {
    listen 80;
    index index.php;
    server_name localhost;
    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    error_page 404 /index.php;
    root /var/www;
    client_max_body_size 20m;
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass app:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
    location / {
        try_files $uri $uri/ /index.php?$query_string;
        gzip_static on;
    }
}
```

**4- Write the Dockerfile :**

```
FROM php:8.0.2-fpm

WORKDIR /var/www
```

**5-Create a Dockerfile-nginx file for Nginx in the root of the project:**

```
FROM nginx:1.19-alpine

WORKDIR /var/www
```

**6- Create a .dockerignore file in the root of the :**

```
docker-compose
Dockerfile*
```

**7- Write the Docker Compose file :**

Create a docker-compose.yml file in the project root:

```
version: "3"

services:
  app:
    container_name: app-container
    build:
      context: ./
      dockerfile: ./Dockerfile
    working_dir: /var/www/
    restart: always
    volumes:
      - ./:/var/www
    networks:
      - app-network


  nginx:
    container_name: nginx-container
    build:
      context: ./
      dockerfile: ./Dockerfile-nginx
    restart: always
    ports:
      - "8000:80"
    volumes:
      - ./nginx:/etc/nginx/conf.d
      - ./:/var/www
    depends_on:
      - app
    networks:
      - app-network

networks:
  app-network:
    driver: bridge
```

We've created an app-network, because we're containerizing PHP and Nginx separately with the same network, since the containers have a network isolated from our local system.


**8- Build and run containers :**

```
docker-compose up --build
```

Access the application:
Open your browser and go to http://localhost:8000. You should see the message "Hello!".
Sé ese profesional
Tags: writing, espanol
Published: 2024-01-05 19:59:49

El impacto de tu trabajo como profesional de TI es muy importante, en el ámbito de sistemas, al crear  una herramienta con tu equipo que automatiza un proceso, no solo estas ayudando a que las personas hagan más rápido su trabajo sino que se dediquen a lo verdaderamente importante que es pensar y dedicar tiempo a optimizar su tiempo y el de las personas que lo rodean.

Muchas veces lo que trabajamos en estas áreas solemos tener un ego muy grande que no nos permite ayudar a las personas que nos rodean por el simple hecho de creer que no lo merecen.

Sé ese profesional que ayuda a sus compañeros y que recibe retroalimentación de sus contrapartes.

Sé ese profesional que no discrimina por la forma de aprender.

Sé ese profesional que no tiene complejos de superioridad.

Sé ese profesional que se equivoca y lo admite, aprende de sus errores y sigue.

Sé ese profesional que agrega valor desmedido a su equipo, enseñando y mostrando nuevas formas de hacer y deshacer, nuevas tecnologías y sobre todo crea una cultura de aprendizaje continuo.

Sé ese profesional que resuelve problemas.

Sé ese profesional que las personas fuera de tu área quieran que los ayudes.

Sé ese profesional que tiene habilidades gerenciales, que administra, delega y se pone al frente.

Sé ese profesional que no tiene tapujos de decir lo que esta mal pero también dar una propuesta de solución.

Sé ese profesional decidido que no tiene miedo a desaprender, romper con sus esquemas y reinventarse las veces que sea necesario.

Sé ese profesional que se expone y enseña en internet.

Sé ese profesional que se sabe comunicar y expone sus ideas de forma clara y sencilla.

Sé ese profesional que es ambicioso y no se conforma, pide ese aumento, muévete, contagia esa actitud con los que te rodean.
JSON in PHP
Published: 2024-01-05 19:43:06


JSON (JavaScript Object Notation) is a lightweight data-interchange format widely used for data exchange between a server and a web application. In the realm of web development, PHP (Hypertext Preprocessor) is a server-side scripting language that excels at handling data. Combining JSON with PHP allows developers to seamlessly transmit and manipulate data, providing a powerful toolset for building dynamic and interactive web applications.

## Basics of JSON in PHP:

### 1. JSON Encoding:

In PHP, the `json_encode()` function is used to convert a PHP array into a JSON-formatted string. Consider the following example:

```php
<?php
$data = array(
    'name' => 'John Doe',
    'age' => 25,
    'city' => 'New York'
);

$jsonString = json_encode($data);
echo $jsonString;
?>
```

This code snippet creates an associative array, encodes it into a JSON string, and then prints the result. The output will be:

```json
{"name":"John Doe","age":25,"city":"New York"}
```

### 2. JSON Decoding:

Conversely, the `json_decode()` function is used to convert a JSON string into a PHP array:

```php
<?php
$jsonString = '{"name":"John Doe","age":25,"city":"New York"}';
$data = json_decode($jsonString, true);

print_r($data);
?>
```

Here, the JSON string is decoded into a PHP array, and the `print_r()` function is used to display the result:

```
Array
(
    [name] => John Doe
    [age] => 25
    [city] => New York
)
```

## Advanced JSON Handling in PHP:

### 3. Nested Arrays and Objects:

JSON in PHP supports nested arrays and objects, providing a way to represent complex data structures. Consider the following example:

```php
<?php
$nestedData = array(
    'person' => array(
        'name' => 'Jane Doe',
        'age' => 30,
        'address' => array(
            'city' => 'Los Angeles',
            'zipcode' => '90001'
        )
    )
);

$jsonString = json_encode($nestedData);
echo $jsonString;
?>
```

The resulting JSON string:

```json
{"person":{"name":"Jane Doe","age":30,"address":{"city":"Los Angeles","zipcode":"90001"}}}
```

### 4. Fetching JSON Data from an API:

PHP can interact with external APIs that provide data in JSON format. Using the `file_get_contents()` function, you can retrieve JSON data from an API and decode it for further use:

```php
<?php
$apiUrl = 'https://api.example.com/data';
$jsonData = file_get_contents($apiUrl);
$data = json_decode($jsonData, true);

print_r($data);
?>
```

This example fetches JSON data from an imaginary API, decodes it into a PHP array, and prints the result.

## Conclusion:

Understanding how to work with JSON in PHP is crucial for web developers, as it enables seamless communication between the server and the client. Whether encoding data for transmission or decoding received data for processing, the combination of JSON and PHP provides a versatile and efficient way to handle information in web applications. By mastering these fundamental techniques and exploring more advanced features, developers can unlock the full potential of JSON and PHP integration in their projects.
Free SQL Database Schema Generator
Tags: sql, database, postgres, mysql
Published: 2024-01-05 19:39:13

I created a 100% free SQL Database Schema Generator.

[https://supalaunch.com/tools/db-schema-generator](https://supalaunch.com/tools/db-schema-generator) 

Based on the product description and database type, it automatically creates tables, fields, and SQL code to create them. 

It also gives you some seed SQL so you can easily insert test data in your DB.

Hope it will be useful.
$1K PAYDAYS Review
Tags: 1kpaydays, 1kpaydaysreview, makemoneyonliney, earnmoney
Published: 2024-01-05 19:10:27

Feeling fatigued from the minimal impact of small sales in affiliate marketing? Just say hello to 1K Paydays, ready to transform your path, ensuring substantial commissions and guaranteed success. Its pledge? Boost your incorporated and online income by 10X. And worry not—we offer a 180-day money-back guarantee. If you don’t succeed for any reason, we ensure a hassle-free refund
**[Read More...](https://kausar-review.com/1k-paydays-review/
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z4l81hqd31qz2ti3yf1m.jpg))**
How to test the performance of a webpage
Tags: webdev, beginners, programming, tutorial
Published: 2024-01-05 19:09:47

So to test the performance of a web page, you have to do the following steps: 

- First open the webpage on your browser.
- Then right click anywhere on the page.
- Select **Inspect**.
- A small window opens up on either the right side or bottom of the screen.
- On this window, choose the tab called **Lighthouse**.
- Then select either mobile or desktop.
- Then select **Analyze page load**.
- The performance of the page will be displayed in few seconds.
- Other values like SEO, accessibility, etc will also be shown.
- Make sure that you stay on the webpage when the page is being analyzed by Lighthouse and don't navigate away until you get the results.
- Sometimes the performance percentage might be affected by certain issues and so you have to test the page in an incognito window.
We are multi-talented
Tags: discuss, career, coding
Published: 2024-01-05 19:01:25

Most of us are made to believe from an early age that we can have one profession, one career, one talent, one skill which keeps a roof over our heads. But I think we all have multiple talents and we should address each of them. We should apply all our talents and try out different types of work to see which we like best. So even though I work as a full time software engineer, I am constantly trying new side hustles and one that I have been doing recently is - YouTube. I have a YouTube channel on which I talk about the books that I'm reading because I love reading! Here's a [link](https://www.youtube.com/@NandysNovelNook/featured) to my channel if you are interested.

So what are your talents other than tech/software engineering/ coding stuff? Let's discuss in the comments!
微扑克官网
Published: 2024-01-05 18:56:39

在充满活力的在线扑克领域，Wepoker 和 Micro Poker 已成为杰出玩家，通过其官方平台和专用应用程序为爱好者提供激动人心的体验。 本文深入探讨了 Wepoker 和 Micro Poker 的迷人世界，探讨了德州扑克在这些平台中的功能、产品和持久受欢迎程度。

Wepoker官方：将在线扑克提升到新高度

Wepoker 官方见证了在线扑克的发展，为玩家提供了一个身临其境的动态平台，以磨练他们的技能并参与竞争性游戏。 作为在线扑克行业公认的玩家，Wepoker官方将尖端技术与用户友好的界面相结合，创造了一个让新手和经验丰富的玩家都可以享受扑克乐趣的环境。

Wepoker官方主要特点：

游戏多样性：Wepoker官方通过提供广泛的扑克游戏来迎合不同的受众。 从经典的德州扑克到奥马哈等等，玩家可以探索各种形式和风格，以保持他们的扑克体验新鲜和有趣。
**_[微扑克官网](https://wpk.com/)_**
直观的界面：Wepoker官方的用户界面设计直观且用户友好，确保玩家可以轻松浏览平台。 无论是通过网络浏览器还是专用应用程序访问网站，无缝设计都能增强整体游戏体验。

多平台可访问性：Wepoker 官方认识到可访问性在现代游戏领域的重要性。 玩家可以在多种设备上享受自己喜欢的扑克游戏，包括台式电脑、笔记本电脑、平板电脑和智能手机，提供灵活性和便利性。

安全交易：安全是Wepoker官方的首要任务。 该平台采用先进的加密技术来保护金融交易，确保玩家可以享受安全可靠的游戏环境。

Wepoker 应用程序：扑克触手可及

为了进一步提升游戏体验，Wepoker 提供了专门的应用程序，让玩家无论走到哪里都能享受到扑克的乐趣。 Wepoker 应用程序可在各种移动设备上下载，提供从桌面游戏到移动游戏的无缝过渡，而不会影响质量或功能。

微型扑克官方：重新定义微型扑克

Micro Poker 官方服务于那些欣赏低风险游戏刺激的扑克爱好者。 作为一个利基平台，微型扑克官方专注于为不同技能水平的玩家提供易于上手且愉快的扑克体验。 该平台强调微赌注游戏，对于那些想要测试自己的技能而无需大量财务承诺的人来说，它是一个理想的选择。

微型扑克官方的主要特点：

低赌注游戏：Micro Poker官方专注于小赌注扑克游戏，让玩家无需冒大量金钱的风险即可享受扑克的快感。 这使得该平台对初学者和休闲玩家特别有吸引力。

社区参与：Micro Poker 官方在玩家之间培养社区意识。 该平台经常举办小额锦标赛和促销活动，鼓励参与者之间的友好竞争和友情。

教育资源：为了了解新玩家的学习曲线，Micro Poker 官方提供了教育资源，例如教程、策略指南和技巧。 这些资源使玩家能够提高他们在扑克世界中的技能和信心。

微型扑克应用程序：为您的移动设备带来微型赌注的刺激

就像 Wepoker 一样，Micro Poker 提供了一款专用应用程序，让玩家触手可及的微额扑克体验。 Micro Poker 应用程序确保用户可以在设备之间无缝切换，在智能手机和平板电脑上享受低风险的扑克游戏。 该应用程序反映了该平台对可访问性和用户友好设计的承诺。

德州扑克：扑克的巅峰

Wepoker 和 Micro Poker 官方都承认德州扑克的持久流行和普遍吸引力。 这种经典的扑克变体已成为游戏本身的代名词，以其策略、技巧和运气的结合吸引着玩家。 德州扑克在这两个平台上都有突出的特色，让爱好者可以沉迷于公共牌、策略性投注和追求令人垂涎的彩池的刺激之中。

德州扑克应用程序：袖珍扑克的兴奋

对于喜欢德州扑克的刺激感的玩家来说，Wepoker 和 Micro Poker 都提供了专注于这种标志性扑克变体的专用应用程序。 德州扑克应用程序将游戏的强度和策略带到玩家的移动设备上，让他们能够参加锦标赛、参与现金游戏，并在舒适的环境中体验扑克的激动人心的时刻。
Day 5: Mastering Rust's Conditionals and Match Expressions
Tags: rust, self, programming, 100daysofcode
Published: 2024-01-05 18:47:47

> Greetings, fellow coders! 🚀 On Day 5 of my #100DaysOfCode adventure with Rust, I delved into the art of conditionals, exploring if statements and the powerful match control flow construct. Let's unravel the intricacies of Rust's decision-making capabilities.


## If Statements: Navigating Conditional Paths

In Rust, `if` statements provide a flexible way to make decisions based on conditions. The syntax is familiar, but Rust's emphasis on safety shines through:

```rust
let num: i32 = 4;

if num % 2 == 0 {
    println!("{num} is an even number!");
} else if num < 0 {
    println!("Enter a positive number!");
} else {
    println!("{num} is an odd number!");
}
// Output: 4 is an even number!
```

### Key points about Rust's if statements:

- The `if` expression starts with the keyword, followed by a condition.

- The code inside the curly braces `{}` is executed if the condition is true.

- `else` and `else if` blocks are optional but provide additional branching logic.

- Conditions are checked sequentially, and only the first true condition's code block is executed.


We can even embed if...else conditions inside let statements for concise code:

```rust
let age = 20;
let result = if age > 18 {
    "You can drive"
} else {
    "You cannot drive!"
};
println!("{result}");
// Output: You can drive
```

---

## Match Control Flow: Rust's Versatile Coin-Sorting Machine

When dealing with multiple conditions, the `match` keyword becomes a powerful ally. It compares a value against a series of patterns and executes code based on the matching pattern:

```rust
let num = 3;

match num {
    1 => println!("One"),
    2 => println!("Two"),
    3 => println!("Three"),
    _ => println!("Something else"),
}
// Output: Three
```

Key features of Rust's match expressions:

- Patterns are compared sequentially, and the first matching pattern triggers the corresponding code block.

- The `_` (underscore) represents the default case when no match is found.

- The match expression must be exhaustive, covering all possible values.


### Multiple Values in a Single Case

We can consolidate multiple values into a single case for cleaner code:

```rust
let num: i32 = 4;

match num {
    0 | 2 | 4 | 6 | 8 | 10 => println!("{num} is even**!"),
    1 | 3 | 5 | 7 | 9 => println!("{num} is odd**!"),
    _ => println!("Number should be between 0 and 10!!"),
}
// Output: 4 is even**!
```

### Leveraging Ranges in Match Expressions

Ranges add elegance to match expressions, enabling concise comparisons:

```rust
let age = 20;

match age {
    4..=15 => println!("Child"),
    16..=20 => println!("Teenage"),
    21..=30 => println!("Adult"),
    _ => println!("Invalid age"),
}
// Output: Teenage
```

---
As I traverse Rust's terrain of conditionals, each statement and match expression unveils the language's precise and safety-oriented nature. Follow my coding journey on my [Github](https://github.com/Aniket200-ind/100dayscoding) repo for more updates! 💻🌐✨

#RustLang #Programming #LearningToCode #CodeNewbie #TechJourney #Day5
Conteneurisation de PHP et Nginx
Tags: php, docker, container, nginx
Published: 2024-01-05 18:33:35

La conteneurisation de PHP et Nginx implique la création de conteneurs Docker pour chaque service et leur configuration pour qu'ils fonctionnent ensemble. Vous trouverez ci-dessous les étapes pour créer une configuration Docker de base pour PHP et Nginx. Cet exemple est réalisé à partir d'une application PHP simple.

**1- Créer la structure du projet :**
Commencez par créer un projet avec la structure suivante :

```
//projet
├── index.php
├── nginx
│   └── nginx.conf
├── Dockerfile
├── Dockerfile-nginx
└── docker-compose.yml
```


**2- Ajouter une application PHP :**

Créez une application PHP simple. Par exemple, dans root "./index.php" :

```
<?php
echo "Bonjour, je suis Hamza !";
```


**3- Configuration de Nginx :**

Créez un fichier de configuration Nginx dans nginx/nginx.conf :

```
server {
    listen 80;
    index index.php;
    server_name localhost;
    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    error_page 404 /index.php;
    root /var/www;
    client_max_body_size 20m;
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass app:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
    location / {
        try_files $uri $uri/ /index.php?$query_string;
        gzip_static on;
    }
}
```

**4- Écrire le fichier Dockerfile :**

```
FROM php:8.0.2-fpm

WORKDIR /var/www
```

**5- Créez un fichier Dockerfile-nginx pour Nginx à la racine du projet :**

```
FROM nginx:1.19-alpine

WORKDIR /var/www
```



**6- Créez un fichier .dockerignore à la racine du projet :**

```
docker-compose
Dockerfile*
```


**7- Écrire le fichier Docker Compose :**

Créer un fichier docker-compose.yml à la racine du projet :

```
version: "3"

services:
  app:
    container_name: app-container
    build:
      context: ./
      dockerfile: ./Dockerfile
    working_dir: /var/www/
    restart: always
    volumes:
      - ./:/var/www
    networks:
      - app-network
    

  nginx:
    container_name: nginx-container
    build:
      context: ./
      dockerfile: ./Dockerfile-nginx
    restart: always
    ports:
      - "8000:80"
    volumes:
      - ./nginx:/etc/nginx/conf.d
      - ./:/var/www
    depends_on:
      - app
    networks:
      - app-network

networks:
  app-network:
    driver: bridge
```
Nous créons un réseau app-network, car nous conteneurisons PHP et Nginx séparément avec le même réseau, du fait que les conteneurs ont un réseau isolé de notre système local.

**8- Build et exécuter des conteneurs :**

```
docker-compose up --build
```

Accéder à l'application :
Ouvrez votre navigateur et allez sur http://localhost:8000. Vous devriez voir le message "Bonjeur, Je suis Hamza !".