teleren/devto huggingface dataset:
Courte introduction à la propriété background en CSS3
Published: 2023-07-20 12:59:49


Lorsque vous concevez un site web, l'arrière-plan est un élément essentiel pour créer une ambiance visuelle et améliorer l'expérience utilisateur. Pour définir l'arrière-plan en CSS, nous utilisons la propriété `background`. Dans cet article nous allons parler plus concrètement de : `background-color`, `background-image`, `background-repeat`.

**Note**: Il existe plusieurs autres propriétés pour définir les arrières plan telles que `background-clip`, `background-size`... Mais, ici, nous allons nous limiter aux trois ci-dessus précitées.
## 1. Couleurs d'arrière-plan

La méthode la plus simple pour définir un arrière-plan est d'utiliser une couleur unie. Vous pouvez le faire en utilisant la propriété "`background-color`" suivie du nom de la couleur ou du code hexadécimal. Par exemple :

```Css
body {
  background-color: #f2f2f2;
}

```
**Note :** _il y a plusieurs façons de spécifier une couleur de . Les plus rependues sont : l’appeler par son nom en anglais (`red`, `marron`, `yellow` …), indiquer son code hexadécimal (`#ffffff`), l’identifier par la méthode RGB et RGBA…_

## 2. Dégradés d'arrière-plan

Les dégradés sont une autre option populaire pour les arrière-plans. Ils permettent de créer des transitions fluides entre deux couleurs ou plus. Vous pouvez utiliser la propriété "`background-image`" avec la valeur "`linear-gradient`" pour définir un dégradé linéaire. Par exemple :

```css
body {
  background-image: linear-gradient(to bottom, #ff0000, #0000ff);
}
```
## 3. Images d'arrière-plan

Si vous souhaitez utiliser une image comme arrière-plan, vous pouvez utiliser la propriété "`background-image`" avec la valeur "`url`" suivie de l'URL de l'image. Par exemple :

```css
body {
  background-image: url("chemin/vers/image.jpg");
}
```

Vous pouvez également spécifier d'autres options pour l'image d'arrière-plan, telles que la position, la répétition et la taille, en utilisant les propriétés "`background-position`", "`background-repeat`" et "`background-size`".

## 4. Motifs d'arrière-plan

Les motifs sont des images répétées pour créer un effet de motif sur l'arrière-plan. Vous pouvez utiliser la propriété "`background-image`" avec la valeur "`url`" pour spécifier l'image du motif, et la propriété "`background-repeat`" pour définir la répétition du motif. Par exemple :

```css
body {
  background-image: url("chemin/vers/motif.png");
  background-repeat: repeat;
}

```
## 5. Utilisation de la propriété Background seule
Il est aussi possible d'utiliser la propriété `Background` sans spécifier un autre élément après lui. Par exemple : 

```css
background: red;
```
> Cette façon est peu usitée, mais peut s'avérer utile dans certaines circonstances.

## Conclusion
 
Ce sont quelques-unes des options les plus couramment utilisées pour définir des arrière-plans en CSS. Vous pouvez les combiner et les personnaliser selon vos besoins pour créer des designs uniques et attrayants pour votre site web.
Day 9: compose function
Tags: day9, 100daysofcode, javascript
Published: 2023-07-20 12:30:00

## Question
Write a function called `compose` that accepts multiple functions as arguments and returns a new function. The new function should apply the input functions in reverse order, passing the result of each function call as an argument to the next.
```typescript
function double(x) {
  return x * 2;
}

function square(x) {
  return x * x;
}

function increment(x) {
  return x + 1;
}

const composedFunction = compose(increment, square, double);
const result = composedFunction(10); // Result: 401
```

🤫 Check the comment below to see answer.
🔥🎨💰 TOP popular #NFTs Summer 2023: Transforming #Digital #Ownership 💻🔐🌈
Tags: nft, news, web3
Published: 2023-07-20 12:24:10

Non-fungible tokens, or NFTs, have shown to be a key aspect of the future of digital art as well as a certificate to secure digital asset ownership. Members of the #NFT space are looking forward to taking use of a new type of art from #WEB3's most popular #creators in 2023. 

Why is NFT so popular? 

