teleren/devto huggingface dataset:
100 Days of Code: Day 3
Published: 2022-05-05 22:03:46

Today I covered conditional statements in Python.

For practice, I made a pizza ordering system. How it works is the user is asked 3 questions: What size pizza they want (small, medium or large), if they want pepperoni and finally, if they want extra cheese.

These 3 questions are stored in 3 variables with an input function.

I started by creating an additional variable named 'bill' and then writing the conditional statements:

bill = 0

if size == "S":
bill += 15
if add_pepperoni == "Y":
bill += 2

The above code was followed by 'else if' statements to trigger the other conditions if the first one wasn't true.

I created a separate if statement to determine if the price of extra cheese was going to be added to the bill:

if extra_cheese == "Y":
bill += 1
print(f"Your final bill is: ${bill}.")

Below is an example of the final result:

**Welcome to Python Pizza Deliveries!**
**What size pizza do you want? S, M, or L** M
**Do you want pepperoni? Y or N** Y
**Do you want extra cheese? Y or N** Y
**Your final bill is: $24.**
Markdown blog with Appwrite connection
Tags: appwritehack, markdown, nextjs, typescript
Published: 2022-05-05 21:55:44

### Overview of My Submission

I wanted to learn NextJS for a longer time now and started the development of a concept of a markdown blog. When the team of appwrite and dev.to came up with this hackathon I decided to participate by adding an appwrite functionality to this blog. My idea was to store the mdx files, which are originally stored in the posts directory, in the appwrite storage database. I am programming for nearly a month now and it's finally done. You just need an appwrite container and my markdown-blog image containerized. Additional information about configuration and setup can be found in the [README.md](https://github.com/tim0-12432/markdown-blog)

On the technological hand I am using NextJS with dynamic frontend rendering, next-MDX-remote for mdx parsing and TailwindCss for styling.


### Submission Category: 

Web2 Wizards


### Link to Code

