teleren/devto huggingface dataset:
Why SVG over Other Image formats?
Tags: javascript, programming, react, beginners
Published: 2023-03-01 14:29:30

SVG (Scalable Vector Graphics) is a popular image format that offers several advantages over other image formats like PNG, JPEG, and GIF. Here are some reasons why SVG is preferred over other image formats:

**Scalability**: SVG images are vector graphics, which means they can be scaled up or down without losing quality. This is because SVG images are created using mathematical equations, rather than a fixed grid of pixels like raster images. This makes SVG ideal for logos, icons, and other graphics that need to be displayed at various sizes.

**Small file size**: SVG files are typically smaller in size compared to raster image formats like PNG and JPEG. This is because SVG files are written in XML code, which is much more compact than pixel-based image data.

**Retina display support**: SVG images are resolution-independent, which means they look crisp and clear on high-resolution screens like Retina displays. This is because SVG images can be scaled up to match the screen's resolution without losing quality.

**Accessibility**: SVG images can be easily customized and manipulated using CSS, making them more accessible for users with disabilities. For example, SVG images can be easily inverted or made to change color on hover, which can be helpful for users with low vision.

**Animation**: SVG images can also be animated using CSS or JavaScript, which can add interactivity and visual interest to web pages. This can be especially useful for creating interactive infographics, charts, or diagrams.

Overall, SVG is a versatile and flexible image format that offers several advantages over other image formats, making it a popular choice for web designers and developers.
The minimal AWS IAM policy for using a bucket with an application
Tags: devops, amazon, aws, iam
Published: 2023-03-26 09:46:17

---
title: The minimal AWS IAM policy for using a bucket with an application
published: true
date: 2023-03-01 13:30:00 UTC
tags: devops,amazon,aws,iam
canonical_url: https://www.madalin.me/devops/2023/060/minimal-iam-policy-allow-application-s3-bucket-access.html
---

This is the minimal policy for an application to access only an AWS S3 bucket in which it would upload / download files and generate signed urls for public access.

![Sad eggs](https://source.unsplash.com/BrunIOLQMfQ)

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket",
                "s3:GetObject",
                "s3:DeleteObject",
                "s3:GetObjectAcl",
                "s3:PutObjectAcl",
                "s3:PutObject"
            ],
            "Resource": [
                "arn:aws:s3:::bucket-name",
                "arn:aws:s3:::bucket-name/*"
            ]
        }
    ]
}

