teleren/devto huggingface dataset:
wordl-ish
Published: 2022-06-29 21:15:19

As part of the CS101 module in the codecademy computer science pro path, you are tasked with creating a terminal program for the final project. This is my submission. A terminal based version of the popular wordle game.

[https://github.com/nishido/wordlish/](https://github.com/nishido/wordlish/)


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

We were encouraged to use classes and objects for the project, and I was thinking of refactoring to do just that, however, it felt as though I was going to use classes just for the sake of using classes. And I think it would have just made the code a little less readable. So I opted to just stick with some basic functions. 

As a beginner coding hobbyist, this was quite a lot of fun working out the logic of colouring the letters correctly.
How to count words in a string in PHP
Tags: webdev, php, tutorial, programming
Published: 2022-06-29 21:04:28

By using the function `str_word_count()`, we can get information about words used in a string.

## Get the number of words found in a string

To find out how many words in a string, you can do like this:

```php
$str = "aaa bbb ccc 123 ddd";

print_r(str_word_count($str, 0)); // 4
```

In this example, the function finds 4 words in the string `$str` and the output is `4`. The second parameter in the function `str_word_count()` specifies the return value of the function. Here, the value `0` specifies returning the number of words in the input string.

## Get an array containing all the words found inside the string

If you set the second parameter's value to be `1`, the function `str_word_count()` will return an array with all the words in the string.

```php
$str = "aaa bbb ccc 123 ddd";

print_r(str_word_count($str, 1));
```

The output is:

```
Array ( [0] => aaa [1] => bbb [2] => ccc [3] => ddd )
```

If you want `123` to be considered as a 'word' and extracted from the string, relevant characters need to be specified in the third parameter of the function.

```php
print_r(str_word_count($str, 1, '0..9'));
```

As shown in the above code snippet, because the number range, i.e. from `0` to `9`, is listed in the third parameter, the number `123` is considered as a 'word'. The output is:

```
Array ( [0] => aaa [1] => bbb [2] => ccc [3] => 123 [4] => ddd ) 
```

If you need the numeric position of each word inside the string, you just need to change the third parameter's value to be `2`.

```php
$str = "aaa bbb ccc 123 ddd";

print_r(str_word_count($str, 2, '0..9'));
```

The output is:

```
Array ( [0] => aaa [4] => bbb [8] => ccc [12] => 123 [16] => ddd ) 
```
 
The key of each array item is the numeric position of the relevant word in the string.

Thanks for reading!
To find more programming tutorials, please visit: [CodeBilby.com](https://www.codebilby.com)
Blockchain and How its formed..
Tags: blockchain, web3, beginners
Published: 2022-06-29 20:59:57

💜 **What is Blockchain and How its created??**

Here is a thread......

💜 **What is Blockchain?**

Blockchain is a decentralized system that serves as a public transaction ledger. This was developed in 2008 by Satoshi Nakamoto.

💜 **Now what is a Decentralized System?**

A decentralized system means that not one or any single authority has complete decision making rights.

eg. Our Banks are centralized system because there is one authority i.e. government whose decision may impact our saved money etc.

Now Decentralized system transfers this authority to distributed system and thus the decision making power doesn't reside with one authority or single unit.
In case of Bank it would give the same authority to distributed network thus creating a decentralized system.

💜 **What do we mean by public transaction ledger?**
As per the name goes, blockchain is chain of blocks. Here chain means that blocks are connected together like a chain and  these blocks contains transactions.

💜 **What is block?**
A Block is just a collection of data. These data are encrypted. It contains transaction information from previous block with new transaction information. It will also store few other data like nonce, previous block's address to form a chain with.

This is how a blockchain is formed

**So, let's summarize it then :** 

💜When transactions happen, then these transactions are verified(will go into detail in next POST)
💜There can be many transactions, these transactions together form a BLOCK with some additional required data.
💜These BLOCKS contains encrypted previous transaction with new transaction, They also have previous block's address to form a chain.

The very first block is called as **GENESIS BLOCK** as its previous block's address is null.

This is how a blockchain is formed. There are more details to it like how transactions are verified, what makes this blockchain system so secure or why it takes time for the transaction to go onto blockchain.

Follow me to get more, will be creating more POST for those.
Hello, I am Tanisk Annpurna 

I will be posting about 
🚀web3, Blockchain, Ethereum
🐦Smart Contract, Solidity
🎉Javascript, ReactJS, NodeJS
🍩Other new technologies

Follow and like for more such threads.

!!✌️!!
What's the most useful feature for a DataGrid?
Tags: discuss, javascript, react, html
Published: 2022-06-29 20:59:03

As we're building https://infinite-table.com/ we know the it will be used in ways we haven't imagined yet - so we're developing the component with this flexibility in mind.

However, we're here to ask the community:

### What do you want most from a DataGrid?

### What's one feature that would immediately make you use Infinite Table?
Welcome Thread - v180
Tags: welcome
Published: 2022-06-29 20:58:41

---
title: Welcome Thread - v180
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![Cat saying yo](https://media.giphy.com/media/1wpaCOVdglMSYgjCum/giphy.gif)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
Dev Chats - Take action with Auth0 Actions
Published: 2022-06-29 20:48:38


{% youtube OiVND7X8NUA %}

In this Dev Chats Livestream, [Will Johnson](https://twitter.com/willjohnsonio),  Developer Advocate at Auth0, joins to show  how software developers can easily customize their login experience with Auth0 Actions. You’ll learn how to create a custom Action, monitor your action logs, and also see how to link Auth0 users to Stripe Customers.

## Table of contents
* [00:00:00](https://youtu.be/OiVND7X8NUA?t=000) We’re live!
* [00:04:54](https://youtu.be/OiVND7X8NUA?t=294) -  Introductions
* [00:08:30](https://youtu.be/OiVND7X8NUA?t=510) - Highlights
* [00:10:24](https://youtu.be/OiVND7X8NUA?t=624) - What are Auth0 Actions?
* [00:15:45](https://youtu.be/OiVND7X8NUA?t=945) - Getting setup with the Auth0 and the CLI
* [00:28:00](https://youtu.be/OiVND7X8NUA?t=1680) - Configuring your application
* [00:31:50](https://youtu.be/OiVND7X8NUA?t=1910) - Creating an Auth0 Action
* [00:57:45](https://youtu.be/OiVND7X8NUA?t=3465) - Reviewing action Logs
* [01:00:12](https://youtu.be/OiVND7X8NUA?t=3612) - Recap

## Resources
* [Auth0 CLI](https://auth0.github.io/auth0-cli)
* [Stripe Setup Intents](https://stripe.com/docs/payments/setup-intents)
* [Dev Chats live playlist](https://stripe.com/docs/videos/dev-chats-live)

## 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
* 📺 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)
Next.JS - little decorator (Higher Order Function) to handle Prisma errors
Tags: prisma, prismajs, nextjs
Published: 2022-06-29 20:39:02

---
title: Next.JS - little decorator (Higher Order Function) to handle Prisma errors
published: true
description: 
tags: prisma, prismajs, next, nextjs
cover_image: https://nextjs.org/static/twitter-cards/examples.png
# Use a ratio of 100:42 for best results.
---

I am quite surprised I couldn't find any generic way to handle exception from `prisma` client, so I wrote my own decorator.
I am just starting learning Next.js, so my approach could be very naive though, let me know if you see any improvements here. 

It hides the error details for any other environment than `dev`.

```typescript
import { NextApiRequest, NextApiResponse } from "next";
import { isDevEnv } from "./common";
import { Prisma } from "@prisma/client";

export function withPrismaError(request: (req: NextApiRequest, res: NextApiResponse) => unknown) {
  return async function (req: NextApiRequest, res: NextApiResponse) {
    try {
      await request(req, res);
    } catch (e) {
      if (e instanceof Prisma.PrismaClientKnownRequestError) {
        const errorResponse = {
          error: isDevEnv ? `${e.code} ${e.message}` : "prisma_error",
        };

        return res.status(503).json(errorResponse);
      }

      return res.status(503).json({ error: true });
    }
  };
}

```

and the usage:

```typescript
export default withPrismaError(
  async function handler(req: NextApiRequest, res: NextApiResponse) {
    const { email, password, url } = req.body;

    await registerUser(email, password, url);
    res.status(200).json({ success: true });
  }
);
```

PS. ...and "hello guys", apparently today I am transitioned from "lurker" to blogger!
Material Design 3 - Dynamic colors by Beercss
Tags: css, javascript, html, tutorial
Published: 2022-06-29 20:19:22

## Overview

Color is used to express style and communicate meaning. With dynamic color, Material puts personal color preferences and individual needs at the forefront of systematic color application.

## Dynamic color

Dynamic color describes the capability of variable color sources to remap system UI and in-app color experiences.

The color system enables apps to respond to user preferences and dynamic conditions, such as wallpaper selection or in-app content (such as music and video thumbnail art.)

## Accessibility

Dynamic color is designed to meet accessibility standards for color contrast. The system of tonal palettes is central to making any color scheme accessible by default. 

In a dynamic color scheme, colors are paired based on distance in tone so that contrast requirements are met regardless of changing hues.

## Okay but, how to apply dynamic colors on Beercss?

I'm really excited to show how easy this can be. I developed a codepen here https://codepen.io/leo-bnu/pen/LYWxjVG. Basically It has two steps:

1) Write your html without any color on elements.

2) Call a js function to set a theme or mode.

``` 
// to get/set theme
await ui("theme", "url|path|color|file|blob");

// to get/set mode
ui("mode", "light|dark");
```

And just let the framework do the job for you. Try out.

Have a nice day! 🍺🍺🍺
Kubeclarity – SBOM & vulnerability detection
Tags: kubernetes, security, devops
Published: 2022-06-29 19:35:36

KubeClarity is a tool for detection and management of Software Bill Of Materials (SBOM) and vulnerabilities of container images and filesystems. It scans both runtime K8s clusters and CI/CD pipelines for enhanced software supply chain security.

[Kubeclarity](https://sectool.co/blog/kubeclarity-sbom-vulnerability-detection)
How to do API Automation using Axios, Mocha, Chai and JavaScript
Tags: axios, mocha, chai, javascript
Published: 2022-06-29 19:30:47

How to do API Automation Testing using Axios, Mocha, Chai and JavaScript? In this course, I’ll walk you step-by-step to build your API Automation framework.

{% embed https://www.youtube.com/playlist?list=PL3IwAics3J0dc9Yav3MMqUlq6RmdC5-I_ %}

**We will be covering the following topics:**
Tutorial 1 - Introduction - https://www.youtube.com/watch?v=q7uOGtmd11g
Tutorial 2 - Initialize the project & install npm packages - https://www.youtube.com/watch?v=jXOkXeXwlyk
Tutorial 3 - Create .gitignore file - https://www.youtube.com/watch?v=IJvSWax7Guk
Tutorial 4 - Calling A GET API - https://www.youtube.com/watch?v=juTx72aNNLg
Tutorial 5 - Calling A POST API - https://www.youtube.com/watch?v=qH1hCU1cHpE
Tutorial 6 - Calling A PUT API - https://www.youtube.com/watch?v=kXvA_l7giFI
Tutorial 7 - Calling A PATCH API - https://www.youtube.com/watch?v=qmmZ0k42EZA
Tutorial 8 - Calling A DELETE API - https://www.youtube.com/watch?v=bI_TRt5XNUM
Tutorial 9 - Test Suite Execution - https://www.youtube.com/watch?v=xvm6f540I0A
Tutorial 10 - Generating HTML Report - https://www.youtube.com/watch?v=17HHB9fbiHU
Tutorial 11 - Write data to JSON file - https://www.youtube.com/watch?v=1TuckfRn-Ys
Tutorial 12 - Read properties file - https://www.youtube.com/watch?v=i4uvsjovHVQ

👍 You can follow my content here as well -

[Website](https://www.codewithmmak.com/)
[GitHub](https://github.com/codewithmmak)
[LinkedIn](https://www.linkedin.com/company/codewithmmak)
[Twitter](https://twitter.com/codewithmmak/)
[Facebook](https://www.facebook.com/codewithmmak)
[Instagram](https://www.instagram.com/codewithmmak/)

...

I love coffees! And, if this post helped you out and you would like to support my work, you can do that by clicking on the button below and buying me a cup of coffee -

[Buy me a coffee](https://www.buymeacoffee.com/codewithmmak)

You can also support me by liking and sharing this content.

Thanks for reading!
How the Nigerian Bazaraki Car Theft Scam works
Tags: security
Published: 2022-06-29 19:29:21

Bazaraki is a very good website in Cyprus for people selling cars and other stuff. Unfortunately, it's been infected with cockroaches, more specifically people trying to steal your stuff, often cars, which ends up being sent to Nigeria or other African republics, for then to being sold to the highest bidder. The theft works as follows.

1. They contact you on WhatsApp and ask you if the object is still for sale having seen your Bazaraki ad
2. They tell you they're in Indiana (or some other place) and that they'll send a courier to pick up the car/object
3. They want to pay in advance, and asks you for your bank account number such that they can pay you immediately
4. They send you a _fake receipt of payment_, and sends a _"courier"_ to pick up the object you're selling. The courier is typically an African male, often a junior member of the mafia organisation, and always an illegal immigrant in the _"host country"_
5. You're told the money is on the way to your bank account, and you've seen the receipt, so you've got no reasons to doubt it, so you give away your car or whatever it is you're selling to the _"courier"_
6. Before 3 days passes and you realise you've been ripped off, the car is already in Africa
7. If you somehow find the _"courier"_ and he is arrested, he can say he was just a courier and that you need to bring up your issues with Mrs. Saunders

The above is basically a variation of the _"Nigerian prince scam"_. It's being run by a professional mafia organisation, often with illegal immigrants in the destination countries, doing their dirty deeds, and they've existed since the 1950s. Then comes the question; How do I know? Because they've tried to steal my car **TWICE**. Well, this time they tried to steal from the wrong guy ... ;)

I will send a link to this article to the police of the Republic of Cyprus, Bazaraki, and I'll share it as wide as I can, because _this needs to stop, and it needs to stop NOW_!

The way to stop it, is to create _"honey pot objects"_ for sale at Bazaraki, for then to send them IBAN numbers as they contact the buyer, and wait for the _"courier"_ to show up. Just toss this _"courier"_ in the darkest holes you've got in RoC for a couple of months, to thoroughly make him suffer before you ship him back to Nigeria, such that he'll warn his friends to _never go to Cyprus_. Within a couple of weeks, you'll have deported some 30+ illegal immigrants, and criminal thugs, and the island will be quite safe again ^_^

> Quite simple in deed once you think about it :)

For more details, watch the video below where I explain the mechanics in details ...

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

Psst, I will send a link to this article to the guy in Nigeria trying to steal my car, just in case the police doesn't care, and I need to make him _"leave the island voluntary"_ ... ;)
Do Bored Apes Have Tails?
Tags: nft, blockchain
Published: 2022-06-29 19:28:08

Everyone is wondering if their Bored Ape has a tail???  I am here to eliminate any confusion on the matter.  No, apes do not have tails, Bored Apes do not have tales, NFT apes do not have tails.  If they did have a tail, they would be a monkey.
Kids & Coding
Tags: beginners, devdiscuss, kids, teaching
Published: 2022-06-29 18:37:14

---
title: Kids & Coding
published: true
description: 
tags: beginners, devdiscuss, kids, teaching
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rf8tndw6h5d98degvpk7.png
---

The season 9 finale of DevDiscuss is here! Thank you so much for joining us over the past seven episodes. We hope you've enjoyed exploring a handful of burning topics in software development with us. 

In this episode, we talk about introducing children and teens to coding with Jon Mattingly, co-founder and CEO of Kodable, and Pete Ingram-Cauchi, CEO of ID Tech.

## Listen on Apple Podcasts

{% embed https://podcasts.apple.com/us/podcast/s9-e8-how-to-introduce-coding-to-your-kids/id1513053883?i=1000568109816 %}

## Listen on Spotify

{% embed https://open.spotify.com/episode/2SC4KNTlUssS4CoemRLoyr %}

## [Or listen right here on DEV](https://dev.to/devdiscuss/s9e8-how-to-introduce-coding-to-your-kids)

***

We hope you enjoy the season 9 finale of DevDiscuss! Let us know your thoughts in the comments below.
Google Chrome Logo | Pure CSS
Tags: codepen, css, showdev, tutorial
Published: 2022-06-29 18:36:02

In today’s tutorial, I finished creating a Google Chrome logo with CSS. Simple css code for this iconic staple. Though this is just a fun tutorial, you can practice CSS art to improve your CSS skills. CSS art has been a fun way for me to learn new properties and improve my CSS skills. I have a bunch of CSS art tutorials that are CSS inspired. You can check them out [here](https://codepen.io/rembertdesigns).

For this tutorial, all we need is some basic HTML and CSS.

{% codepen https://codepen.io/rembertdesigns/pen/OJvPJzN %}

If you liked this post, make sure to follow me on [Twitter](https://twitter.com/RembertDesigns) where I post daily about Tech related things!

https://www.buymeacoffee.com/rembertdesigns

### 🌎 Let's Connect

- [Portfolio](https://www.rembertdesigns.co/)

- [Twitter](https://twitter.com/RembertDesigns)

- [Github](https://github.com/rembertdesigns)

- [Codepen](https://codepen.io/rembertdesigns)

- [LinkedIn](https://www.linkedin.com/in/rrembert/)
Virtual Pet Fish - Progress update 29th June
Tags: javascript, beginners, programming, webdev
Published: 2022-06-29 18:35:39

First of all, I tried to recreate the original QBasic version as it would have appeared in the DOS Prompt all those years ago. But with HTML and CSS. I probably could have made it with Bash, but learning Bash just for a screenshot felt like more hassle that necessary.

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

This was as close as I could get to a visual of what the old game looked like. Cheap and easy and actually strangely exciting for 12 year old me.

And I spent the majority of my time today trying to get the thing to look somewhere close, whilst being useable and not just ascii. I think i have something. It looks old school, but I think it will do everything i need it to. Ladies and gentlemen, I present, Fish Tank v2


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

It's not sparkling or anything, but I like it so far. I have made a grid of 24 squares by 8 squares that the fish will move around on. I arranged them with flexbox and I sort of have an idea of what I will do to make the fish move around. But I don't want to say too much about it in case I mess it up and have to start again. Essentially the shape of the fish is made up of 5 styled classes, the body, the head, the head curve (so it doesn't look too much like an orange pill), the tail and the tail curve. The fish will be placed by adding the class to the fish tank grid cells and when it moves, taking that class away. 

I also realised that I would need to make another version of the fish that faces to the left, for when it swims to the left. 

I feel strangely proud of the thing.

Also, I have decided to name the fish Bread after a fish that I had at university. But also, the food that it eats will be slices of bread. So I don't know if that's going to be too confusing.
Guia rápido: Comunicação não-ofensiva na revisão de Pull/Merge Requests
Tags: codereview, github, gitlab, pullrequest
Published: 2022-06-29 17:52:13

---
title:  Guia rápido: Comunicação não-ofensiva na revisão de Pull/Merge Requests 
published: true
description: Quer melhorar a comunicação com seu time e a qualidade das interações?
tags: codereview, github, gitlab, pullrequest
canonical_url: https://wevtimoteo.medium.com/guia-r%C3%A1pido-comunica%C3%A7%C3%A3o-n%C3%A3o-ofensiva-na-revis%C3%A3o-de-pull-merge-requests-d335f475941b
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---
Quer melhorar a comunicação com seu time e a qualidade das interações?

### Pare de comentar emojis ofensivos ou negativos, como 🤢, 🤮, 😵, 😱, 💩,🙈

Comece a explicar porque aquilo pode ser ruim e/ou prejudicial para base de código.

### Pare de fazer comentários com um único emoji como ✂ ou 🔫

Comece a explicar porque algo deve ser removido, além de só utilizar emojis e esperar que a pessoa que abriu o PR entenda o que você quis dizer.

### Pare de pedir para refatorar trechos de código sem dar exemplos

Comece a utilizar o bloco `suggestion` que mostra uma pré-visualização do que você está propondo (além da possibilidade de fazer um commit com `Co-authored-by` direto pela interface do GitHub).

### Pare de ignorar refatorações ou melhorias realizadas pela pessoa que trabalhou no código

Comece a parabenizar ou comemorar quando alguém consegue fazer esse tipo de melhoria no contexto de modificações que a pessoa está trabalhando.

### Pare de apenas comentar no PR e não voltar para responder quando acontece alguma interação com seu comentário

Comece a configurar e utilizar as Notificações para ser avisado quando alguém interagir com seu comentário.

`#protip` mencione o nome de usuário para quem você quer que seja notificado ao responder comentários.

✅ 🎉 ! Você tem alguma dica para melhorar as interações nos Pull/Merge Requests?