{% embed https://github.com/tim0-12432/markdown-blog %}


### Additional Resources / Info

#### License

[MIT](https://github.com/tim0-12432/markdown-blog/blob/main/LICENSE.md)

#### Appwrite dashboard
![statistics](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5fa7hi4kr6yn6oc6wop.png)

#### Storage bucket
![bucket](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xry66epzkt2ruktterq6.png)

#### Markdown files
![files](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w1juh6b5c58vhrlad7rd.png)

![file details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g9uou7884m9p908cgt6t.png)

#### Homescreen
![homescreen desktop](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/juj0t4vcplzz8ca09ha3.png)

![homescreen mobile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/grbhu1vszd6o6ds06l5b.png)

---

{% embed https://dev.to/tim012432 %}
Should Developers Put Themselves Out There?
Tags: discuss, watercooler
Published: 2022-05-05 21:50:36

Hello friends 👋🏼,

I recently had an interesting conversation with a friend. 
They have been wondering why lately many developers encourage others to put themselves out there.
Not everyone can write blogs or create video content or talk on podcast.
Not everyone is extrovert.
That's why there are technical writers, marketers, podcast announcers, etc.
Why developers are expected to do these things?

I personally started to write because I initially wrote for myself as my notes and I love to write. I started to learn in public because I want to keep myself accountable and help other people.
Without realizing, I put myself out there.

Writing has been a joy for me. I like to share my experiences. I challenge myself if I understand about a topic by writing, and gain more knowledge through researching the topic.
I've crossed path with many great developers through learning in public. And I'm very happy if I know that I can support and motivate someone through what I do.

But again, maybe this is not for everyone 🤷🏻‍♀️. 

Out of my curiosity, what's your opinion about it?
Should developers put themselves out there and why?
I would love to hear some thoughts 😊
May 5th, 2022: What did you learn this week?
Tags: discuss, weeklyretro, weeklylearn
Published: 2022-05-05 21:13:35

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

![Obi-Wan saying "Hello there!"](https://media.giphy.com/media/Nx0rz3jtxtEre/giphy.gif)

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}
Discussion and Comment of the Week - v3
Tags: bestofdev
Published: 2022-05-05 21:12:47

**This weekly roundup highlights what we believe to be the most thoughtful and/or interesting discussion of the week. We're also be highlighting one particularly cool comment in each installment. 🙌**

The DEV Community is particularly special because of the kind and thoughtful discussions happening between community members. As such, we want to encourage folks to participate in discussions and reward those who are initiating or taking part in conversations across the community. After all, a community is made possible by the people interacting inside it.

## Discussion of the Week

I'd like to put the spotlight on "[What's the longest build time you've experienced?](https://dev.to/softwaredotcom/whats-the-longest-build-time-youve-experienced-k2j)" posted by @thegeoffstevens.    

{% embed https://dev.to/softwaredotcom/whats-the-longest-build-time-youve-experienced-k2j %}

Long build times can cause quite a bit of headache... or allow you quite a bit of time for coffee depending on how you look at it.

All in all, this discussion led to some really [enlightening](https://dev.to/joelbonetr/comment/1o515) and [entertaining](https://dev.to/phlash909/comment/1o4l2) comments — yes, I find the thought of a 3-week long build time morbidly entertaining. 😅

Also, this discussion was set up so well. It was cool to learn that the median is 3.7 minutes (at least, according to CircleCI's 2022 State of Software Delivery) and encouraging to hear that the devs at LinkedIn decreased the build time for their largest microservice from 60 minutes to 15 minutes. 

Here's to shorter build times (and less coffee) for everyone! ☕️ 

## Comment of the Week

This week we gotta give it to @rkleee who responded to @simeg's "[What Skills Makes a Great Software Engineer?](https://dev.to/simeg/what-skills-do-you-think-makes-a-great-software-engineer-1b14)" with a short and sweet reminder not to be afraid of folks around you succeeding:

{% embed https://dev.to/rkleee/comment/1o3g3 %}

And extra kudos to @paul_henman for chiming in with this clarifying comment (👇) that urges you to go a step beyond not being afraid, and actively help those around you to succeed.

{% embed https://dev.to/paul_henman/comment/1o5ii %}

Really awesome to hear y'all talking about building others up and not letting your ego stand in the way. 🙌

## What are your picks?

There's loads of great discussions and comments floating about in this community. These are just a few we chose to highlight. 🙂

I urge you all to share your favorite comment and/or discussion of the past week below in the comments. And if you're up for it, give the author an @mention — it'll probably make 'em feel good. 💚
Productivity Tips
Tags: beginners, productivity, career
Published: 2022-05-05 20:55:46

Some things i have realized along the way. 

**1) Don't try to solve everything on your own and ask for help**. There are a lot of tasks which take significantly less time with some help. If you are just starting out and feel a little bit that you ask to much... don't worry a time will come when people are asking you for help. And than you can give back. 

**2) Be nice and friendly to people and build good relationships.** It has saved my butt more than once that i was on good terms with some database or ops people. But you have to be genuine. Faking it doesn't work. 

**3) Realize that text is your raw material as wood is the raw material for a carpenter.** Learn to manipulate text and text files well. 

**4) Learn a language to do automation and text processing**(-> Point 3)). 

**5) Sometimes it can be easier to learn a new tool than to do a task with your existing tool.** But you might hesitate. 

**6) Try to automate earlier than later.** You will save time and get coding practise in. (-> Point 4)

**7) Get comfortable with a shell and than customize the heck out of it.** It will be very helpful with points 3, 4 and 6.  It's very good way to build small tools which will be a great help

**8) Try to automate as much steps out of your your documentation as possible.** You will get coding practise in and those scripts will also be a form of documentation, where you will know immediatly if something is not correct. 

**9) Working with unittests is like climbing with a rope and safty hooks.** If you have a good test coverage and f something up you will fall but just into you last hook. As the tests catch the error you have introduced. Also if something is hard to test and not an edge case, chances are the design is not the greatest. Plus you get in coding and refactoring practise. 

**10)Take breaks and recharge.** You are human. 

**11) Also work on your soft- and communication skills.** Software Development is usually a team sport. 

**12) Write Stuff down** You will have to remember a lot of knowledge and you are human and will forget things. Try to keep a daily logbook. 

**13) Use Password Manager to store your login data**
React Slideshow Component with autoplay, fullscreen mode and expand all
Tags: react, customhooks, javascript, webdev
Published: 2022-05-05 19:34:27

## A React Slideshow component with all the bells and whistles

### [Live Demo →](https://ligzbo.csb.app/)
### [Code View →](https://codesandbox.io/s/ligzbo)

