teleren/devto huggingface dataset:
Why we need to go Serverless
Tags: cloud, productivity
Published: 2023-01-16 05:43:48


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jo4ql5b25g9mlbhuky8e.png)

> Why did the on-premise server go to the doctor?
> Because it was feeling a bit hard drive!

Serverless computing is a relatively new concept that is rapidly gaining popularity among developers. The main reason for this is that it provides a number of benefits that traditional server-based approaches do not. In this article, we will discuss some of the key reasons why we should be migrating to serverless applications.

## Cost Savings 💸
One of the biggest benefits of serverless computing is the significant cost savings it can provide. With traditional server-based approaches, you have to pay for the cost of the server, even when it is not being used. With serverless computing, you only pay for the resources that you actually use, which can lead to substantial cost savings over time.

## Scalability 📏
Another major benefit of serverless computing is its ability to automatically scale resources up or down based on demand. This means that you don't have to worry about provisioning enough resources to handle peak demand, or paying for resources that aren't being used. This can help save money and ensure that your application is always available to users.

## Flexibility 🤸
Serverless computing also provides greater flexibility than traditional server-based approaches. Instead of having to provision a specific type of server, developers can simply write their code and let the cloud provider take care of the rest. This allows for greater flexibility in terms of what types of applications can be built, and how they can be deployed.

## Improved Security 🔐
Serverless computing can also improve security. With traditional server-based approaches, it's the responsibility of the developer to ensure that the server is configured securely. With serverless computing, the cloud provider is responsible for security, which can help reduce the risk of security breaches.

## Reduced Maintenance 🔧

With serverless computing, there is no need to worry about maintaining servers, as the cloud provider takes care of this. This frees up developers to focus on building and deploying their applications, which can lead to increased productivity.

## In Conclusion...
Serverless computing provides many benefits over traditional server-based approaches. These include cost savings, scalability, flexibility, improved security, and reduced maintenance. As such, it is becoming increasingly important for organizations to migrate to serverless applications in order to stay competitive in today's market.
The CAMS Model in DevOps
Tags: beginners, devops, developers, devjournal
Published: 2023-01-16 05:41:12

CAMS is usually used for describing the core creeds of DevOps methodology. 

It stands for:

- Culture
- Automation
- Measurement
- Sharing

Thanks for reading this.

