teleren/devto huggingface dataset:
Object Validator for PHP 8 V2.1.0 Release
Tags: opensource, showdev, php, webdev
Published: 2022-01-01 17:50:33

Have you ever tried to validate an object in PHP. Maybe you use Models, ViewModels or RequestModels.Maybe you hate writing if-else, loops and swiches to check your values.Maybe you do not like to use different validators for every framework.

At least I do.

#So I present you my general solution using the strengths of PHP 8.Clean, concise and easy.

- Lots of validations

- Supprots also nested object validation

- Repeatable validation attributes

- Works with private properties and methods

- Works with constructor promotion

- Memory and time profiling

- Custom error messages

- Custom property and method names for the exceptions

##Example
```php
<?php

use RMValidator\Attributes\PropertyAttributes\Collection\UniqueAttribute;
use RMValidator\Attributes\PropertyAttributes\File\FileExtensionAttribute;
use RMValidator\Attributes\PropertyAttributes\File\FileSizeAttribute;
use RMValidator\Attributes\PropertyAttributes\Numbers\RangeAttribute;
use RMValidator\Attributes\PropertyAttributes\Object\NestedAttribute;
use RMValidator\Attributes\PropertyAttributes\Strings\StringContainsAttribute;
use RMValidator\Enums\ValidationOrderEnum;
use RMValidator\Options\OptionsModel;
use RMValidator\Validators\MasterValidator;

require __DIR__ . '/vendor/autoload.php';


class Test 
{
    public function __construct(
        #[RangeAttribute(from:10, to:50)]
        #[RangeAttribute(from:10, to:30)]
        public int $param)
    {
        
    }

    #[RangeAttribute(from:10, to:30)]
    const propTest = 40;

    #[UniqueAttribute()]
    public function custom() {
        return ['asd', 'asdk'];
    }

    #[FileSizeAttribute(fileSizeBiggest: 20, fileSizeLowest: 10)]
    #[FileExtensionAttribute(expected:['php'])]
    private function getFile() {
        return __FILE__;
    }

    #[FileSizeAttribute(fileSizeBiggest: 20, fileSizeLowest: 10)]
    #[FileExtensionAttribute(expected:['php'])]
    public string $file = __FILE__;

    #[StringContainsAttribute(needle:"asd")]
    public string $string = "23asd";

    #[RangeAttribute(from:10, to:30)]
    public int $prop = 40;
}

class UpperTest
{
    #[NestedAttribute(excludedProperties:['param'])]
    private Test $test;

    public function __construct(Test $test) {
        $this->test = $test;
    }
}

$test = new Test(40);

try {
    MasterValidator::validate(new UpperTest($test), 
    new OptionsModel(orderOfValidation: [ValidationOrderEnum::PROPERTIES, 
                                         ValidationOrderEnum::METHODS,
                                         ValidationOrderEnum::CONSTANTS], 
                     excludedMethods: ['getFile'], 
                     excludedProperties: ['file']));
} catch(Exception $e) {
    var_dump($e);
}

```

Enjoy. Any feedback, recommendations and support are welcome :)

https://github.com/IvanGrigorov/VMValidator
[Git] How to use your personal access token
Tags: git
Published: 2022-01-01 17:32:58

# Background: Github Authentication Problem

It seems that from 2022, Github forces you to use your personal access token instead of passwords. I was, as usual, trying to push my commit and it was denied.

```sh
Authentication failed.
```

So I had to generate my own personal access token, and it worked as expected. But the process is a bit complicated, and I was really struggling to find this method when I first hit this problem. So I would like to share my way of resolving this hassle matter.

It was originally one of my posts in Medium which I don't use now.

# Original Post from Medium

## Background 

I use two different Github accounts - one is for my work, and the other for my personal projects. However, as a real novice in this field, whenever I switch the account from one to another, I had this problem with private remote repositories:

```sh
fatal: remote origin already exists.
```

Then how do we get around this problem? Of course, there are myriads of questions and answers regarding this, including https://stackoverflow.com/questions/2505096/cloning-a-private-github-repo (probably the very first one you would hit when googling).

However, I could not really find an answer, especially the one with

```sh
https://<username>:<password>@github.com/<owner>/<repo>.git
```

since my password contains '@' that the git parses before the one at @github , therefore the command does not work at all. Also, I even don't use SSH at all, and such answers really got me confused.