🖋️ #Unique Ownership: NFTs provide a way to establish verifiable ownership and authenticity for digital assets. 
🖋️ Digital Scarcity: NFTs can introduce scarcity to the digital world. 
🖋️ Digital Collectibles: NFTs have opened up new possibilities for collecting digital items. 
🖋️ Artist #Empowerment: NFTs enable artists to sell their work directly to buyers without intermediaries.
🖋️ Potential #Investment: NFTs have attracted attention as investment assets. 
🖋️ Cultural #Significance: NFTs have become a cultural phenomenon, representing the convergence of technology, art, and blockchain. 

Let’s take a look on Summer Compilation of Hot NFTs 2023: 

🌠 [after the streetlights stopped grieving ](https://superrare.com/0x6484bd276cc46baa1b75b08f745ffc1bcb1c70de/after-the-streetlights-stopped-grieving-1)
Volume traded 12.00 ETH, By [@diewiththemostlikes ](https://twitter.com/toadswiback)

🌠 [Oblivious #1 (Your Nearest Exit May Be Behind You) ](https://superrare.com/artwork-v2/oblivious-1-(your-nearest-exit-may-be-behind-you)-29499)
Volume traded 11.00 ETH, by [@brendandawes ](https://twitter.com/brendandawes)

🌠 [AI Generated Nude Portrait #7 Frame #184 ](https://superrare.com/artwork/ai-generated-nude-portrait-7-frame-184-374)
Volume traded 300.00 ETH, by [Robbie Barrat](https://twitter.com/videodrome) 

Click [here](https://nftnewspro.com/top-10-trending-nfts/) to look more. 

Some NFT artists united for the mutual aim - like for example, [Noosphere. Technology Knowledge Humanity](https://gallery.noosphereglobal.com/). It represents a collection of NFTs to #support_Ukraine in the fight against the russian invaders and has the opportunity to buy NFT tokens with the images of artistic space sculptures. 

Do you agree with the popularity of NFT? Or have you had any experience with NFT investment? Here, at [Devler.io](https://devler.io/), we would like to hear your thoughts about all of this, share in the comments below 🌐
Test? When to test?
Tags: javascript, jest, testing, debug
Published: 2023-07-20 12:19:51

Everyone now and then talked about the importance of writing unitary or implementation tests, but not everyone tried to explain to you what do you need to test.

## Test? When to test?
First things first I need to explain to you deep down in the basics: "what is the purpose of testing?". Testing is trying to predict a mistake from the user before it happened. As a scientist or an engineer, your job is to prevent the final user to fail in what you have built.

## Front-end tests
Front-end tests are sort of more unusual than the back-end ones are.
There are some architectures like **microfrontend**, **componentization** or **atomic design** that could help you creating tests for your websites or front-end applications. Basically, in front-end, you may test the steps that the user will take during his exploration through the website. So, you may want to test things like: 
- Is the register working?
- Is the login working?
- Is the document upload working?
- Is the payment gateway working?
- Are my emails being sent?

And there are also a lot other kind of tests that not even everyone knows:

- Testing page contrast
- Testing page analytics
  - How much time does the page needs to load?

## Back-end tests
Back-end tests are kind of **required** to build an application that can scale this days. This tests may be also related to what the user can, and will do, while he is using your services, so back-end tests must test **YOUR** code, not the code from the libraries you are using.

For example, a tweet of mine motivated me searching for better explanations about testing, and consequently, made me write this article.


![Tweet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8xap6o9poft920wouobr.png)

As you guys can see, this is an example about **WHAT NOT TO TEST**, but first let me explain why not to write tests like this.

### Only test your code

There are not any problems in the code, the code is pretty clean though. The real problem is: I am only testing Jest's code, not mine.
This test case below only tests if mongoose save method is working, not integrating my application into it.

## When to test back-end
[Woovi.com](https://woovi.com) have a pretty great article that explains how and when you can test your back-end, you can see it [here](https://dev.to/woovi/what-to-test-in-the-backend--1l44).

But, basically, you should test your code and the integrations that it may establish with external APIs for instance.
- Test if API version match to the one you are waiting for
- Test if your credentials are still active
- Test if your controllers are working
- Test if your services are working
- Test if your recent migration is still compatible with your expected interfaces

## Finally
Test your own code.

-----------

Sig Coding
Sig is a community-first DAO startup that produces SaaS applications powered by its own community. We spend time thinking on how to make things better and how to make tech be more environment-friendly.

-----------

Thumbnail by Wu Yi at [Unsplash](https://unsplash.com/photos/Bfrk9RCOhRE)
Mock localized strings in SPFx solutions
Tags: jest, spfx, react, tdd
Published: 2023-07-20 12:19:30

Let's assume I have a SPFx solution with a component that is using localized strings:

![solution structure with localized string](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cnxew0gpm7gwiunsnpuy.png)

##### _SiteConfig.tsx_
```tsx
import strings from 'CorporateDesignApplicationCustomizerStrings';

const SiteConfig: React.FunctionComponent<ISiteConfigProps> = (props) => {
    const [msgTxt, setMsgTxt] = React.useState<string>();
    setMsgTxt(strings.MsgUpdating)  //"Few more things. We are now updating site logo and creating a few pages. Please wait.");

    return (<>
    {   msgTxt &&
            <MessageBar data-testid="messagebar">
                {
                    <div dangerouslySetInnerHTML={{ __html: msgTxt }} />
                }
            </MessageBar>
    }
    </>);
}
export default SiteConfig;
```

My test is rather simple: 
##### _SiteConfig.test.tsx_
```tsx
describe("SiteConfig", () => {
    let mockPageContext: PageContext;
    let mockSPFI: SPFI;
    let siteConfig: RenderResult;

    it("should render correctly", async () => {
        
        await act(async () => {
            siteConfig = render(<SiteConfig />);
        });

        expect(siteConfig.getByTestId('messagebar')).toBeInTheDocument();

    });
//...
}
```

## The problem 
And the result... is **FAIL**: `Cannot find module 'CorporateDesignApplicationCustomizerStrings' from 'src/extensions/corporateDesign/components/SiteConfig/SiteConfig.tsx'`


## The solution

The solution is an extremely easy one. 
Add `"CorporateDesignApplicationCustomizerStrings": "identity-obj-proxy"` line in `package.json`:

### package.json
```json
{
    //...
    "jest": {
        "moduleNameMapper": {
            "CorporateDesignApplicationCustomizerStrings": "identity-obj-proxy"
        }
    }
}
```

And mock your strings as a constant:
##### _SiteConfig.test.tsx_
```tsx
jest.mock('CorporateDesignApplicationCustomizerStrings', () => {
    return {
        MsgUpdating: "a",
        MsgUpdated: "b"
    }
    { virtual: true }
})

describe("SiteConfig", () => {
    //...
}
```

Solution found in [surajit09's answer](https://github.com/Voitanos/jest-preset-spfx-react16/issues/7#issuecomment-595693970)
What Are The Price And Offer For Gold coast keto dragons den?
Published: 2023-07-20 04:48:56

Gold coast keto gummies uk has clearly shown to be the greatest weight loss pills with no negative side effects in its job abilities. You may try the product once and never have to worry about side effects again.

Gold coast keto gummies uk is the most practical and dependable way to lose weight. This single formula is really beneficial to the user. Various components work together to decrease weight and increase happiness. Add the fat burning pill that works without the use of any artificial ingredients to your daily digestion practise. It burns excess muscle mass and increases natural stamina to keep you young and active indefinitely.

Keto Gummies will undoubtedly restore your desire to live a happy life. It is a high-performance supplement that works flawlessly on the user's body.


The [Gold coast keto dragons den](https://www.mid-day.com/lifestyle/infotainment/article/cost-2023-gold-coast-keto-gummies-uk-reviews-official-website-does-it-work-23296570) are unquestionably a terrific way to lose weight and attract favorable attention from onlookers. It is popular among individuals who do not have enough time to lose weight and improve their health. The organic supplement Natural extracts are used to keep your body from accumulating fat. It aids in the best loss of excess weight. This recipe is gluten-free and medically verified, and it is recommended and used by specialists for fat loss.

With natural and quick fat burning chemicals, the treatment is completely successful. Enjoy a 30-day money-back guarantee and avoid using the supplement if you are nursing. The dose directions are straightforward and easy to follow. By eating the most revitalizing weight reduction solution, you may avoid current and prospective health risks. Overdosing should be avoided since it might expose you to unanticipated hazards. Also, get in touch with health professionals so that you may receive more advantageous health advantages and better monitoring.

Read More:

[https://www.mid-day.com/lifestyle/infotainment/article/cost-2023-gold-coast-keto-gummies-uk-reviews-official-website-does-it-work-23296570](https://www.mid-day.com/lifestyle/infotainment/article/cost-2023-gold-coast-keto-gummies-uk-reviews-official-website-does-it-work-23296570)


[https://github.com/frenklinjeck](https://github.com/frenklinjeck)
what is software testing ?what do we need to know about software testing ? relevance of software testing?
Published: 2023-07-20 12:12:13

**WHAT IS SOFTWARE TESTING**
software testing is a way to asses the quality of the software and reduce the risk of software failure. It is not a standalone activity it is a complete process which involves analysis, test planning, test designing, test execution, reporting defects etc.
Software testing comprises of static and dynamic testing. When we are analyzing the requirement and ensuring the requirement meet knowing that there are no gaps in the requirement then its is known as static testing. dynamic testing require the execution of the code and verifying if the software meets the specified requirements.

**RELEVANCE OF SOFTWARE TESTING**
a)It is use to find defects and identify defects.
b)It ensures that the quality of the product is good.
c)It ensures that the software meets the product requirement.
d)It ensures that the software is fit to use.
e)It helps in cost reduction.
f)It improves the quality of product.
g)It protects the company from reputational damage.
PostgreSQL EXPLAIN command
Tags: postgres, postgressql
Published: 2023-07-20 12:03:24

The `EXPLAIN` command in Postgres is a very useful tool, it gives insights into how Postgres will perform queries, which means it helps us understand and compare queries for optimization purposes. In this post i'll explain how to use `EXPLAIN` command. 
![Ironic](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/udqn8b0sasrv35f818se.gif)

## Why?
As previously mentioned, the `EXPLAIN` command will help us understand and optimize queries, to further understand why this is needed we need to look at SQL.
SQL is what is known as a 'Declarative language', which means we **Declare** what we want, and the database figures out the best way to execute instructions to return the results of our query. 
A special module called the **Planner** is responsible for figuring out the best 'plan' to execute the query, and the `EXPLAIN` command allows us to see that plan.

## Usage
Using the `EXPLAIN` command is as simple as prepending it to your normal query, for example:
```SQL
EXPLAIN SELECT * FROM <database_name>;
```
will return the estimated plan and cost in plain text (though you can change the output format as we will see next).

`ANALYZE` can also be prepended with `EXPLAIN` to run the query and output the actual run statistics.
- Note: This will also run your query, so be careful not to alter the database!

## Interpreting the Output
The output generated by the `EXPLAIN` command contains details about the sequence of steps that PostgreSQL will take to retrieve the data. 

Some of the components we see in the output are:
1. Node Types: Node types represent the different operations performed during the query execution.
- Common node types include: "Seq Scan" (sequential scan), "Index Scan" (index scan), "Nested Loop", ...etc.
2. Join Types: If the query involves joining multiple tables, you will see the type of join used.
- join types include: "Nested Loop Join", "Hash Join", and "Merge Join".
3. Relation Information: For each node, you'll find details about the involved relations or tables (their names, aliases, and access methods, ...etc).
4. Filter Conditions: Filter conditions applied during the execution.
5. Costs: The cost of each operation during query execution, it reflects the computational effort required, and it helps the planner choose the most efficient execution plan.
6. Execution Order: The order in which nodes are processed.

## Performance optimizations
Here are some tips for optimizing queries once you have the output of `EXPLAIN`:

1. Look for Sequential Scans: Sequential scans can be slow on large tables. These can be mitigated by creating indexes on columns frequently used in `WHERE` clauses or `JOIN` conditions to speed up queries.
2. Large Sort Operations: Sorting large datasets can be resource-intensive and is best avoided. Ensure you have indexes on columns used in ORDER BY clauses.
Consider Caching: If you notice repetitive queries in the output, caching might be beneficial to reduce database load.


#### References
1. https://www.crunchydata.com/blog/get-started-with-explain-analyze
How To Use ChatGPT API in Your Business in 2023
Tags: chatgpt, openai, ai
Published: 2023-07-20 12:02:23

These days, businesses are constantly thinking about how to use the ChatGPT API to the best of their (and its) ability.

The fact that OpenAI has recently released an API that is 10x times cheaper in price than their flagship GPT-3.5 model has also led to the emergence of numerous applications in various industries.

Since 2013, Rubyroid Labs has developed over 300 software development projects, including those that required OpenAI integration. If you are looking for a partner to integrate OpenAI into your Ruby on Rails application, [contact us right away.](https://rubyroidlabs.com/contact)

In this article, we share insights on how to use Chat GPT API for various business cases.

## What is ChatGPT API?

After the launch of chatbot, developers one by one tried to figure out “does ChatGPT have an API?” And if so, “is ChatGPT API free?”

In March 2023, OpenAI made its API available to developers. The ChatGPT API is a language processing tool built on GPT technology. Recently, the company released its GPT-4 model, the latest version of the AI tool. It’s available through a waiting list only (as is its API). Currently, those waiting for GPT-4 can use the ChatGPT-3 model for projects. If you are wondering how to use GPT-3 API, you need to get an API key via the official website.

If comparing ChatGPT vs ChatGPT API, think of it like this: the latter was designed primarily for businesses with specific features in mind that they wish to implement.

ChatGPT is scalable and can handle large amounts of data. The API comes with a variety of SDKs and libraries to help developers integrate the model into their applications.

What’s more, developers can use the API to train their own models and customize the behavior of those models to their unique requirements.

## Top 5 Chat GPT API Use Cases

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

[Read the full blog post ](https://rubyroidlabs.com/blog/2023/04/how-to-use-chatgpt-api/)
My online store costs me 1$ per year
Tags: cms, firebase, headless, shopping
Published: 2023-07-20 11:41:57

Yes, this is true, not a bait of any sort. Developers and Entrepreneurs beware of this.


![Shelf logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/chzpzud8hn5jfq0z5qlw.png)

## Short Story

Me and my son started a retro video games shop 🚀, we used the following tools, which amounted to less than a 1USD for operational costs per year

This is the Cost of our project for the first 20 days of July


![Project Cost](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bp1xvm9ch4vf4q82308w.png)

## How we did it ?

- Firebase > Pay as you go cloud database, storage and user management
- [SHELF CMS](https://shelf-cms.io) > Online Commerce Management System, that you login to with your firebase credentials. It will convert your firebase into a Headless commerce CMS
- PayPal > We accept credit cards 💳 with PayPal
- Cloudflare R2 > We store images/json assets with Cloudflare R2 storage service, which we connect to with SHELF-CMS. They do not have egress fees like other providers (which is amazing)
- Cloudflare Pages > We serve our website static website with this amazing service
- Firebase Functions > for creating Checkouts, Payments and Marketing Emails, we also connect it to SHELF-CMS

## Long Story

There is no long story, simply follow the [instructions](https://www.shelf-cms.io/docs/setup/project) 📖 @ SHELF-CMS.

It is really fast to setup
🧉Avoiding Burnout Using 'Potions'!⚗️
Tags: productivity, gamedev, devjournal, taskslayerz
Published: 2023-07-20 11:27:56

Hey, everyone!

Just like in an RPG, life hits hard sometimes. I've learned to cope with these "critical hits" using something I picked up from Task Slayerz: "Potions".

"Potions" are things that heal me physically, mentally, and spiritually. Here's a snapshot:

Health Potions: Things like healthy meals, workouts, and staying hydrated.

Mana Potions: Activities like chilling after school, hanging out with friends, or enjoying hobbies.

Spirit Potions: Stuff I love doing just for myself, like gaming or reading.

The trick is remembering to use these "potions" amidst the daily grind. If I ignore them, I feel drained and burned out.

So, I've learned to first 'brew' my potions. I figure out what works for me and what doesn't. Some things I thought were helping me were actually 'poisons' - they seemed restorative but drained my energy instead. Maybe it's that old gaming chair that's killing my back, or my favorite snacks I'm eating too much of.

Now, I'm more careful about identifying my potions and making sure they're not poisons. Because burning out isn't leveling up. Remembering to use my potions is what keeps me going!

Learn about task slayerz at https://copper.taskslayerz.com/

Stay strong, fellow adventurers!


![Task slayer a holding sword](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j7jac8bjguxpr0ot2yf0.png)
Why part of Kafka partition don't write messages
Published: 2023-07-20 11:23:01

The system functions fully, I have created 3 brokers, there is 1 producer and 3 consumers. The producer assumes information, everything is ok on his part. Zookeeper sees all 3 brokers, coordinates information between them, when any broker is disabled, it reassigns the partition leader, information continues to be recorded. There are 3 consumers, when you disable any other pickup message, this is also ok. But, the problem is that the recording goes only to 4 partitions out of 6 ( 1, 2, 4, 5) On partitions with numbers 0 and 3, information is not destroyed. At the same time, the messages do not stop, with the exception of everything that absorbs from the producer. Why these 2 partitions fall out - I don’t understand yet

I tried to disable brokers, switch and replace consumers, looked at the logs of brokers - seems normal, messages are written without loss
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7s9l8iwi5ji3whrg0d5a.png)