```

Create a IAM user. Attach the above policy with `bucket-name` replaced.

Enjoy and remember to ignore all people that suggest you attach a give all permissions policy. You don’t give your house keys to strangers, right?
Caroot - The solo-stack for solopreneurs
Tags: productivity, discuss, management, news
Published: 2023-03-01 14:19:57

Hi everyone,

The trend of employment and becoming independent workers is increasing, and many people are also struggling to learn and transform themselves. Independent workers need to multitask for their business. Trying as hard as possible, we bet you still can’t cover all the tasks yourself, at the same time can’t afford to employ full-time employees due to your low budget

Now just forget it all and focus on things that matter the most to you! We created Caroot - a product that aims to help independent workers more efficient and productive.

Caroot is an all-in-one solution for managing, requesting tasks and streamlining communication. With Caroot, you can just tell us your requests. Either it’s paper work or marketing posts, research,…, our professionals would fulfill them and handle back to you in no time

If you were so kind as to give our app a go and let us know your thoughts, whether around the idea, the technical aspects, usability, or anything else, we would be extremely grateful. Or if it’s not for you, it would be great if you show this to someone who would benefit from it!

[Download and give it a try here ](https://www.caroot.app/?utm_medium=submit&utm_source=devto&utm_campaign=launching)
Thank you
Using ChatGPT To Solve Complex Coding Challenges
Tags: chatgpt, ai, programming, machinelearning
Published: 2023-03-01 14:11:01

This is the start of a new series where I am going to put [ChatGPT](https://openai.com/blog/chatgpt) through its paces as a pair programming assistant.

Except I am going to be the worst programming partner ever!

I am going to be using the platform [codewars](https://www.codewars.com/) for the each of the coding challenges.

Starting at the easiest level (8 KYU), I am going to take the instructional text, examples and any other information provided and paste it in to ChatGPT.

I am then going ask for it to solve the problem. Relaying any errors encountered and providing further prompts until it passes the coding challenge.

This post is little more than an introduction but keep an eye out for the next post in the series that will be out in the next day or so!
Loops and Iteration in JavaScript
Tags: javascript, programming, webdev
Published: 2023-03-01 14:02:50

Beginner Guide on Loops 
Loops are an essential part of any programming language, including JavaScript. They allow developers to execute a block of code repeatedly, without having to write the same code over and over again. In JavaScript, there are several types of loops, each with its own specific use case.

For loop
The for loop is the most commonly used loop in JavaScript. It allows developers to iterate over a range of values and execute a block of code for each iteration. Here is an example:

`for (let i = 0; i < 10; i++) {
  console.log(i);
}
`
In this example, the loop will execute 10 times, with i starting at 0 and incrementing by 1 each time until it reaches 9. The console.log(i) statement will be executed for each iteration.

While loop
The while loop is another common loop in JavaScript. It allows developers to execute a block of code repeatedly as long as a certain condition is true. Here is an example:
`let i = 0;
while (i < 10) {
  console.log(i);
  i++;
}
`
In this example, the loop will execute as long as i is less than 10. The console.log(i) statement will be executed for each iteration, and i will be incremented by 1 after each iteration.

Do-while loop
The do-while loop is similar to the while loop, but it guarantees that the block of code will be executed at least once, even if the condition is initially false. Here is an example:
`let i = 0;
do {
  console.log(i);
  i++;
} while (i < 10);
`
In this example, the loop will execute at least once, and then continue to execute as long as i is less than 10. The console.log(i) statement will be executed for each iteration, and i will be incremented by 1 after each iteration.

For-in loop
The for-in loop is used to iterate over the properties of an object. Here is an example:
`const person = {name: 'John', age: 30, gender: 'male'};
for (let key in person) {
  console.log(key + ': ' + person[key]);
}
`
In this example, the loop will iterate over the properties of the person object and print out the key-value pairs for each property.

For-of loop
The for-of loop is used to iterate over the elements of an iterable object, such as an array or a string. Here is an example:
`const arr = ['apple', 'banana', 'orange'];
for (let fruit of arr) {
  console.log(fruit);
}
`
In this example, the loop will iterate over the elements of the arr array and print out each element.

Loops are an essential tool for any JavaScript developer, and understanding how to use them effectively is key to writing efficient and effective code.
Javascript Rest vs Spread Operator - What's the difference?
Published: 2023-03-01 13:59:28

**In JavaScript, the rest and spread operators are both denoted by the same three dots (...) syntax, but they are used in different contexts and have different effects.**

The rest operator is used in a function's parameter list to represent an indefinite number of arguments passed to the function. It allows you to pass a variable number of arguments to a function and handle them as an array inside the function. Here's an example:

```javascript
function sum(...numbers) {
  return numbers.reduce((total, num) => total + num, 0);
}

console.log(sum(1, 2, 3)); // output: 6

```

In this example, the ...numbers parameter in the sum function's parameter list represents an indefinite number of arguments that can be passed to the function. The rest operator collects all the arguments into an array called numbers.

On the other hand, the spread operator is used to spread the elements of an iterable (such as an array) into another iterable (such as an array or an object). Here's an example:

```javascript
const arr1 = [1, 2, 3];
const arr2 = [4, 5, ...arr1];

console.log(arr2); // output: [4, 5, 1, 2, 3]