I finally have found an easy answer(at least in my opinion), and I might have seen this from somewhere but I could not find it again(so if there is anyone who knows links to those solutions, please let me know!).

## My Method

First, you need a token for getting access to your private repo.
See the [link](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)

Second, go to your local repository and check the remotes.
`git remote -v` will show you the list of the repository's remotes(a simple one would probably only have origin ). Then delete the one you want to get access by the command:

```sh
git remote remove <remote_name>
```

Third, reset your remote.
Enter the following command:

```sh
git remote add <remote_name>  https://<user_name>:<token>@github.com/<owner>/<repo>.git
```

Now everything would be okay! If you are still stuck, please let me know!

# Additionally

As I read it once again, I think you don't have to remove and add <remote_name> separately. Just do the following:

```sh
git remote set-url <remote_name> https://<user_name>:<token>@github.com/<owner>/<repo>.git
```

Now you have done it in a single command.
Native App Idea
Published: 2022-01-01 17:28:57

If you're wondering how to make money on the internet, there's one clear way: with apps. The amount of money made with apps is truly astronomical, and even if you don't have any interest in making an app for yourself, this post will help you out.

This [post](http://www.jbbatterychina.com/) will tell you everything there is to know about native apps so that the next time someone mentions 'native app idea', they'll have no reason to avoid it.

If you need some inspiration, here are some of the best apps in the App Store:

1. Instagram – $250 million in 10 months – $500+ million
2. Snapchat – $10 billion valuation – $36 billion valuation
3. Tinder – $750+ million in 2014 alone – $800+ million
4. WhatsApp (recently acquired for over a billion)
Getting back into the groove
Tags: writing, devjournal, motivation, programming
Published: 2022-01-01 17:21:00

Recently, I deleted all my social media after having some personal realizations. This has been long overdue even though I truly miss creating content for the small audience which had been cultivated over time. Really I was coding around the edges of what was normal like a journal of Unsolved Mysteries concerning Unix while also poking the bear. I started contributing a little again to OSS and had a super-productive run before settling in for the holidays. A corner has been turned and so subsequent content will be in this format. It's a new year and time to explain @wolfspidercode was an account meant to, ironically, cause some laughs but actually highlight the technologies used for real purposes. I had a lot of fun and actually created a lot of lurkers with it. Some people got the joke and others didn't and living in that in-between space had me really coding for that next bit of content. I actually do have a lot of respect for the real tech evangelists out there and a lot of truth came out in those posts it would seem. Happy New Year to everyone wherever you are and whoever you are!   


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhnq4xikk6hshbbi5i86.png)
Language that using in Extension
Published: 2022-01-01 17:11:40

An extension is a term used to describe the software that can be installed in order to add additional features and functionality to an existing service. Extension first came into use when programs were designed by programmers who wanted extend the original system's capabilities, such as building new features, improving on old ones or even replacing them all together. Over time, more developers have taken up this practice of creating their own software for their current clientele to experience.
Source: https://www.jbbatteryarabic.com/
Give some advice
Tags: beginners, javascript, programming, career
Published: 2022-01-01 17:01:03

I am trying to learn JavaScript for a long time. I am watching different tutorials. I consider I learn basics but coming to more complex notions I can't understand what is going on in the code.
Sometimes I try to solve some problems, I can handle pretty simple ones. I can't use my knowledge for difficult ones. I feel I need some algorithms.
What can you suggest to improve my skills and algorithmic thinking?
AWS Basics - Beginner's Guide to ElastiCache
Tags: aws
Published: 2022-01-01 16:59:39

ElastiCache is an **in-memory cache** generally used to store frequently accessed data to speed up database queries thus, improving performance.

ElastiCache is a **key value store**.

ElastiCache is good for read-heavy database workloads such as:

1. caching the results of I/O intensive database queries where the database is not changing too frequently
2. storing session data for distributed applications

Types of ElastiCache available:

| Memcached | Redis |
| - | - |
| Basic object caching | Supports complex data types like lists and hashes |
| Scales horizontally |
| No persistence, Multi-AZ and fail-over | Persistence, Multi-AZ and fail-over |
| Good for basic caching | Supports sorting and ranking data (e.g. for gaming leaderboards) |
What is the difference between 2 callbacks?
Tags: javascript, beginners
Published: 2022-01-01 16:53:18