I loved the slider used in [https://www.educative.io/](educative.io) so I wanted to recreate the design and functionality with React.

### Features

- Previous/Next Slide
- Autoplay slides
- Restart slider
- Expand/Collapse all slides
- Fullscreen slides mode

### Simple API
```
const data = [
  {
    title: "First",
    text: "foo bar baz"
  },
  ...
];

...

// optional prop autoPlayTime to control autoplay time on slide
<Slides slides={data} /> 
```

To avoid repeating code I utilized a few custom hooks:

`useCount` – for controlling active slide index
```
import { useState } from "react";

export const useCount = (initialValue = 0) => {
  const [activeIndex, setActiveIndex] = useState(initialValue);

  const increment = () => {
    setActiveIndex((prev) => prev + 1);
  };

  const decrement = () => {
    setActiveIndex((prev) => prev - 1);
  };

  const reset = () => {
    setActiveIndex(initialValue);
  };

  return [activeIndex, increment, decrement, reset];
};
```

`useToggle` – for controlling expanded/collapsed slides, autoplay mode and full screen mode
```
import { useCallback, useState } from "react";

export const useToggle = (initialValue = false) => {
  const [state, setState] = useState(initialValue);
  const toggle = useCallback(() => setState((state) => !state), []);
  return [state, toggle];
};
```

`useInterval` – for controlling slide increments in autoplay mode
```
import { useEffect, useRef } from "react";
export const useInterval = (callback, delay) => {
  const intervalId = useRef(null);
  const savedCallback = useRef(callback);

  useEffect(() => {
    savedCallback.current = callback;
  });

  useEffect(() => {
    const tick = () => savedCallback.current();

    if (typeof delay === "number") {
      intervalId.current = window.setInterval(tick, delay);

      return () => window.clearInterval(intervalId.current);
    }
  }, [delay]);

  return intervalId.current;
};
```
React - O que são Props
Published: 2022-05-05 19:19:18

Usamos props no React para passar dados de um componente para outro (de um componente pai para um componente filho). Props é apenas uma maneira mais curta de dizer propriedades. Eles são úteis quando você deseja que o fluxo de dados em seu aplicativo seja dinâmico.

Exemplo de um componente App.
```jsx
function App() {
  return (
    <div className="App">
      
    </div>
  )
}
```
Agora vamos criar outro componente para exemplificar com e sem o uso de **Props**.

```jsx

// Componente sem o uso de props - ( dados estáticos )
const SayHello = () => {
  return (
    <div>
      <p>Olá Jorge</p>
    </div>
  )
}

// Utilizando Props para torna o componente reutilizável e dinâmico
const SayHelloWithProps = (props) => {
  return (
    <div>
      <p>Olá {props.name}</p>
    </div>
  )
}

// Adicionando o SayHelloWithProps ao App
const App = () => {
  const name = 'Jorge';

  return (
    <div className="App">
      <SayHelloWithProps name={name}/>
    </div>
  )
}
```
Ao reutilizar o componente **SayHelloWithProps** esse recebe um atributo 'name' que é inserido de forma dinâmica ao componente, o acesso é dado via argumento da função que possui acesso a um objeto **props**.

```jsx
const SayHelloWithProps = (props) => {

  const name = { props }

  return (
    <div>
      <p>Olá {name} {props.lastName}</p>
    </div>
  )
}
```
> Props são somente leitura, não possível atribuir um novo valor, fazendo isso um erro é gerado.

> Você pode usar a desestruturação ( no argumento da função ou no corpo da função ) isso torna o código mais limpo e fácil de entender ou acessar as propriedade com a dot notation.



É possível passar além de dados, funções via **props** e se necessário definir valores padrões para os mesmo.

Exemplo:
```jsx
...
const SayHelloWithProps = ({ name = 'Desconhecido'}) => {
  return (
    <div>
      <p>Olá {name}</p>
    </div>
  )
}
```

As **Props** são o equivalente a argumentos de funções, aceitando variados tipos de dados e funções, use sua criatividade para criar aplicações e usar essa funcionalidade de uma forma que deixe seus componentes mais reutilizaveis.

> Baseado no post - [How to Use Props in React](https://www.freecodecamp.org/news/how-to-use-props-in-react/)

> [Documentação Oficial - Componentes e Props](https://pt-br.reactjs.org/docs/components-and-props.html)

> Veja também: [Aprendendo React - The Roadmap!](https://dev.to/nascimento_/apredendo-react-the-roadmap-5fii) | [React - O que é JSX](https://dev.to/nascimento_/react-o-que-e-jsx-3032) | [React - O que são Componentes](https://dev.to/nascimento_/react-o-que-sao-componentes-40f0) | [React - O que são Estados](https://dev.to/nascimento_/react-o-que-sao-estados-5ben)

>  *Este post tem como objetivo ajudar quem esta começando no aprendizado de React, além de servir como incentivo no meus estudos de React criando outros posts pra fixação do aprendizado.*

---

<p align="center"> Me paga um ☕ ? | pix: <strong>nascimento.dev.io@gmail.com</strong> </p>

---


<h4> <em> Me Sigam :) </em> </h4>
[Linkedin](https://www.linkedin.com/in/nascimento-dev-io/) | [Github](https://github.com/nascimento-dev-io)
DDEV + Gitpod = awesome 🚀
Tags: ddev, gitpod, php, devops
Published: 2022-05-05 19:15:21

The standardization of coding projects with Docker-tools like [DDEV](https://ddev.com/) has one big advantage: These projects can be launched locally as well as in new cloud IDE providers like [Gitpod](https://gitpod.io/). So if a new team member joins or designers just want to implement a small style change, they can work purely in their webbrowser. Here is a little example of launching [KirbyCMS](https://getkirby.com/) via DDEV and Gitpod. 

The repository [mandrasch/ddev-kirby-starterkit](https://github.com/mandrasch/ddev-kirby-starterkit) is launched via Gitpod: 

{%youtube https://www.youtube.com/watch?v=1QPKqxp0YIY %}

The Gitpod-related code can be found in [.gitpod.yml](https://github.com/mandrasch/ddev-kirby-starterkit/blob/main/.gitpod.yml) and in [.gitpod/](https://github.com/mandrasch/ddev-kirby-starterkit/tree/main/.gitpod). This experiment uses a docker image by shaal ([shaal/ddev-gitpod](https://github.com/shaal/ddev-gitpod)). 

If you just want to experiment, there is a little online helper: [ddev-gitpod-launcher](https://drud.github.io/ddev-gitpod-launcher/)

All general information regarding the Open Source tool DDEV can be found here: https://ddev.com/. And there is even a browser extension for Gitpod: https://www.gitpod.io/docs/browser-extension.

Join the [DDEV discord](https://discord.gg/hCZFfAMc5k) if you'd like to chat with the community.

Have fun!
StripeDev Live - RedwoodJS
Tags: javascript, webdev, redwoodjs, stripe
Published: 2022-05-05 19:05:38

{% embed https://www.youtube.com/watch?v=U_Xv7zh1XAg %} 

## What you'll learn

In this StripeDev Live recording I was joined by [RedwoodJS](https://twitter.com/redwoodjs) core team members [Christine van der Merwe](https://twitter.com/that_chrisvdm) and [Dominic Saadi](https://twitter.com/desaadi307). We talked about what Redwood is, why you should pay attention and what the future holds for the framework. If you don't come away with even a little bit of hype, I'll eat my hat.

## Who this video is for

If you have a passing interest in RedwoodJS, or just want to learn what the fuss is about, then this is for you!

## Table of contents

[00:00](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=0s) Introduction
[02:15](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=135s) Redwood background
[07:00](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=420s) What differentiates Redwood
[08:29](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=509s) Why Redwood is opinionated
[13:40](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=820s) Customization and swapping components out
[16:43](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=1003s) Yarn 3
[17:21](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=1041s) Customizing the data layer
[18:33](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=1113s) Building an example store with Redwood
[20:50](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=1250s) Configuring Redwood
[28:00](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=1680s) What opinions should go into Redwood?
[29:21](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=1761s) Typescript
[31:16](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=1876s) What's next for Redwood
[36:48](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=2208s) Redwood and accessibility
[38:08](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=2288s) v2 release date
[40:04](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=2404s) Redwood startup fund
[41:56](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=2516s) Redwood startup club
[43:18](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=2598s) Redwood for enterprises
[45:04](https://www.youtube.com/watch?v=U_Xv7zh1XAg&t=2704s) Conclusion

## Resources

* [RedwoodJS](https://github.com/redwoodjs/redwood)
* [Redwoodjs-stripe](https://github.com/chrisvdm/redwoodjs-stripe)

## Stay connected

You can stay up to date with Stripe Developer updates in a few ways:

- 📣 Follow [@StripeDev](https://twitter.com/stripedev) and [our team](https://twitter.com/i/lists/1459720002567868418) on [Twitter](https://twitter.com/StripeDev)
- 📺 Subscribe to our [Youtube channel](https://www.youtube.com/StripeDevelopers)
- 💬 Join the official [Discord server](https://discord.com/invite/RuJnSBXrQn)
- 📧 Sign up for the [Dev Digest](https://go.stripe.global/dev-digest)

What do you think? Are you sold on RedwoodJS? How bright is their future? Hit me up on [Twitter](https://twitter.com/paul_asjes) or comment below and let's chat!
Why Learn Python?
Published: 2022-05-05 18:53:30

Python programming is leading the global job market because the benefits of Python are clear. Python is one of the top three programming languages in the world, and is assured to become the most popular, according to ZDNet so [learn python](https://www.igmguru.com/data-science-bi/python-training/) .

In fact, according to the PYPL Index, Python is the more popular programming language world-wide, so if you want to work in a different country, you have a good chance of getting a job in, say, Switzerland or Australia. Where would you like to work? Adding Python to your skill set could be your ticket to anywhere in the world.

Python programming is a general-purpose skill used in almost all fields, including: 

•	Data science
•	Scientific and mathematical computing
•	Web development
•	Finance and trading
•	System automation and administration
•	Computer graphics
•	Basic game development
•	Security and penetration testing
•	General and application-specific scripting
•	Mapping and geography (GIS software)

By learning Python, you’ll have more job opportunities than you can imagine — at home or abroad. What field do you prefer? Data science is all the rage, but options like game development, finance and trading, security and penetration testing, and network mapping and geography are other potentially exciting possibilities. It’s your matter of choice how you leverage the benefits of Python.

Know more : https://youtu.be/slSDox6mzIE
Best Way to Avoid E-mail Spam
Tags: tutorial, productivity, tips
Published: 2022-05-05 18:47:38

The best way to avoid e-mail spam messages is not as difficult as you may think. E-mail service providers such as Gmail, Outlook, and Yandex do a good job of identifying and filtering out spam for you. **But there’s one trick you can use to completely avoid it.**

But first, let’s talk about what makes a valid e-mail address.

## The E-mail Address Format 📧
The first e-mail was sent in 1971 and since then billions of e-mails have been sent, with [roughly 85%](https://dataprot.net/statistics/spam-statistics/#:~:text=Nearly%2085%25%20of%20all%20emails%20are%20spam.,-(Spamlaws)&text=That%20translates%20into%20an%20average,show%20that%20it's%20currently%20declining.) (!) of them being spam e-mails. Thirty years later in 2001, [RFC 2822](http://www.faqs.org/rfcs/rfc2822.html) (Request For Comments) was agreed upon. This led to the legality of plus (+) signs in e-mail addresses.

## Best Way to Avoid E-mail Spam 🚀
Now, why does the RFC matter? It matters because it states an e-mail that contains a plus (+) sign is a valid e-mail address. And large e-mail provider services treat whatever follows the plus sign as a tag, and still send the e-mail to your address.

**Let me give you a real-life example.** Let’s say I have an e-mail, `simon@gmail.com`, and I want to sign up for Amazon. I input `simon+amazon@gmail.com` as my e-mail address. If the e-mail parsing logic follows the standard, this will be accepted and I will receive the verification e-mail shortly after.

Now let’s say Amazon’s customer e-mail database leaks. Some naughty person gets ahold of them and sends spam messages to them all. My messages are sent to `simon+amazon@gmail.com`. When I notice this I create a filter to forward any e-mails sent to `simon+amazon@gmail.com` to the trash can. Or even some custom category where I can do with them as I please.

## Conclusion
Using a plus (+) sign in your e-mail address lets you control e-mails coming from specific websites and services. Use a tag in your e-mail address to control unwanted spam messages. You can identify and control what you do with them using the settings for your e-mail. Easy as pie!

---

_Follow me on Twitter [@prplcode](https://twitter.com/prplcode)_

_Originally published at https://prplcode.dev_