If you have an idea and want to build your product around it, schedule a call with [me](https://calendly.com/pragyanatvade).

If you want to learn more in DevOps and Backend space, [follow me](https://dev.to/pragyanatvade).

If you want to connect, reach out to me on [Twitter](https://twitter.com/pragyanatvade) and [LinkedIn](https://www.linkedin.com/in/pragyanatvade/).
How To Create Zip File And Download In laravel 9
Tags: laravel, zipfile, laravel9, php
Published: 2023-01-16 05:30:00

In this article, we will see how to create a zip file and download it in laravel 9. Laravel provides ZipArchive class for creating zip files in laravel 9. 

I will give you examples step by step of laravel 9 create a zip file from a folder and download it. we will create a zip file using the zip archive class in PHP and laravel 9 application.

So, let's see create a zip file in laravel 9, and create a zip file using ziparchive in laravel 9.

> Step 1: Create Route

In this step, we will create a route in the web.php file

routes/web.php

```
<?php
  
use Illuminate\Support\Facades\Route;

use App\Http\Controllers\ZipArchiveController;
  
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
  
Route::get('download-zip', [ZipArchiveController::class, 'downloadZip']);
``` 

[Read Also: Refresh Datatable Without Reloading Page In Laravel 9](https://techsolutionstuff.com/post/refresh-datatable-without-reloading-page-in-laravel-9)
 

> Step 2: Create Controller

Now, create a new controller name as ZipArchiveController.

app/Http/Controllers/ZipArchiveController.php

```
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use ZipArchive;

class ZipArchiveController extends Controller
{
    public function downloadZip()
    {                                
        $zip = new ZipArchive;

        $fileName = 'Example.zip';

        if ($zip->open(public_path($fileName), ZipArchive::CREATE) === TRUE)
        {
            $files = \File::files(public_path('Zip_Example'));

            foreach ($files as $key => $value) {
                $file = basename($value);
                $zip->addFile($value, $file);
            }
             
            $zip->close();
        }

        return response()->download(public_path($fileName));
    }
}
```

Note: I have created a Zip_Example folder in the public folder and added some images. So, you need to also create one folder and add some files also.

Output:

```
http://localhost:8000/download-zip
```
AWS Serverless
Tags: aws, serverless, lamda, s3
Published: 2023-01-16 05:23:12

AWS serverless architecture is a powerful architecture. I won a global award of best architecture for implementing serverless architecture in a hackthon :) 

**AWS serverless architecture** is a way of building and running applications and services without the need to provision and manage servers. Instead, these applications and services are built using AWS serverless services such as AWS Lambda, Amazon API Gateway, and Amazon DynamoDB, which allow for the creation of highly scalable and cost-effective solutions.

An AWS serverless architecture is typically composed of the following components:

**AWS Lambda**: This service allows for the creation of serverless functions that can be triggered by events such as an HTTP request or a change in a database. These functions can be written in a variety of programming languages and can be used to perform tasks such as data processing, image processing, and real-time stream processing.

**Amazon API Gateway**: This service allows for the creation of RESTful APIs that can be used to trigger AWS Lambda functions or to access other AWS services such as DynamoDB. It also provides features such as authentication, caching, and request/response mapping.

**Amazon DynamoDB**: This service is a fully managed NoSQL database that can be used to store and retrieve data in a serverless architecture. It is highly scalable and can handle millions of requests per second.

**Amazon S3**: This service provides object storage, it can be used to store files, images, videos and other types of data, it's a cost-effective and highly scalable solution.

**Amazon CloudFront**: A Content Delivery Network (CDN) service that can be used to distribute and accelerate the delivery of static content such as images, videos, and JavaScript files.

**Amazon CloudWatch**: This service allows for monitoring and logging of AWS resources and applications. It can be used to set alarms and trigger actions when certain conditions are met.

AWS serverless architecture is a **cost-effective and scalable solution** for building and deploying applications and services. It allows developers to focus on writing code and business logic, rather than managing infrastructure. Additionally, it enables automatic scaling, which automatically adjusts the capacity of the resources to match the incoming traffic, resulting in cost savings.
2023 Writing Commitment
Published: 2023-03-02 09:45:01

---
title: 2023 Writing Commitment
published: true
date: 2023-01-16 05:20:41 UTC
tags: 
canonical_url: https://blog.michaeltech.xyz/2023-writing-commitment
---

2023! it's a new year that promises to be a really great one. There are technologies to master, products to build, etc. I believe there is also a growing demand for not just software developers but _sound_ software developers that can build systems and applications that are good and reliable, superficial knowledge won't do anymore and only those that know their stuff will be able to thrive in the coming years

That being said, I have committed this year to invest in more consistent self-development, which involves things like standard software architecture, building projects in public, contributions to open source projects, adhering to clean practices, etc.
 I believe one of the best ways to cement understandings around certain domains is to teach them or articulate them in a well-written format that will be instructive to others. I look at producing biweekly( once in two weeks) articles inspired by the challenge started by [**Idris Olubisi**](https://twitter.com/olanetsoft/) [tweet](https://twitter.com/olanetsoft/status/1606650175799365632).This is a public commitment aimed to foster accountability, I believe it is going to be an interesting and demanding journey, I might stumble around a few things, but I can only get better and better at this, that being said it's time to get to work!
<img width="100%" style="width:100%" src="https://media.giphy.com/media/8SuKOupsVwBUGGButK/giphy.gif">
Cypress Tutorial For Beginners : Part 2
Tags: webdev, beginners, programming, tutorial
Published: 2023-01-16 04:49:35

In this video cypress tutorial for beginners, We are going to learn how to upload a file in cypress and create our first script to test to upload a file and check that file is uploaded successfully. 

{% embed https://youtu.be/XS1iyb5ZT2Y
 %}

Cypress is a JavaScript test automation solution for web applications.
 It enables teams to create web test automation scripts.
This solution aims to enable frontend developers and test automation engineers to write web tests in the de-facto web language that is JavaScript.
Cypress also supports the Mocha test framework so the core technologies in which you would develop your web test automation are Java Script on top of Mocha.


It is a test automation tool that enables developers to automate web browser testing.
The Selenium WebDriver protocol enables sending commands in various development languages like Java, Java Script, C#, Python, and others from the test environment (IDEs) to a selected desktop browser (Chrome, Firefox, Edge, Safari).

-----------------------------------------------------
👪 Join our Community - http://bit.ly/learntesting2019

✅ Automation Community - https://thetestingacademy.com

🐦Follow us on Twitter  - https://twitter.com/itstechmode

📖 Like us on Facebook - https://www.facebook.com/scrolltest

🎤  Listen to our Podcast - https://anchor.fm/thetestingacademy

------------------------------------------------------

#automationtesting #manualtesting #testautomation #thetestingacademy #scrolltest

🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌

✅Selenium Training and Certification -
https://scrolltest.com/go/edureka


✅Learn Jenkins for QA -
https://bit.ly/learnjenkins-p1


✅Programming Java -
https://bit.ly/learnjava2020-p1


✅Test Automation - 
https://bit.ly/learnautomation2020


✅API Testing - 
https://www.learnapitesting.com


✅Cypress Tutorial with LIVE Projects -
http://cypresstutorial.com
251 days streak on Leetcode🥳🥳🥳🥳
Published: 2023-01-16 04:12:18

I completed today 251 days strak on Leetcode.....🥳🥳🥳🥳
I am glad that my consistency is increased...and I become a regular person since 251 days...





![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/byxa9dmelm729ld2td0v.png)
Consisterncy is the key which makes you perfect!!!!
Day 11 #100DaysofCode
Tags: webdev, beginners, 100daysofcode
Published: 2023-01-16 03:35:18

## Learn CSS Framework or CSS Preprocessor?

I spent a lot of time today watching videos and researching which CSS framework I wanted to learn; specifically Bootstrap or Tailwind CSS. I have used Bootstrap before and found some frustrations trying to override some of its stylings. I looked at Tailwind and was instantly turned off by its multiple class system. I also looked into maybe I should learn Sass.

## Here is what I decided
This [video](https://www.youtube.com/watch?v=dX3qnAtMT9U) basically convince me that I don't need to learn a CSS framework right now. I understand CSS but sometimes, the grind of creating with just vanilla CSS can be time consuming hence why I wanted to learn a framework. I decided to learn Sass to take my current vanilla CSS skills to the next level.

## What is Sass?
According to their [website](https://sass-lang.com/), Sass stands for Syntactically Awesome Style Sheet. It's basically CSS with "super powers." Some of the features I think I will benefit from is:
* Nesting
  * Being able to nest classes in each other and avoid over complication/repeating myself when I style stuff
* Custom Variables
  * Although CSS has its own way of creating custom variables, I think the feature in Sass will keep things streamlined

I plan to learn Sass through this [youtube](https://www.youtube.com/playlist?list=PL4cUxeGkcC9jxJX7vojNVK-o8ubDZEcNb) tutorial.
Visitor Pattern in Typescript
Tags: typescript, pattern
Published: 2023-01-16 03:21:50

Visitor design pattern is a type of behavioral pattern, a way to separate an algorithm or an action from the objects it operates on. It allows new functionality to be added to a set of classes without modifying the classes themselves, by encapsulating the new functionality in a separate class called the Visitor. This makes it more flexible, maintainable and reusable.

This pattern can be used in a real-life vehicles service scenario to perform different inspections on a variety of vehicles.

This pattern consists of the following components:
- Visitor interface: it defines a visit method for each class in the object structure.
Sample:

```
interface VehicleInspector {
	visit(car: Car): void;
	visit(van: Van): void;
	visit(motorbike: Motorbike): void;
}
```

- Concrete visitor classes: it implements the visitor interface. Each concrete visitor class defines a specific behavior for the visit method.
Sample:

```
class CarInspector implements VehicleInspector {
	visit(car: Car): void {
		console.log(`Visiting ${car.constructor.name} with CarInspector`);
	}
}

class VanInspector implements VehicleInspector {
	visit(van: Van): void {
		console.log(`Visiting ${van.constructor.name} with VanInspector`);
	}
}

class MotorbikeInspector implements VehicleInspector {
	visit(motorbike: Motorbike): void {
		console.log(`Visiting ${motorbike.constructor.name} with MotorbikeInspector`);
	}
}
```
- Element interface: this defines an accept method that takes a visitor as a parameter.
Sample:

```
interface Vehicle {
  accept(vehicleInspector: VehicleInspector): void;
}
```

- Concrete element classes: it implements the element interface. Each concrete element class has an accept method that calls the appropriate visit method on the visitor for that class.
Sample:

```
class Car implements Vehicle {
	accept(vehicleInspector: VehicleInspector): void {
		return vehicleInspector.visit(this)
	}
}

class Van implements Vehicle {
	accept(vehicleInspector: VehicleInspector): void {
		return vehicleInspector.visit(this)
	}
}

class Motorbike implements Vehicle {
	accept(vehicleInspector: VehicleInspector): void {
		return vehicleInspector.visit(this)
	}
}
```
Sample to use:

```
let car = new Car();
let van = new Van();
let motorbike = new Motorbike();

let carInspector = new CarInspector();
car.accept(carInspector);

let vanInspector = new VanInspector();
van.accept(vanInspector);

let motorbikeInspector = new MotorbikeInspector();
motorbike.accept(motorbikeInspector);
```
The result will be like this:

```
Visiting Car with CarInspector
Visiting Van with VanInspector
Visiting Motorbike with MotorbikeInspector
```
TIL: Analytics, Jekyll, Open Graph
Tags: todayilearned
Published: 2023-01-16 02:25:25


- I've been trying to get my personal website and blog cleaned up as my primary content publication location, but there are three main issues I need to solve:
  - Analytics
  - Notify subscribers
  - Distribution to broader community
  
  To solve the first issue, I've added [GoatCounter](https://www.goatcounter.com/) to my website, which is built in Jekyll
- When sharing my posts on social media, I'd like to include an image and preview text. Many platforms will automatically create a "social card" when pasting a link, but it wasn't working for my website. I installed the `jekyll-seo-tag` plugin and added the necessary meta data (description and image), and now it's working!
- I wanted to keep my posts organized, since they were all in a single `_posts` folder in the root directory. I found out that I can organize them into folders, with the added benefit of the posts being automatically categorized by the names of the folders.
- I came across the wonderful site [devhints.io](devhints.io). This is where I learned a bit more about Jekyll. I'll definitely be using this more.
- I needed a simple spell checker that works in VSCode. I went with [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker), and it has been serving me well so far. It would be cool to have a [LanguageTool](https://languagetool.org/) extension that works with code.
Como o ExoPlayer garante video streaming fluida e de alta performance
Tags: android, exoplayer, video, programming
Published: 2023-01-16 02:19:52


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/55hh8i9agb8lnen3nz5g.png)



O ExoPlayer é uma biblioteca de reprodução de mídia open-source desenvolvida pela Google. Ele é utilizado em aplicativos de mídia em dispositivos Android e permite aos desenvolvedores criar aplicativos de mídia personalizados, com recursos avançados e alta performance. Neste artigo, vamos explorar como o ExoPlayer lida com a reprodução de arquivos de vídeo, desde o momento em que um "chunk" de dados é recebido até o momento em que ele é renderizado na tela.

## Fonte de Dados
O ciclo de reprodução de um arquivo de vídeo no ExoPlayer começa com a obtenção de dados, que é gerenciada pelo componente "fonte de mídia". Esse componente é responsável por lidar com a obtenção de dados, seja eles através de uma rede ou de um arquivo local. 

## Buffer de Input
Os dados são então passados para o componente "buffer", que armazena esses dados temporariamente, garantindo que haja sempre dados suficientes para a reprodução contínua.

## Decodificador
Em seguida, os dados do buffer são passados para o componente "decodificador", que é responsável por decodificar o chunk em formato de áudio ou vídeo. O decodificador também pode aplicar quaisquer transformações necessárias, como a mudança de taxa de quadros ou a aplicação de efeitos.

## Buffer de Output
Após a decodificação, os dados são passados para o segundo buffer, que armazena esses dados decodificados temporariamente antes de serem passados para o componente de renderização. Isso garante que haja sempre dados suficientes para a reprodução contínua, mesmo em caso de variações na velocidade de rede ou outros problemas de transmissão.

## Renderizador
Após a decodificação, os dados são enviados para o componente "renderizador", que é responsável por exibir os dados na tela. No caso do vídeo, isso pode incluir ajustes de tamanho, posição e transparência. O renderizador também pode aplicar efeitos adicionais, como o aumento de brilho ou contraste.

## Controle
Por fim, o componente "controle" é responsável por garantir que o fluxo de dados esteja sincronizado e que a reprodução esteja ocorrendo na velocidade correta. Isso pode incluir ajustes de velocidade, pausa e retomada.

## Conclusão

Em resumo, o ExoPlayer é uma poderosa biblioteca de reprodução de mídia que permite aos desenvolvedores criar aplicativos de mídia personalizados com recursos avançados e alta performance. Ele é composto por 5 componentes principais: Fonte de mídia, Buffer de Entreda, Decodificador, Buffer de Saída, Decodificador, Renderizador e Controle, cada um deles com suas respectivas funções, que são necessárias para garantir a reprodução correta de arquivos de vídeo. Ao entender como esses componentes trabalham juntos, os desenvolvedores podem analisar o tempo de latência ou a perda de frames entre esses 5 componentes, melhorando a performance do serviço de streaming e tornando a experiência do usuário mas fluída e com mais qualidade.
The Secret Behind Bug-Free Games: QA Automation
Tags: chatgpt, webdev, javascript, beginners
Published: 2023-01-16 01:30:00

Hey, have you ever played a game on your tablet or phone? 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0apfq5i3l9yf2uikfn9x.png)

Of course you have! 

Well, do you know how the people who made that game made sure it worked properly and didn't have any bugs? 

> They used something called "QA **automation**"!

QA stands for "quality assurance", which is just a fancy way of saying "making sure things are working well". And **automation** just means that instead of people having to check and test everything themselves, they use special tools and programs to do it for them.

Just like you play the game to make sure it's fun and works right, **QA automation** helps the people who make the game make sure it's working the way it's supposed to. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0ctu74k9l608lunzuzv.gif)

That way, when you download the game, you know it's going to be a fun experience without any glitches.

It's not just games that use **QA automation** though, lots of different types of technology use it too! 
Websites, apps, and even cars all use it to make sure they're working properly.

Imagine if every time you wanted to play a game, you had to wait for someone to check it and make sure it was working well. It would take forever! 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mhzpfsup5lkr29hfs61t.gif)

But with **QA automation**, the game can be checked and tested very quickly, so you can start playing right away.

**_It's important to have **QA automation** because it helps make sure that technology is working properly and is safe to use._** 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1gbd4434mmmpf4xarv6b.gif)

It's like having a **superhero** watching over the technology and making sure it's doing what it's supposed to. And that's pretty cool, don't you think?

---

Let's connect [LinkedIn](https://www.linkedin.com/in/imshaiknasir/).