I cannot catch the idea of 2 callbacks in JavaScript:

//first code

```
function printVariable(variable){
    console.log(variable)
}

function second(name, printVariable){
    printVariable( `Hello ${name}`)
}

second('Zohidjon', printVariable)
```


//second code

```
function printVariable(variable){
    console.log(variable)
}

function second(name, callback){
    callback( `Hello ${name}`)
}

second('Zohidjon', printVariable)
```

Their outputs are the same.
Can someone explain me what is going on here?
AWS Basics - Beginner's Guide to Parameter Store
Tags: aws
Published: 2022-01-01 16:47:00

## Systems Manager Parameter store

For storing secrets and configuration data:

`Services -> Management & Governance -> Systems Manager -> Application Management -> Parameter Store`

Available tiers:

| Standard | Advanced |
| - | - |
| Limit of 10,000 parameters | More than 10,000 parameters |
| Parameter value up to 4 KB | Parameter value up to 8 KB |
| No charges | Charges apply |

Parameter value can be any one of the following types:

1. **String**
2. **StringList** - comma separated strings
3. **SecureString** - encrypt sensitive data using KMS keys from your account
New Year New Start
Tags: 100daysofcode, html, css
Published: 2022-01-01 16:46:31

### Day 1: January 1, 2022

Well, they say third time is a charm right?

