teleren/devto huggingface dataset:
PHP trim() function: Remove characters from string
Tags: tutorial, beginners
Published: 2021-09-20 11:47:13

In this tutorial, we look at the PHP trim function. We look at how you can remove whitespaces and characters from a string using the trim function in PHP.

This tutorial is a part of our initiative at [Flexiple](https://flexiple.com/), to write short curated tutorials around often used or interesting concepts.

## Table of Contents - PHP Trim:
- [What does trim do?](#what-does-the-php-trim-function-do)
- [Code and Explanation](#code-amp-explanation)
- [Closing thoughts](#closing-thoughts-php-trim)

## What does the PHP trim() function do?
The `trim()` function in PHP removes whitespace or any other predefined character from both the left and right sides of a string.

`ltrim()` and `rtrim()` are used to remove these whitespaces or other characters from the left and right sides of the string. However, making use of just the `trim()` function without specifying ‘l’ or ‘r’ removes characters from both sides.

## Code & Explanation:
In this section, we look at the various syntax, parameters, and return values used in the `trim()` function. Post that we look at a code snippet using the `trim()` function.

### Syntax:
```php
trim($string, $charlist)
```
### Parameters
- **$string** - Required. This is the string or the variable containing the string from which you want to remove whitespaces or characters.
- **$charlist** - Optional. This parameter specifies the character that needs to be removed from the string. If left empty, all the characters mentioned below would be removed.
    - `“\0”` – NULL
    - `“\t”` – tab
    - `“\n”` – newline
    - `“\x0B”` – vertical tab
    - `“\r”` – carriage return
    - `” ”` – ordinary white space
### Return Value:
A modified string with whitespaces or the specified characters removed from both sides is returned.

### Code using PHP Trim:
```php
<?php
// PHP program using trim() 
  
$str = "  Hire freelance developer ";
  
// Since a second parameter was not passed
// leading and trailing whitespaces are removed
echo trim($str);
?>
```
The output for the above code snippet would be as follows:
```
Hire freelance developer
```
Now let’s look at a case where we pass a second argument.
```php
<?php
// removing the predefined character 
$str = "Hire freelance developer";
echo trim($str, "Hir");
?>
```
The output for this code snippet would be the following:
```
e freelance develope
```
As you can see the “hir” from “Hire” and the “r” from “developer” were removed.

## Closing thoughts - PHP trim():
There are no caveats as such while using the PHP trim() function. I would recommend practicing the `trim()` method as it can get tricky at times. Also, try using the `ltrim()` and `rtrim()` both these functions have very specific use cases.
I built a social network for developers to showcase their projects
Tags: showdev, nextjs, react, javascript
Published: 2021-09-20 11:45:13

TL;DR: [Driwwwle](https://driwwwle.com) is an open-source social network to showcase your projects with like, comments, notifications, profiles and real-time chat.

As developers, we like to look out for new and exciting projects or products. However, finding them is not the easiest task out there. Sure, you can scroll through GitHub's trending section to find a lot of awesome products but what if it is closed source?

Things aren't so hard for designers though. They can visit a website like Dribbble or Behance and enjoy the thousands of creative designs easily. What if we had something like Dribbble, but for developers?

## Introducing Driwwwle

{% youtube WVLHpSwEmYE %}

Driwwwle is a social network for developers to showcase their projects or products with other developers across the globe. Just like any other social network out there, you can like posts, save them privately, leave a comment and follow your favorite developers to build your own personal feed.

Some of the other features include:

⚡ Server-side rendering with Next.js
🍪 Cookie-based authorization with JSON web tokens
📜 Infinite scrolling feed with React Query
🖼️ Cloud image upload with Cloudinary
❤️ Like, save, and comment on posts
💬 Realtime chat with Socket.io
🤝 Follow developers and build personal feed

and a lot more..

Sounds interesting? I would love for you to create an account on [Driwwwle](https://driwwwle.com) and post your awesome creations.

Did I mention that Driwwwle is also open-source? You can browse through the code on this GitHub repo:

{% github itsnitinr/driwwwle-v2 %} 

## Some more screenshots

A picture speaks a thousand words but more importantly, I hope it excites you enough to give Driwwwle a try. Here are some screenshots, thanks to [MockupBro](https://mockupbro.com/) for the awesome mockups.

![Landing Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r1ylr51nj7q2u3iblrbr.png)![Add New Post](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k4lrx08hg7a1pk5uta5q.png)![Search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lgifm57m1dpu7qgthjk.png)![Feed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dhncxpfe4lk6snn13qmd.png)![Posts & Profile page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wm1iq8yf2gpyqeg0r8e.png)

## Suggestions and feedback welcome!

Driwwwle is in its initial stages at the moment and I would highly appreciate any feedback, suggestions and questions you would like to provide. What features would you like to see? What seems unnecessary or what's causing difficulties? 

Thank you for your time and I await to see your posts on Driwwwle soon. Until then, have a nice day!
How does your Team start a Sprint?
Tags: teamwork, softwaredevelopment, agile
Published: 2021-09-20 11:47:18

---
title: How does your Team start a Sprint?
published: true
date: 2021-09-20 11:44:30 UTC
tags: teamwork,softwaredevelopment,agile
canonical_url: https://medium.com/chingu/how-does-your-team-start-a-sprint-ce5f35a9827
---

#### Sprint 4 — Monday

![](https://cdn-images-1.medium.com/max/1024/1*iR4x1p4NSEWPDoLOHg5idg.jpeg)<figcaption>Photo by <a href="https://unsplash.com/@airfocus?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">airfocus</a> on <a href="https://unsplash.com/s/photos/planning?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption>

Achieving your Sprint goals directly depends on what you do at the start of the Sprint. As you can probably guess your sprint should start by:

1. **_Review_** tasks from the previous Sprint and update your Product Backlog so you know which tasks were completed and which need to carryover to this Sprint.
2. **_Reflect_** on how the team worked & on your teamwork to identify what worked, what didn’t work, and what you’ll do to improve.
3. **_Decide_** which tasks from the Product Backlog will be worked on in this Sprint, including those that weren’t completed in the previous Sprint
4. **_Commit_** to posting status daily, even if there’s no progress, and asking for help when it’s needed.

> You don’t know what you don’t know until you know it!

Sprint plans are great, but you will need to be flexible and adapt them throughout the Sprint. Your plan and your team shouldn’t be rigid or resist change, you should embrace it because at the time you create any plan you don’t know what you don’t know!

This is the beauty of following an Agile methodology — it is based on _having a plan_ for each Sprint, _accepting_ that change will occur, & _adapting_ to it.

![](https://cdn-images-1.medium.com/max/355/1*Y0cTIRBlW1Qs4sKuwU9GAw.png)

### Before you Go!

Chingu helps you to get out of “_Tutorial Purgatory_” by transforming what you’ve learned into experience. The experience to boost your Developer career and help you get jobs.

You can learn more about **Chingu** & how to join us at [https://chingu.io](https://chingu.io/)

* * *
What are Step Functions?
Tags: stepfunctions, statemachines, aws, javascript
Published: 2021-09-20 11:39:48

---
title: What are Step Functions?
published: true
description: 
tags: stepfunctions,statemachines,aws,javascript
//cover_image: https://direct_url_to_image.jpg
---

{% youtube yn7LTR1yKOw %}
Laravel 8 Multi Auth (Authentication) Example Tutorial
Tags: laravel, laravel8
Published: 2021-09-20 11:26:05

Hi Artisan,

In this Article I will share something new about how actually work multi auth (authentication)integrate with laravel 8.I will create multiple authentications using middleware.

First of all i will exaplain previous example how to create simple authentication using laravel-ui you will learn this first follow this article

So, in this example i will create two simple authentication one for main admin and another is all user.

Here, laravel 8 multi auth tutorial, multiple authentication in laravel 8, implement multiple authentication in laravel 8, laravel 8 multiple authentication using middleware.

More...
https://www.mywebtuts.com/blog/laravel-8-multi-auth-authentication-example-tutorial
Hello, Programming!
Tags: jadujobs, programming
Published: 2021-09-20 11:15:20

A kid with a pure science and humanities background, currently fully immersed in the world of wires and everything else that comes with majoring in Electrical Engineering, what is she doing here, you ask? Well I got struck by some magic! And I am here to tell you about it!

It's definitely not the kind of magic we ae used to seeing in Disney movies but I promise you it's real and even more fun. JaduJobs- which literally translates to MagicJobs has become the foundation stone for my career in tech. But what really is JaduJobs and what does it offer?

It is a rigorous five month long fellowship which helps enhance your technical and soft skills to kickstart one's career in technology and build long lasting friendships, all while being remote!

With only a few weeks into it I have already gotten exposed to the  basics of programming and various mentors serving as industry leads during the soft skill sessions. Not to lie, the world of programming with all its terminologies and technologies does seem daunting to me right now, but that has not hindered my excitement to learn new and captivating skills. So follow me as I delve into the vast and super fun world of programming. As programmers say, Hello World! I'd take the opportunity to say Hello, Programming!
Please be nice to me :)
Ask DEV - What are your less well known tips for cleaner, better JavaScript/TypeScript?
Tags: javascript, typescript, code
Published: 2021-09-20 09:43:22

---
title: Ask DEV - What are your less well known tips for cleaner, better JavaScript/TypeScript?
published: true
description: 
tags: javascript, typescript, code
//cover_image: https://direct_url_to_image.jpg
---

We've all seen object destructuring, using prettier and eslint, but what else should we look into? What are your less well known tips for cleaner, better JavaScript/TypeScript?
Prank Sms Bomber
Tags: python, automation, api, heroku
Published: 2021-09-20 09:39:00

A simple Prank SMS Bomber API using python and Fast API framework. This is only for educational purpose. One of my early projects.

Source Code - https://github.com/Devn913/bomber_API

Deployment - https://bomberapi.herokuapp.com/docs

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xuhvyve8638eox55xkd.png)

How to use?

1. Open the deployement link
2. Go to Bomb
3. Press "Try it out"
4. Write down the number and number of messege.
5. Press Execute
 
Did you like it?  A star on the repo will do the thing.
What's new on VLC for Android 3.4
Tags: android, opensource
Published: 2021-09-20 09:38:42

This major release is the fourth update of VLC 3. 

## New features

#### Bookmarks

You can add bookmarks to your media. It's really useful for your podcasts, audiobooks or even your courses.

![device-2021-09-15-135743](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vjr52dk0d956zey7wkvs.png)

#### Permissions

It's now possible to use VLC without granting it the file permission. If you're only watching streams or network media, you can now use it!

## Interface changes

#### Improved audio player

The audio player has been given some love! This new modern design puts the content at the center.

![device-2021-09-15-121406](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nq6ubqesudaw5c71m5k2.png)
![device-2021-09-15-121426](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ho5hxmbuy9cfjnawu6k.png)

#### Improved first experience

We improved the onboarding experience with a clearer workflow.

![device-2021-09-15-114819](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ptyavwwf7o46dng8oe4o.png)

We also added a welcome workflow on Android TV

![device-2021-09-20-094506](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mfj0ydr5ssxauxff658l.png)
 
 
As the last few versions changed VLC's look and feel a lot, we also updated the tips that are shown the first time you use the audio and video players.

![player_tips](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kidd9feoguax07s9uwyy.gif)
 
It has never been that easy to start using VLC.

#### New in Android Auto

The Android Auto navigation has been completely reworked. It's easier and quicker to browse and play your library!

![home](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2thi4ltkt469ym2nyoqo.png)

![library](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hmx15thojos1tngunheg.png)
  
Beyond that, some other changes have been made:

- Search a media 
- Play streams or playlists
- More media info is displayed
- Improved pagination
- Improved cover synchronization
- Performance improvements

#### Clearer video list

The video list design has been changed to make it more readable.

![device-2021-09-15-125213](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ia8dpkzgphltt8cgijb.png)

## Under the hood

A lot of fixes and improvements have been made on the cover generation, the playback and the media group management.
Using Socket.io in express-generator.
Tags: codenewbie, node, tutorial, beginners
Published: 2021-09-20 09:34:06

Socket.io has documentation on how to use it with express but it a bit tricky to use socket.io with express-generator because the server is created in www file and the io is created in app or server but the use of io is in the router .So how can you use socket.io in express-generator ?  
           Its very simple you can create a new file as mysocket and create instance of io over there and export it.
##In the mysocket file.
> ```
let socketIo = require('socket.io');
let io = socketIo();
let socketApi = {};
socketApi.io = io;
module.exports = socketApi;
```
##In the www file 
> ```
var server = http.createServer(app);
socketAPI.io.attach(server);
```

So, you can import io from mysocket file into the router and use it.
If you have anything to add you can leave a comment.
Website by Go
Tags: go, webdev
Published: 2021-09-20 09:31:24

I have run a couple of Drupal and WordPress sites for several years. I always had a hard time understanding the logic behind these tools as soon as I could do anything but add a plugin. 

So it was refreshing to test Go to create a website. Go html templates have a touch of Angular and an ounce of React, but way simpler and above all faster.

I still consider myself as a beginner both using Go and Web developing. The Go part of this website is about 10 MB of compiled code replacing both Apache, Nginx and frameworks.

As there are a few tutorials about Go as a web "framework", I decided to document my efforts. And the result is in this mini tutorial: https://static.go4webdev.org

Any feedback is welcome!
Make Spam bot in Python in just 6 lines
Tags: python, computerscience
Published: 2021-09-20 09:22:03

1 Hello 👋
In this post I will show you how to make simple spam bot in Python in just 6 lines of code.

#### BTW you can watch video tutorial here:
{%youtube ZvyEpkrTGKM %}
####So let's Start ▶️

First we need to install Pysimplegui library, we can do it by running this command
```
 pip install pysimplegui 
```

Next, we need to import pysimplegui and time library. We can use this code
```python
import pysimplegui, time
```

Now let's make a program for spamming.
First we need add a timer, because you will need some time to go to Instagram or something.
Then we need ad a whole loop for the spamming functionality
Here is the code:
```python
time.sleep(5) #delay for 5 sec
while True: #endless loop
  pyautogui.write("heyy")
  pyautogui.press("enter")
  time.sleep(0.2)
```
That's the whole code you need to Spam your friend.
##### Thanks for Reading this post. I hope you learned something new. See you 👋
What and Why Next.js and TailwindCSS?
Published: 2021-09-20 09:11:39

---
canonical_url: https://blog.avneesh.tech/what-and-why-nextjs-and-tailwindcss
---


**Hey folks 👋🏻,**

If you have seen my past articles then you must have seen that many of the articles are related to [Next.js](https://nextjs.org/),  [React](https://reactjs.org/), or  [Tailwind ](https://tailwindcss.com/) but I never really explained what they exactly are, so I have decided to write an article on that today!

![started](https://c.tenor.com/r3XdvPsAV3kAAAAC/despicable-me-minions.gif)

### What is Next.js?
 [Next.js](https://nextjs.org/)  is a production-ready framework for the javascript library React. Next.js provides us many features on top of the amazing library [React](https://reactjs.org/).

### Why use Next.js? 

- ServerSideRendering and Static generation hybrid
- Easy file system routing
- Better SEO
- Image Optimization


### What is  React?
React is an open-source Javascript library built by Facebook and it is used for building user interfaces or UI components.

### Why React? 
- Great performance
- Easy to learn
- Easy to test
- Simple


### What is TailwindCSS?
TailwindCSS is a CSS framework that allows us to write CSS directly inside our HTML. It is a utility-first framework and highly flexible unlike some others like Bootstrap. The long classes can be opinionated but it is worth a try.

### Why use Tailwind?
- Superfast
- Easily make apps responsive
- Helps to maintain a design system
- Tiny in production
- Easy dark mode

**Useful links -**

[Nextjs](https://nextjs.org)

[React](https://reactjs.org/)

[TailwindCSS](https://tailwindcss.com/)

[All socials](https://avneesh-links.vercel.app/)
JWT validation with JWKs in Node.js
Tags: jwks, node, javascript, jwt
Published: 2022-11-01 06:38:16

---
title: JWT validation with JWKs in Node.js
published: true
date: 2021-09-20 09:11:23 UTC
tags: jwks, nodejs, js, JWT
canonical_url: https://mojoauth.com/blog/jwt-validation-with-jwks-nodejs/
---

What is a JWT? JSON Web Token (JWT) is an open standard that defines how to transmit information between two parties in a compact and self-sustained way. This information is highly trusted and verified as it is signed digitally. JWTs use a public/private key pair or a secret for signing. The advantage of JWT is in its feature; it just needs a simple cryptographic operation. The client needs to access the public/private key pair used for signing the JWT, and he can validate it using that key pair.

[Read On](https://mojoauth.com/blog/jwt-validation-with-jwks-nodejs/)
How to deploy streamlit app to Heroku
Tags: python, streamlit, heroku
Published: 2021-09-20 09:00:44

Hello everyone,
This is a step by step tutorial about how to deploy your Streamlit app to Heroku.

## What is streamlit?
Streamlit is an open-source python framework for Machine Learning and Data Science teams and individuals.
See it yourself: [https://streamlit.io](https://streamlit.io)
You can deploy your app using streamlit sharing, but the problem is that you only have 3 apps with the free version.

So what you will see now is how you can deploy your app to Heroku

## Requirements:
- <code>python</code> installled
- <code>streamlit</code> installed
 (You can install streamlit using <code>pip install streamlit</code>)
- [GitHub](https://github.com) account

Once the above are installed


You can check their [documentation](https://docs.streamlit.io/en/stable/) about creating you app.


### And now it's time to deploy 🎇
You need to add 2 additional files to your project.
1- You need to add a **setup.sh** file which is used to add shell commands inside the file.
```sh
mkdir -p ~/.streamlit/
echo "\
[server]\n\
headless = true\n\
port = $PORT\n\
enableCORS = false\n\
\n\
" > ~/.streamlit/config.toml
```

Then add a new file called **Procfile** and inside it paste the following code:
```
web: sh setup.sh && streamlit run app.py
```

And finally a **requirements.txt** file
```
streamlit
matplotlib
numpy
pandas
```
and the other packages that you are using in your app.

Now head over to [GitHub](https://github.com) and create a new repository and publish your code to github. You can check this [article](https://medium.com/singapore-rails-learning-group/how-to-push-your-code-to-github-and-publish-your-first-page-8b0e1f4caf2a) to see how you can do that.

Once the code is on GitHub head over to [Heroku](https://heroku.com) and create a new app:
![Create a new app on Heroku](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y8cqgbnnsvvvo8sgepor.png)

Choose a name to your app and click "**Create app**"

![Heroku - create a new app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/luevxt316fhugf8mes6b.png)


You can leave the pipeline empty for the time being and choose "GitHub" as your deployment method.
And in the **Connect to GitHub** section choose your username/org, type the name of the repository and click search. After you click search you can see the repo, click on the **Connect** button next to the repo.
![Heroku - choose deployment method](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kpqhsz4y7lv14zi2v6ci.png)

Once you click connect you can see at the end of the page The **Manual deploy** section. Just click Deploy Branch and watch the magic happen.

Once the deployment is finished you can check your app **app-name**.heroku.com.
In this case we chose **streamlit-heroku-app** as our app name so if you need to navigate to streamlit-heroku-app.heroku.com to see the deployed streamlit app.

![Heroku - manaul deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zanl8gtpwrieb84epafj.png)

*Note: the app is no longer available on heroku*
Create an NPX CLI Portfolio under 5 minutes
Tags: npm, portfolio, template, node
Published: 2021-09-20 08:56:34

![npx-cli-portfolio.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1632121300335/gd5ezLkxf.gif)

Want something like this? This is the article you are looking for. Let me show you how you can make an NPX CLI Portfolio under 5 minutes

# How I made it
I am mainly using [React Ink](https://github.com/vadimdemedes/ink) for this project. I have also written a [Getting started with React Ink](https://blog.anishde.dev/getting-started-with-react-ink) article which you can check out. The goal was to make a portfolio that can be viewed in the terminal. At first, I just did a console log which logged out information about me but once I found out about React Ink, I thought of using that and making it better. The advantage of using React Ink is that it is way more flexible than simple console logs and hence I was able to put custom colors (theoretically you can apply a color to a console log but options are quite limited). Using React also allowed me to make a reusable component and hence the number of fields showing up and the contents are dynamic, based on a `data.json` file.

# How you can make it as well
I have made a template in GitHub (which you can find [here](https://github.com/AnishDe12020/cli-portfolio-template)) which you can use. You can find a detailed guide [here](https://github.com/AnishDe12020/cli-portfolio-template#how-to-use-this-template).

# Things to keep in mind
- If someone has already made a package with the same name on NPM, then you need to choose something else
- NPM version 5.2 is needed at a minimum to use NPX (it can be used as a standalone package though)