teleren/devto huggingface dataset:
View embedded videos from youtube, vimeo and google drive
Tags: tutorial, php, youtube, vimeo
Published: 2022-10-04 19:13:25

I had to make a small adjustment that was necessary that whenever the user entered a new url, I would adjust it to the valid format of youtube and vimeo, and in that I thought it takes a little work, so to make the next one easier, I'll leave the code ready here.

## CODE
### FrontEnd

For the interface you can just use the html `iframe`

```html
<iframe width="100%" height="460" 
src="{{url}}"
title="Video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
```

_💡 NOTE: In the src property is where we apply our formatted URL_

### BackEnd

For the back end you just need a simple method.
```php
public function formatUrl($url)
{
        $urlParse = parse_url($url);
        // Extract id from youtube url
        if (strpos($urlParse["host"], 'youtube') !== false) {
            if (isset($urlParse["query"])) {
                parse_str($urlParse["query"], $query);
                return "https://www.youtube.com/embed/" . $query["v"];
            }
            $id = explode("/", $urlParse["path"]);
            return "https://www.youtube.com/embed/" . end($id);
        }
        // Extract id from vimeo url
        if (strpos($urlParse["host"], 'vimeo') !== false) {
            $urlParse = explode("/", $urlParse["path"]);
            return "https://player.vimeo.com/video/" . $urlParse[1];
        }
        // Extract id from google drive url
        if (strpos($urlParse["host"], 'drive.google') !== false) {
            $urlParse = explode("/", $urlParse["path"]);
            $urlParse = array_values(array_filter($urlParse));
            return "https://drive.google.com/file/d/" . $urlParse[2] . "/preview";
        }
}
```

That's it

## Extra

If you want the full php class, follow it below.