Admittedly, this is my third attempt at the 100 Days of Code challenge, and I'm going to do my best at making sure I complete it this time around. It was in March of 2019 that I graduated from [Northwestern's full-stack web development bootcamp](https://bootcamp.northwestern.edu/coding/), where I fell in love with coding which surprisingly seemed to have been a natural talent. However, the anxiety and fear in making a career path change got the best of me so I stayed in IT support where I where I was comfortable. Just about a year ago, I started at [Kin + Carta](https://www.kinandcarta.com), a consulting firm for digital transformation as an IT support coordinator. 

Recetnly, during a Slack conversation with the head of our web and mobile practice, Ricky Kelller, I was inspired yet again to start working to transitioning my career path from IT Support to web development. Admittedly I'm out of practice with my coding so Ricky gave me some Udemy courses to work through and help me get back on the path of a career in web development, which I'm going to use to help kick off my third attempt at the 100 days of code challenge and am starting by going back all the way to the basics taking [Modern HTML & CSS From the Beginning](https://www.udemy.com/share/1013eA3@vWdDAwIbTNKVDgdoKRg7QR2jUvRHDQ3ZaF3Dd-HzUhJUlzvcDZZUUPGMPdldaX2q/) on Udemy.

Today started off by getting through the first section of the course which gave a nice refresher on the web works, the roles of HTML & CSS in web development, and a quick intro into using VS Code. I wrapped up my time setting up a [repo](https://github.com/tonythetiger323/modern-html-css-from-the-beginning) on [GitHub](https://github.com), cloning it down to machine, get some starter files for the second part of the course added, and a brief update of its README with the details of the course.

A very simple day 1 to get my feet wet, there's 99 more to go, and I got this.
AWS Basics - Beginner's Guide to S3
Tags: aws
Published: 2022-01-01 16:44:40

## Accessing S3

S3 stands for **Simple Storage Service**. It's a storage service provided by AWS.

S3 is object-based storage, i.e, it manages data as objects.

S3 allows unlimited storage.

S3 objects can have a maximum size of up to 5 TB.

S3 stores files in buckets which are globally unique.

An S3 URL looks as follows:

`https://<bucket-name>.s3.<region>.amazonaws.com/<key-name>`

```bash
aws s3 ls

# Unable to locate credentials. You can configure credentials 
# by running "aws configure".

# Configure aws
aws configure

AWS Access Key ID [None]: 
AWS Secret Access Key [None]: 
Default region name [None]: 
Default output format [None]: json

# List all configs
aws configure list
# OUTPUT
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************W99N shared-credentials-file
secret_key     ****************123Q shared-credentials-file
    region               ap-south-1      config-file    ~/.aws/config

# Open the config file
cat ~/.aws/config
# OUTPUT
[default]
output = json
region = ap-south-1

# Create S3 bucket
aws s3 mb s3://testbckt-mp

# Copy content to S3
aws s3 cp hello.txt s3://testbckt-mp

# List content in S3 bucket
aws s3 ls s3://testbckt-mp
```

### Pagination
**How can we control the number of items included in the output of a CLI command to list objects in a bucket?**

Default page size: `1000`

When the command `aws s3api list-objects --bucket <bucket>` is run with say 2500 objects in the bucket, it will result in 3 API calls (each API call is limited to 1000 objects) to get the complete output.

However, using the above command on a large number of resources may result in timeout error or too many results returned as default page size of `1000` would be too high.

**SOLUTION:**
The `page-size` argument: 

`aws s3api list-objects --bucket <bucket> --page-size <size>` : The API still fetches the full list but with larger API calls in the background with smaller number of items per API call.

**How about just getting a limited number of items?**

We can use the `max-items` argument for such cases.

`aws s3api list-objects --bucket <bucket> --max-items <max>` : just return the first `max` items

## CLI Tips
- **Least privilege**: always give your users the minimum amount of access required
- **Create groups**: assign users to groups
- **Secret access key**: Only available once, if change is required -> delete the key pair and regenerate it, followed by `aws configure`
- Use separate keys per developer
How to Create Bank Landing Page HTML CSS JavaScript
Tags: css, tutorial, javascript, beginners
Published: 2022-01-01 16:22:44

{% youtube yaCCcyl3ENE %}

How to make bank landing page html css javascript

In this video, I will show you how to create (mobile-first responsive) bank landing page.

---

HI 👋
I'm Sadee (webdev)
In this channel I make videos about Complete Responsive website.
You can checkout my channel 👇

📺 My Channel : [codewithsadee](https://www.youtube.com/channel/UC1PZHWV6VvICTL1LgFUZq6g)
🔔 Subscribe : [subscribe now](https://www.youtube.com/channel/UC1PZHWV6VvICTL1LgFUZq6g?sub_confirmation=1)
🕐 New videos Every Friday

---

🔗 Essential links
-----------------------------
[All Images](https://drive.google.com/file/d/1G3XXpAJXGADqXxHNP2f1eOvkSASv0MEN/view?usp=sharing)
[Text](https://drive.google.com/file/d/1piOGPxQEFdrNGbVogekuY_haU5BaKr47/view?usp=sharing)
[Font - Public Sans](https://fonts.google.com/specimen/Public+Sans?query=public+sa)
[Ionicon](https://ionic.io/ionicons)
[Source Code](https://www.patreon.com/posts/source-code-bank-60591898?utm_medium=clipboard_copy&utm_source=copy_to_clipboard&utm_campaign=postshare)

---

⏱️ Timestamps
-----------------------------
0:00 - Demo
1:36 - File structure
1:52 - Html initial, css variables & reset
3:51 - Header section
10:00 - Home section
12:39 - Service section
16:28 - Blog section
21:18 - Footer section
25:38 - Media queries
34:00 - Javascript functionality


---

💜 Like - Follow & Subscribe Me
-----------------------------
Twitter : https://twitter.com/codewithsadee
Github : https://github.com/codewithsadee
YouTube : [codewithsadee](https://www.youtube.com/channel/UC1PZHWV6VvICTL1LgFUZq6g)
Buy Me A Coffee : https://www.buymeacoffee.com/codewithsadee
Patreon : https://www.patreon.com/codewithsadee

---

[![Buy Me A Coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9kn6vwn4mulhsx6o69is.png)](https://www.buymeacoffee.com/codewithsadee)
New book: Laravel The Modular Way
Published: 2022-01-05 20:18:44


 ---
title: New book: Laravel The Modular Way
published: true
date: 2022-01-01 16:15:55 UTC
tags: 
canonical_url: https://dcblog.dev/new-book-laravel-the-modular-way
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ibfxk3jxjff06ah96kr1.png
---

For years I've built Laravel applications using modules. I prefer to use modules to keep my code organised and grouped by common features aka Modules. Using modules helps to keep your code base manageable, easier to work on in teams and can easily be exported into composer packages or simply copy and pasted into other projects.

I've written a book that will help you to learn how to build modular laravel applications. This book is in two parts, firstly to document version 8 of the Laravel Modules package.

The second part will cover how to build on top of this package. I've been using this package to build both CMS's and web apps for years, I highly recommend it.

You will learn not only the basics of working with modules but how to write tests to ensure everything works within the modules, customise the structure of modules, write your own base structure that can be generated.

- ✅ 118+ pages of content depending on the format (PDF, EPUB, MOBI)
- ✅ Test-Driven module development with PestPHP
- ✅ How to generate custom modules with your own structure
- ✅ How to convert a module to a package
- ✅ Install a module package
- ✅ Thorough walkthrough & explanations
- ✅ Author has +17 years in the field

Buy your copy now from [https://modularlaravel.com](https://modularlaravel.com)
Navigation Bar using CSS and JavaScript
Tags: css, javascript, webdev, beginners
Published: 2022-01-01 16:13:15

I created some navigation bar using CSS and JavaScript, all are simple beginner level codes. Hope this will help you some day, I did not make the design complicated, you can use your skills on these to create awesome designs.  

{% codepen https://codepen.io/kiran-r-raj/pen/abLJMMB %}
{% codepen https://codepen.io/kiran-r-raj/pen/dyVvvxL %}
{% codepen https://codepen.io/kiran-r-raj/pen/QWqpgPe %}
{% codepen https://codepen.io/kiran-r-raj/pen/bGoqMNy %}
{% codepen https://codepen.io/kiran-r-raj/pen/xxXqNxa %}
{% codepen https://codepen.io/kiran-r-raj/pen/rNGmmeJ %}
{% codepen https://codepen.io/kiran-r-raj/pen/qBPrgKe %}

You can find my Navigation Design Collection in codepen [here](https://codepen.io/collection/oELroa). If you have time please provide feedbacks, I did not take accessibility features into considerations and these are not optimized for production, just want to experiment with code as I am trying to gain more knowledge in web development. 

{% link https://dev.to/kiranrajvjd/simple-css-text-animations-1nee %}
{% link https://dev.to/kiranrajvjd/css-hover-effects-k4a %}
Excel - How to identify duplicated values in a sheet
Tags: excel, duplicated, values
Published: 2022-01-01 15:43:15

---
title: Excel - How to identify duplicated values in a sheet
published: true
description: Identifying duplicated values in a excel sheet
tags: 'excel, duplicated, values'
cover_image: 'https://raw.githubusercontent.com/campelo/documentation/master/posts/excel/assets/cover.png'
canonical_url: null
id: 941960
---

###### :postbox: Contact :brazil: :us: :fr:

[Twitter](https://twitter.com/campelo87)
[LinkedIn](https://www.linkedin.com/in/flavio-campelo/?locale=en_US)

---

If you're looking for duplicated values in a excel sheet, you can find them easily.

## Identifying duplicate values

We need to select the columns or cells that have duplicate values and select Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values

![Image 1](https://raw.githubusercontent.com/campelo/documentation/master/posts/excel/identifying-duplicate-values/assets/img1.png)

After that we could right-click on one of the duplicate cells and choose Filter > Filter by Selected Cell's Color

![Image 2](https://raw.githubusercontent.com/campelo/documentation/master/posts/excel/identifying-duplicate-values/assets/img2.png)

All duplicated cells will be filtered

![Image 3](https://raw.githubusercontent.com/campelo/documentation/master/posts/excel/identifying-duplicate-values/assets/img3.png)

To clear conditional filter, choose Conditional Formatting > Clear Rules > Clear Rules from Entire Sheet

![Image 4](https://raw.githubusercontent.com/campelo/documentation/master/posts/excel/identifying-duplicate-values/assets/img4.png)

Sources:

[Duplicate values](https://www.accountingweb.com/technology/excel/identifying-duplicate-values-in-an-excel-list)

## Typos or suggestions?

If you've found a typo, a sentence that could be improved or anything else that should be updated on this blog post, you can access it through a git repository and make a pull request. If you feel comfortable with github, instead of posting a comment, please go directly to https://github.com/campelo/documentation and open a new pull request with your changes.
Node.js fulfill abstraction example.
Tags: javascript, webdev, node, discuss
Published: 2022-01-01 15:43:12

I write a small weather details fetch web application from external API. you cna look see it on GitHub: 
{% github abhishekdhapare9392/weather-app-node-js %}

To avoid to reveal the API key and resource of third party API in DevTools->Source.

Please visit the GitHub link and follow the document. After you completed the process you will be on browser. (Hopefully on Chrome). Open the Developer Tools->Source you can see the all files loading which required. Click on JS->script.js file and you can see code in side window. If you see carefully and read the code there is an API call without API key and resource link. Please go through it and let me know. I would like to discuss if any one have doubts or queries.

Thanks.