```
In this example, the spread operator (...arr1) is used to spread the elements of arr1 into arr2. This results in a new array (arr2) that contains all the elements of arr1 followed by 4 and 5.

In summary, the rest operator is used to collect a variable number of arguments into an array in a function's parameter list, while the spread operator is used to spread the elements of an iterable into another iterable.



**The main difference between two is -**

- The **rest operator** is used to fill a JavaScript array 
  with the remaining data from a user.

- The JavaScript **spread operator** allows an array or an 
  object to be spread or flattened into its elements.

In common terms We can say -

- Rest we use for pack elements.

- Spread we use for unpack elements.
Paycom 2023
Published: 2023-03-01 13:59:12

[https://www.bankfanz.com/paycom-bank-transfer-code/](https://www.bankfanz.com/paycom-bank-transfer-code/#utm_source=backlinks&utm_medium=search&utm_campaign=darry+ring+us&utm_content=Michelle)


https://plaza.rakuten.co.jp/paycombank1/diary/202303010000/
https://peatix.com/user/16185195/
https://www.provenexpert.com/paycom-bank-transfer-code-20235/
https://www.producthunt.com/@paycombank5
https://www.divephotoguide.com/user/Paycomtransfercode5
https://wakelet.com/@Paycombanktransfercode2023227
https://vocal.media/authors/paycom-bank-transfer-code-2023-fa37yr0jo1
https://www.lifeofpix.com/photographers/paycomtransfercode5/
https://seedandspark.com/user/paycom-bank-transfer-code-2023-4
https://rosalind.info/users/Paycomtransfercode5/
http://phillipsservices.net/UserProfile/tabid/43/ctl/Profile/userId/202481/pageno/3/Default.aspx
https://app.roll20.net/users/11685345/paycom-bank-transfer-code-2
https://speakerdeck.com/paycombank5
https://social.msdn.microsoft.com/Profile/Paycom%20bank%20transfer%20code%202023%205
https://camp-fire.jp/profile/paycomtransfercode5
https://plazapublica.cdmx.gob.mx/profiles/paycombankcode5/activity
https://www.metal-archives.com/users/Paycomtransfercode5
https://storium.com/user/paycomtransfercode5
https://trabajo.merca20.com/author/paycomtransfercode5/
https://www.intensedebate.com/people/paycomtransfer5
https://www.mifare.net/support/forum/users/paycomtranfercode5/
https://pinshape.com/users/2584228-paycombank5
http://foxsheets.com/UserProfile/tabid/57/userId/122618/Default.aspx
https://www.kompasiana.com/paycombank5
https://www.credly.com/users/paycom-bank-transfer-code-2023.14bcb796/badges
https://www.myminifactory.com/users/Paycomtransfercode05
https://www.sqlservercentral.com/forums/user/paycombankcode5
https://www.longisland.com/profile/paycomtransfer5
https://guides.co/a/paycom-bank-transfer-code-2023
https://myanimelist.net/profile/Paycomtransfer5
How to Google Index for Blogspot Blog?
Published: 2023-03-01 13:58:01

Getting your Blogspot blog indexed by Google is an important step to ensure that your content can be found by people searching for related topics. Here are the steps you can take to help [Google index your website](https://www.bestdesign2hub.com/how-to-get-google-to-index-your-new-website-immediately/) blog:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojabioetw778jgnyjol9.jpeg)
**Submit your blog's sitemap to Google Search Console:**[Adding a sitemap to your Blogspot blog](https://www.labnol.org/internet/submit-blogger-sitemap-to-google/10149/) can help search engines discover and index all the pages on your blog, which can ultimately improve your blog's visibility in search results. 

**Use relevant keywords in your blog's content:** Using relevant keywords in your blog's content can help Google understand what your blog is about and show it in relevant search results. However, be sure to avoid keyword stuffing, which can actually harm your blog's rankings.

**Build high-quality backlinks:** Backlinks, or links from other websites to your blog, can signal to Google that your blog is a credible and valuable source of information. However, be sure to focus on building high-quality backlinks from reputable sources, rather than buying or exchanging links.

**Share your blog on social media:** Sharing your blog posts on social media can help drive traffic to your blog and increase its visibility. This, in turn, can signal to Google that your blog is a valuable resource that should be indexed.

**Ensure your blog is mobile-friendly:** Google prioritizes mobile-friendly websites in its search results, so make sure your Blogspot blog is optimized for mobile devices.

**Use header tags and meta descriptions:** Using header tags (such as H1, H2, H3) and meta descriptions in your blog's content can help Google understand the structure and relevance of your content, which can improve its chances of being indexed.

By following these tips, you can improve the chances of your Blogspot blog being indexed by Google and increase its visibility in search results.
Protobuf vs Avro for Kafka, what to choose?
Tags: kafka, protobuf, tutorial, avro
Published: 2023-03-01 13:46:32

**Hey there!**👋 Recently I had a few quite insightful evenings comparing possible options for the Kafka messaging format, so I gathered some useful articles for you.

1. [Data Serialization: Avro vs Protobuf](https://lnkd.in/dZ2Ya4Gp)
Awesome comparison of Protobuf and Avro. Well structured, and detailed where it's needed. This article summarizes traits, pros and cons, and leaves you with a basic understanding of when and where to use these formats.

2. [What you can do with Protobuf and can't with Avro? and vice versa](https://lnkd.in/drBnWThM)
Fabulous article with a detailed overview of how serialization works with Protobuf, Avro and JSON Schema. With real-life code samples and connectivity with schema registry samples.

3. [Arvo and Protobuf performance compared](https://lnkd.in/dahjh-Mx) 
Quite a good example if you are a fan of "example with real numbers". This article shows the serialization of both types in action. Definitely worth reading.

4. [Kafka Schema evolution](https://lnkd.in/dswNypBG)
If your schema changes often and you wanna a format that will simplify this process as much as possible, this article will save you time and energy.

P.s my personal preference -- Protobuf (100%), however, the reading was fun
Entendendo Gerenciamento de Estado no React
Published: 2023-03-01 13:35:44

O gerenciamento de estado é um aspecto fundamental de qualquer aplicação React, visto que nosso programa não será estático, mas irá se moldar conforme o usuário o executar. O estado é o conjunto de dados que determina o comportamento e a aparência de uma aplicação React em um determinado momento. É importante manter o estado de sua aplicação de forma organizada e gerenciável, para que possa ser facilmente acessível e atualizado em diferentes partes da aplicação. Neste artigo, vamos explorar as diferentes opções de gerenciamento de estado no React e suas bibliotecas.

**Opções de gerenciamento de estado:**

O React oferece algumas opções nativas para gerenciamento de estado, como o uso do estado local de um componente, o uso de props para passar dados entre componentes, e o uso do Context API para compartilhar dados entre componentes. No entanto, para aplicativos mais complexos, essas opções podem não ser suficientes, e é aqui que as bibliotecas de gerenciamento de estado entram em jogo.

- **Redux**:

O Redux é uma biblioteca popular de gerenciamento de estado no React. Ele segue um padrão unidirecional de fluxo de dados, onde o estado da aplicação é mantido em uma única store, e as atualizações no estado são feitas através de ações. O Redux é muito útil para aplicativos de grande escala, onde é necessário compartilhar o estado entre vários componentes e manter um histórico de ações realizadas na aplicação.

**- MobX:**

O MobX é uma biblioteca de gerenciamento de estado que enfatiza a simplicidade e a facilidade de uso. Ele usa observadores para detectar mudanças no estado e atualiza automaticamente as partes relevantes da aplicação. O MobX é ideal para aplicativos com uma lógica de estado complexa, e onde a reatividade é uma preocupação importante.

**- Context API:**

A Context API é uma opção nativa de gerenciamento de estado no React. Ele permite que você compartilhe dados entre componentes sem a necessidade de passar as props manualmente entre eles. A Context API é útil para aplicativos menores, onde não é necessário compartilhar o estado entre muitos componentes.


Com isso em mente, vimos como o gerenciamento de estado é um aspecto crucial de qualquer aplicação React. As opções nativas do React são úteis para aplicativos menores, mas para aplicativos mais complexos, é recomendável o uso de uma biblioteca de gerenciamento de estado. 

O Redux é uma boa escolha para aplicativos de grande escala, onde é necessário compartilhar o estado entre muitos componentes e manter um histórico de ações.

O MobX é ideal para aplicativos com uma lógica de estado complexa e onde a reatividade é uma preocupação importante.

Por fim, a Context API é uma opção nativa útil para aplicativos menores, onde não é necessário compartilhar o estado entre muitos componentes. Saber sobre isso irá ajudar no desenvolvimento otimizado de seu código.
How to reset correct directories and files permissions recursive in linux
Tags: linux, files, directories
Published: 2023-03-26 09:46:00

---
title: How to reset correct directories and files permissions recursive in linux
published: true
date: 2023-03-01 13:30:00 UTC
tags: linux,linux,files,directories
canonical_url: https://www.madalin.me/linux/2023/060/how-to-reset-correct-permissions-recursive-linux.html
---

Here is what you need to do to reset the right way all files and directories in Linux. Works also on Macos and FreeBSD.

![Sad eggs](https://source.unsplash.com/LUYD2b7MNrg)

Open the terminal. Change directory to the directory containing all you want to fix permissions.

We will fix also the owner, optionally.

I am setting OTHERS to 0, but if some services need read access to your directories or files, use 755, respectively 644. I am just a bit more restrictive and set correct the groups depending on how they will be used.

Fix directories:

`find . -type d -exec chmod 750 {} \;`

Fix the files:`find . -type f -exec chmod 640 {} \;`

Fix owner:

`chmod -R [replace with user]:[replace with group] .`

If this are my local files, usually I replace user and group with my username.

If this are in a web project, on a web server, I set user for the user running the application and group for a group the web server belongs to. I normally ensure both belong to that group. Make note you must set your application platform to do an umask of `027`. PHP it is in the ini settings ;-)
How Your Favorite Websites Are Contributing to Climate Change
Published: 2023-03-01 13:26:20

If the internet were a country, it'd be the 7th most polluting. In the past 10 years alone, websites have grown 320% heavier.

My name is Ricardo and I studied the hidden cost of the internet's top 500 websites, comparing their carbon footprint & their yearly environmental impact.

You can find the results here: [https://keyprint.backspace.eco ](https://keyprint.backspace.eco).
Learn How to Work with the CSS url() Function
Tags: css, webdev, beginners, tutorial
Published: 2023-03-01 13:23:00

**Learn How to Work with the CSS url() Function**

The **Uniform Resource Location (URL)** function is a built-in function for including a file. This function takes an absolute URL, a relative URL, or a data URI as a parameter.

The `url()` can be included as a value for a couple of things like:

- Background-image
- border-image
- list-style-image
- content
- cursor
- border-image
- border-image-source
- src as part of a @font-face block
- and @counter-style/symbol can all be used with the url() function.

## Syntax

```css
url("address_of_file")
```

## Parameters

The file address is the single parameter needed for this function. This file’s address may be either an absolute or relative URL, or URI of any resource needed. This resource may be a file or an image in the `png`, `jpeg`, `gif`, or even `svg` formats.

## Types of URLs

When discussing background images, @import, and other topics, we use the url() function to load a resource. The url() function accepts a url value as its parameter. This specifies the location of the file.

### Relative URLs

In this case I used a relative URL, which searches the file in the folder where the CSS file is defined. So if the asset (image.png) is in the same folder as the CSS file then it would find the image.

```css
/* Relative URLs */
.hero {
  background-image: url("image.png");
}
```

I could go back one level, this could be useful if your images are stored outside of your CSS folder:

```css
/* Relative URLs */
.hero {
  background-image: url("../image.png");
}
```
or go into a specific folder:

```css
/* Relative URLs */
.hero {
  background-image: url("images/image.png");
}
```

### Root-relative URLs

I could also load a file from the domain’s root, which is where the CSS is kept:

```css
/* Root-relative URL */
.hero {
  background-image: url("/image.png");
}
```

### Absolute URLs

Alternatively, I could load an external site by using an absolute URL:

```css
/* Absolute URL */
.hero {
  background-image: url("https://www.pexels.com/photo/green-tree-on-grass-field-during-daytime-53435/");
}
```

An absolute URL contains the entire address from the protocol (HTTPS) to the domain name.

If you are looking for new images for your website, then I would recommend these two resources to find high-quality free stock images: [Pexels](https://www.pexels.com/) and [Unsplash](https://unsplash.com/).

### Further reading

Want to learn some more about the aside element? Then check out – [url() – CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/url)

### See also

[What is CSS? Basics Explained](https://maxlockwood.dev/what-is-css/)
[What are the 3 Ways to Style in CSS?](https://maxlockwood.dev/what-are-the-3-ways-to-style-in-css/)
[What are the Most Common CSS Units?](https://maxlockwood.dev/what-are-the-most-common-css-units/)

If you liked this article, then please share. You can also find me on [Twitter](https://twitter.com/maxlockwood88) for more updates.