{% gist https://gist.github.com/walternascimentobarroso/c763b9f5dce91b0af78c7ed276ca6ece %}

***

## Thanks for reading!

If you have any questions, complaints or tips, you can leave them here in the comments. I will be happy to answer!
😊😊 See you! 😊😊

***

## Support Me

[Youtube - WalterNascimentoBarroso](https://www.youtube.com/channel/UCXm0xRtDRrdnvkW24WmkBqA)
[Github - WalterNascimentoBarroso](https://github.com/walternascimentobarroso)
[Codepen - WalterNascimentoBarroso](https://codepen.io)
More new tech skills - Docker up to the plate. Pt 2
Tags: beginners, docker, architecture, devjournal
Published: 2022-10-04 19:09:59

Ahh, you're back. Good to see you again. What's that? You're anxious to hear more of the tale? Oh, ok - let's get going then, no reason to delay. Where was I.. ahh yes, videos.

That was round 1 of watching that particular set of videos, over the next couple of days I watched them at least 1 more time. Now I felt ready to sit down & work with containers.

Got the Ubuntu laptop out, set my iPad to the side with Chucks Docker video ready to go & started off. Following along with the video - mostly - I did not use the Linode cloud service, I did everything from my own laptop. That meant, of course, I had to do a bit of Googling & reading on how to install Docker on Ubuntu, which was pretty easy. {% embed https://www.simplilearn.com/tutorials/docker-tutorial/how-to-install-docker-on-ubuntu %}

After the setup, I just followed along with NetworkChuck. Using Docker itself was fast, smooth & quite frankly fun! I did have to quickly learn a bit about Linux firewalls as I couldn't get the demo website that I deployed to load from any device on the network outside of my localhost. But hey, it's a learning opportunity & those are always valuable. Once I had that configured, everything worked as expected.

So what was my take-away? Well, I know how to install Docker on Linux, I can deploy & configure containers, I know how to manage/view those containers, & I understand the concepts of how Docker works & why it's so fast (hint: 1 kernel shared with the host OS & the container itself). I also picked up how I can manage the local Linux firewall.

So for the first 3-ish hours I've spent with Docker, I feel rather successful. This isn't the last of my walk with Docker, I'll have 1, maybe 2 more posts to finish off my tale.

Thanks for taking the time to read this. See ya next post!
How I created a website for NGO in less than 24hrs!
Tags: javascript, webdev, beginners, tutorial
Published: 2022-10-04 19:06:33

In this short article, I will share what was my approach on How I created a website for NGO in less than 24hrs?
You can check the Repository here: [https://github.com/VishwaGauravIn/hunger-no-more](https://github.com/VishwaGauravIn/hunger-no-more)

I will try to keep it as short as possible to save your time.

## Approach:

- First of all, I made a list of stuff that can be added to website. Like Images, data, content, etc
- Since I was using NextJS, I tried to decide how many components will be required. Like in my case it was: 
Navbar, Hero, Carousal, Stats, Donate, Testimonials/Review, CoreTeam, About, and Footer
- Then Placing them in a relevant order, this is a part of User Experience (UX)
- Now deciding a theme of website (Colors, style and effects)
- Once you are done with selecting a theme installing all requrired libraries, I like to create a folder structure (which was pretty simple for this project)

   --- components
            |--------- common
            |--------- home
   --- pages
         |--------- api
   --- styles

- Now go ahead and start creating components, starting with common components.
- Make all components responsive and optimise your web app.

## Tech Stack

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

## Preview

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ndaagena5g7vf18ehzso.png)
Why Software Developers Have To Understand the Business & The Product
Tags: architecture, design
Published: 2022-10-04 19:05:43

Yesterday, we talked about the First Tenet of Software Development and some people didn't like it.  They thought it was too simple.  

Let's see what you think about the...

## Second Tenet of Software Development

> Everything the program is supposed to do must be known by the software developer.  

Just as the designer of the board game has to know exactly how the rules work so she can create the game, so too the software developer must know what the program will do so she can create the code.

## Immediately, A Problem Arises 
Here’s the problem. A lot of what we just talked about in the description of the Pac-Man board game seems obvious. It’s the nature of how human brains work. 
 
“Of course you have to roll dice,” someone says. “How else would you know how far to move Pac-Man and the ghosts each time?” How things should be done may seem obvious to one person on the team. Those requirements that seem so obvious may not even be discussed much. The problem occurs later when the obvious assumptions are actually different in various team members’ minds.

### Without Detailed Definition, The Developer Does It His Way 
Maybe the Pac-Man board game doesn’t use any dice. Maybe the ghosts move X units every time. The point is that without the actual explanation and description the game builder (analogous to software developer) may do it however he decides. However, his way may be completely wrong. 

## Designer & Builder: Two Different People = Challenge
If the designer and the builder are two different people, the builder’s decision may be entirely wrong. Furthermore, unless the design element is described properly it may force the developer (builder) to make a decision that she believes is correct. For example suppose the description for movement is something like the following:
 
Each turn, each ghost will move a random number of units in a random direction. 
 
No maximum movement has been defined so now any ghost may move up to infinite units in a direction. So now, the game is created and Pac-Man moves, then a ghost moves infinite units towards Pac-Man and destroys him every time. 
That’s ridiculous. I know. But let’s circle back to the original definition of what Software Developers do: 
 
> Developers write code to turn manual processes into automated processes. 

## Automate the Wrong Process 
Now we are seeing that if the manual processes are not described properly or are not described at all, the software developer (builder) can automate the wrong process.  Or, she can automate the process the wrong way.
 
That’s why an important part of Crafting Software is : **Communication**.

That'll be the subject we'll talk about tomorrow.  
How can a person best communicate what they want built?  It's a real challenge.  This book, The NextLevel Software Developer will detail exact deliverables you will want to provide to create the best communication possible.
Day 8/100: Happy Days
Tags: webdev, 100daysofcode, css, devjournal
Published: 2022-10-04 18:57:19

Happy Days, Happy Days. A bulk of the CSS structure has been finished and the subpar icons that weren't cutting have finally been removed. I was in this position almost 2 weeks ago and I was not happy at all with how the site felt and operated. I then decided to go back to the drawing board and restructure everything from the CSS to the file structure of the site. After a lot of blood sweat and tears, the change has become a success. I love how it feels even if I haven't styled it yet.

I'm so close to the finish line with this website that I searched web hosting today.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zlzf3nud0z2wa7o3eyh4.png)

Happy Days indeed.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t32zn5m87iv9ggvdbq8z.png)
How to create Loom Demos and why!
Published: 2022-10-04 18:50:29

My Flatiron bootcamp is quickly coming to an end. Which means the job hunt has begun!

I have my LinkedIn and Indeed profiles set and my resume touched up. But I wanted to add a little bit of me, a little bit of personality to the job search. So I looked for an app that I could demo my capstone project on .... Enter Loom!

https://www.loom.com/share/e44905695fad453d9e5451a12f14d992

Loom is a quick and easy application that lets you record both your screen and a face cam at the same time. This allows you to get in front of any potential viewers while piloting your application, how you see fit.

You have 2 options when setting up Loom. You can download the desktop app or use a chrome extensions. Once downloaded you can login with either you Google, Apple, Slack or just simply an email. 

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

Once you are logged in, the easy to navigate user interface is loaded (above).

From the home page you can record a new demo and check your library. 

Let's walk through a new demo. Click on the new video button, and the count down begins.


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

Once you start recording you have a utility bar pop up on the left, allowing you to stop, pause or edit your camera options.

My personal advice before starting your recording is to write out a script, with highlights you plan to cover. Take a few minutes to practice your delivery. Then ... have fun and record. Let your passion or personality come through in your demo!

Once you are done recording, the demo goes to you library and the utility of Loom really begins. 


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

You are able to rename your demo, do some light editing or even save a specific thumbnail. You can even see who views you video. But the nicest attribute is the share links available to you.


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

The share menu allows you to create custom links for LinkedIn, Twitter, Gmail, or Facebook. Or you can copy the link and send it via messaging. 

So now you know how to use Loom, but why?

Well short and sweet, you: 

- Get to show your app, your way. Controlling the narrative of how your app comes across to the viewer.

- Get to put your face in front of potential employers, showing you ability to present, speak and interact.

- Add a bit of production value and personality to your resume with a quick Demo Link.

Consider using Loom in your next demo video 😁
AWS Free Tier: the Good, the Bad, and the Ugly
Tags: beginners, cloud, aws, cloudskills
Published: 2022-10-04 18:44:04

What is the AWS Free Tier? What safety nets can you put in place as a developer and what are the most common mistakes to avoid unexpected bills when experimenting with new services with the AWS Free Tier?

In the presentation I will cover the good, the bad and the more challeging parts of the AWS Free Tier, an amazing option to gain free, hands-on experience with the AWS platform, products, and services. But a risky one as well.

Enjoy!
Notion API just for certain Pages
Tags: notion
Published: 2022-10-04 18:34:52

I am trying to build an API Integration for Notion, so I created myself an API Key for my workspace on https://www.notion.so/my-integrations. However I am wondering, how do I limit this API key so that it only has access to certain pages? If I am calling Notion API from the Frontend with this key I would not want to grant the user access to my whole workspace. Any workarounds?

Thanks and best regards
Clear Cache After Create .gitignore
Tags: github, git
Published: 2022-10-04 18:34:00

## My Problem
I commit and push venv to github and I want to remove them from Github

## My Solution

Use This code

```
git rm -r --cached venv
git commit -m 'Remove the now ignored directory "venv"'
git push origin master
```

---

## Reference

- [stackoverflow.com](https://stackoverflow.com/questions/7927230/remove-directory-from-remote-repository-after-adding-them-to-gitignore)
Feature release 1.32 of Date::Holidays Perl distribution
Tags: perl, release, cpan, opensource
Published: 2022-10-04 18:09:19

---
title: Feature release 1.32 of Date::Holidays Perl distribution
published: true
description: This is an adapter class for the Date::Holidays:: namespace and other things holiday
tags: perl, release, cpan, opensource
---
Due to a contribution from Wesley Schwengle (waterkip) I am happy to announce release 1.32 of the [Date::Holidays](https://metacpan.org/pod/Date::Holidays) Perl distribution.

The release introduces support for:

- [Date::Holidays::BQ](https://metacpan.org/pod/Date::Holidays::BQ), a distribution handling holidays for [Bonaire](https://en.wikipedia.org/wiki/Bonaire).

In addition the adapters for:

- [Date::Holidays::NL](https://metacpan.org/pod/Date::Holidays::NL) (Netherlands), Date::Holidays::Adapter::NL
- [Date::Holidays::AW](https://metacpan.org/pod/Date::Holidays::AW) (Aruba), Date::Holidays::Adapter::AW

Have had their:

- `is_holiday`
- `is_holiday_dt`

Methods extended with support for additional parameters so the user can specify, the following parameters:

- `gov` for handling special dates influencing government interaction
- `lang` so language for holidays names can be specified

Please see the specific documentation for the 3 distributions.

- [Date::Holidays::AW](https://metacpan.org/pod/Date::Holidays::AW)
- [Date::Holidays::BQ](https://metacpan.org/pod/Date::Holidays::BQ)
- [Date::Holidays::NL](https://metacpan.org/pod/Date::Holidays::NL)

I am happy that waterkip created the PR to have Date::Holidays support the use for the 3 and it outlines one of the features that would be nice to have implemented, namely support for localized holiday names ([#12](https://github.com/jonasbn/perl-date-holidays/issues/12))

Here is a short demo of inquiring whether 2022-12-25 is a holiday in the 3 respective calendars.

```perl
#!/usr/bin/env perl

use strict;
use warnings;

use Data::Dumper;
use Date::Holidays;

my $holidays_hashref = Date::Holidays->is_holiday(
    year      => 2022,
    month     => 12,
    day       => 25,
    countries => ['nl', 'bq', 'aw'],
);

print STDERR Dumper($holidays_hashref);

exit 0;
```

The output:

```perl
$VAR1 = {
          'aw' => 'Pasco di Nacemento',
          'bq' => 'Pasco di Nacemento',
          'nl' => 'Kerst'
        };
```

Change log for Date::Holidays.

## 1.32 2022-10-03 Feature release, update not required

- Introduction of Date::Holidays::Adapter::BQ for adapting Date::Holidays::BQ

- Support for extra parameters for `is_holiday` and `is_holiday_dt`:
  
  - Date::Holidays::NL via Date::Holidays::Adapter::NL
  - Date::Holidays::AW via Date::Holidays::Adapter::AW
  - Date::Holidays::BQ via Date::Holidays::Adapter::BQ

  All via PR #70 (https://github.com/jonasbn/perl-date-holidays/pull/70) by Wesley Schwengle (@waterkip) author of:

  - Date::Holidays::NL
  - Date::Holidays::AW
  - Date::Holidays::BQ

- Fixed and clean up to Dist::Zilla configuration by @jonasbn
We are Setting Up a Coder's Community
Tags: webdev, opensource, community, programming
Published: 2022-10-04 17:49:52

## Webo Master Community
We would like to invite you to join our community. We want to make it a place where we can share our knowledge and experiences. We will be posting articles about the latest trends in the industry, as well as tips and tricks to make your coding journey easier.
**We are excited to have you on board!**

- [Webo Master Discord Server](https://discord.com/invite/hSsx85Y2jf)
- [Webo Master LinkedIn Page](https://www.linkedin.com/company/webo-master/)
Fitnesp
Published: 2022-10-04 17:04:02

[Fitnesp](www.fitesp.com) is blogging website designed by Saqib.

Our Goal is to help you live healthy and fit life.
Regardless of access to a gym, we think everyone should be able to exercise wherever. We provide meal plans, the most economical and efficient workout regimens online, hundreds of free full-length workout videos, and useful health, nutrition, and fitness information. 

A little about who I am and how it all started.
[Fitnesp](www.fitnesp.com) was created by only one person Saqib who is a freelancer. Saqib thought that fitness and health should be the priority for every person living in the world and it should be accessible to everyone regardless of their income.
Create Unit Test from Routes
Tags: laravel, unittest, pest
Published: 2022-10-04 16:32:59

You may previously skipped creating unit tests in your application, but you feels it's necessary for your application to have unit test to prevent more technical debts.

But...you have ton of routes, screens to test. Where to start?

I suggest write prepare all possible unit tests for all of your application routes. 

This post cover how to automatically create unit tests based on route list of your application.

**TLDR;**

Create an artisan command, 

```bash
php artisan make:command RouteTestCommand
```

And update the class as following:

```php
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Output\BufferedOutput;

class RouteTestCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'route:test';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Generate tests from routes';

    protected BufferedOutput $buffer;

    /**
     * Execute the console command.
     */
    public function handle(): int
    {
        $this->buffer = new BufferedOutput();
        $this->callBuffer('route:list', [
            '--json' => true,
            '--except-vendor' => true,
        ]);

        $routes = json_decode($this->buffer->fetch(), JSON_OBJECT_AS_ARRAY);

        if (count($routes) == 0) {
            return $this->components->error("Your application doesn't have any routes.");
        }

        $this->info(count($routes).' routes found');

        foreach ($routes as $route) {
            if(empty(trim($route['uri'], '/'))) {
                $this->warn('Empty URI. Skip generate unit test for '.'('.$route['method'].') '.$route['uri']);

                continue;
            }

            $class = str(empty($route['name']) ? $route['uri'] : $route['name'])
                ->replace('.', ' ')
                ->headline()
                ->replace(' ', '').'Test';

            $this->info('Generating unit test for '.'('.$route['method'].') '.$route['uri']. ' - ' . $class);

            $this->call('pest:test', [
                'name' => $class,
                '--force' => true,
            ]);
        }

        return 0;
    }

    /**
     * Call another console command.
     *
     * @param  \Symfony\Component\Console\Command\Command|string  $command
     */
    public function callBuffer($command, array $arguments = []): int
    {
        return $this->runCommand($command, $arguments, $this->buffer);
    }
}

```

Now, you can simply run:

```bash
php artisan route:test
```

This will simply create all possible tests based on your routes.

Now you have a baseline where to start writing unit tests.

Do take note, I'm using [PestPHP](https://pestphp.com/).

**So, what's next?**

It is possible to create classes based on models, APIs integrations, Livewire. But you need to understand how those classes populate and how we can generate the tests.

As for now, I just write based on routes, generate the unit tests.
How to Improve Security for your Cloud-Native Application Platforms?
Tags: containerapps, security, kubernetes, cloud
Published: 2022-10-04 16:29:38

Some concerning data points about container security threats
🚨61% of the container images used today are sourced from public open-source repositories
🚨 75% of Containers in the production environments run with high/critical severity vulnerabilities
🚨 76% of Container Images have containers run with root privileges
🚨 56% of the various images in use have high/critical severity due to the Non-OS packages dependencies
Source: Sysdig's container security report - https://lnkd.in/gB8f_RU3 

Common sources of vulnerabilities and risks 
Multiple vulnerabilities and risk sources exist in your cloud platform:
💥 Vulnerable package(s) in the base container image
💥 3rd party libraries and supply chain
💥 Exposed secrets, malicious files and misconfiguration

5 surefire ways of securing containers
There are certain well-established ways that are commonly followed by different enterprises that have adopted cloud-native to secure containers:
1️⃣ Shift your security left
2️⃣ Scan images in CI/CD pipelines and in registries
3️⃣ Block violating images with K8s admission controller
4️⃣ Focus on runtime security
5️⃣ Prioritize risks to fix as per the runtime insights you have

Developers drowning in vulnerabilities
Vulnerability overload is real:
⦿ Developers see 1000s of issues in their Vulnerability reports
⦿ Lack of clarity on where to focus remediation efforts
⦿ Sifting through the noise takes away time from development efforts

Addressing vulnerability overload
✅ Focus on the packages used in running containers
✅ Focus on exploitable vulnerabilities
✅ Utilize a tool such as Sysdig Secure which has a feature like risk spotlight enabled (https://lnkd.in/g2KUbRPX) that can leverage runtime insights for your risk prioritization!

To learn more about improving your container security
⭐️ For Google Cloud watch this webinar - https://lnkd.in/gV2Tuuy9
⭐️ For Microsoft Azure watch this webinar - https://lnkd.in/gUjRcvzu 
⭐️ For AWS watch this webinar - https://lnkd.in/gjZTxqh3
#kubernetes #cloudsecurity #aws #azure #gcp #security #containers #containersecurity