teleren/devto huggingface dataset:
Laravel 9: Enums!
Tags: laravel, laravel9, webdev, php
Published: 2022-01-30 14:32:01

Soon, Laravel 9 wil release and there are some new features that we can use them.

This series is going to be a sequel about Laravel framework version 9 and in each article we will review a new feature!


And yes! Finally we have official support for [Enums in php 8.1](https://www.php.net/manual/en/language.enumerations.backed.php) although we could add them to Laravel framework by using third-party packages like [spatie/enums](https://github.com/spatie/enum).

**But what are [enums in php?](https://www.php.net/manual/en/language.types.enumerations.php)**

They are just singleton objects and the syntax to define them is as below:

![php enums](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/66zo7i09ybo2euz4y424.png)

Gladly, we can do so much thing with Laravel Enums and in this article we are going to cover some of the most important usages.

### 1. Route Bindings With Enums

Laravel 9.x has ability to type hint on our route… think it as a route-model binding but instead of model we have enums! Let see an example:

![laravel enums](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84aiesk6f3gy0w5joiiy.png)

and in web.php:

![laravel enums route bindings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/guitkovrqvb6etzq527q.png)

With these codes, Laravel automatically will recognize category type and if we don’t pass any of predefined types, it will return an HTTP 404 response!

### 2. Enums And Migrations

We can use `enum()` method as following example to create a column with enum type, just be careful by choosing a proper name because renaming an enum column is not currently supported!

![laravel enum migrations](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0emjgka407sjtnyxhcg2.png)

### 3. Enum Attribute Casting

Now our dearest, Eloquent ORM will let us to cast attributes to PHP enums. We just need to use `$casts` property array on desired model:

![laravel enums casting](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9jtq9dyk70vvty0h734n.png)

And we can access the attribute directly:

![laravel accessing enums](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/un5fhsrvc7o71jobrkeo.png)

### 4. Enum Methods

According to [Laravel docs](https://laravel.com/docs/master/collections#the-enumerable-contract), Almost all known methods we use on collections are also available on enums likes: 

![laravel enum methods](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z7233qe121tv5xd9o418.png)

That’s it… Any question?
Free Complete NextAuth Video Course, signin fb, twitter, auth0, google, github and email. Firebase and mongodb adapter
Tags: nextauth, nextjs, firebase, mongodb
Published: 2022-01-30 14:27:33


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

[https://youtu.be/uLjS5DVgSvc](https://youtu.be/uLjS5DVgSvc)

In this project, we are going to implement the nextauth to our nextauth app. We will go through different provider like email provider, github provider, twitter provider, facebook provider and auth0 provider (which can login with microsoft, amazon, paypal, dropbox ,yahoo and yandex, etc.). In this example, we demonstrate how to login with microsoft account.
We will also learn how to setup sendGrid so we can make a passwordless signin with email. Also, we will setup firebase adapter and mongodb adapter, so the users data will store in these database.
At last, we will also deploy the app to the Vercel.
5 Career Pathways with an ITIL service transition certification
Tags: training
Published: 2022-01-30 13:50:07

Information Technology is one of the most important things for everyone in every aspect. It is known as the use of computers to transmit, store, retrieve and manipulate data.  We all know how useful and effective an computer system is and this computers, laptops, mobile devices are everything is only possible due to information technology and this increases its importance to a next level. [Training](https://kodblems.com/2619/5-career-pathways-with-an-itil-service-transition-certification)
Git commands, you may not know.
Tags: git, github, opensource, beginners
Published: 2022-01-30 13:48:22

Here are some of the top `git` commands that I handpicked, which can be useful for increasing your productivity and saving you time.

### 1) Updating the last commit message

If you want to update the message of your last commit because it didn't look conventional or meaningful, use this command to edit it:

```bash
git commit --amend -m "Updated message"
```

### 2) Blank Commit

Sometimes we need a blank commit (no changes added or deleted), maybe to initialize our repository or trigger some kind of action. We can use this command:

```bash
git commit --allow-empty -m "blank commit message"
```

### 3) Checking the total number of commits

If you want to check the total number of commits on a particular branch, you can use this command:

```bash
git rev-list --count <branch-name>
```

For example:

```bash
git rev-list --count main
```

### 4) Checking files from a different branch

If you want to view some files from a different branch while working on a different branch, you can use this command:

```bash
git show <branch-name>:<file-name>
```

For example, if you are working on the `test` branch and want to see the README.md file from the `main` branch, you can use this command:

```
git show main:README.md
```

### 5) Staging (adding) and committing changes in a single command

Instead of doing `git add` and `git commit` separately, you can use this single command to perform both actions:

```bash
git commit -am "message"
```

### 6) Git tutorial on the terminal

Yes! You heard it right. With only a single command, you can have a whole git tutorial at your fingertips.

```bash
git help tutorial
```

For support and reach out, you can find me on [Twitter](https://twitter.com/intent/follow?screen_name=pradumna_saraf) or [LinkedIn](https://linkedin.com/in/pradumnasaraf).
Striver's SDE Sheet Journey - #19 Four sum
Tags: programming, java, computerscience, algorithms
Published: 2022-01-30 12:24:13

> **<u>Problem Statement</u> :-**

_Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]]_

such that,

1. 0 <= a, b, c, d < n
2. a, b, c, and d are distinct.
3. nums[a] + nums[b] + nums[c] + nums[d] == target

You may return the answer in any order.

> Example


**Input** :  `nums = [1,0,-1,0,-2,2], target = 0`

**Result** : `[[-2,-1,1,2],[-2,0,0,2],[-1,0,0,1]]`

##  <u>Solution 1</u>
_fix three pointers and look for the last one_

```
nums = [1,0,-1,0,-2,2] ,target=0

nums = [1,0,-1,0,-2,2]
        | |  | < look for the last one >
        i j  k
```

**step-1** sort the array `nums` and initialise an variable `ans`.

**step-2** run three loops linearly for `i`, `j`, `k` pointers

 > **1.** find the last element, using binary search.
 > **2.** if the last element found then add the quadruplet to `ans`

## Java

```java
class Solution {
    public List<List<Integer>> fourSum(int[] nums, int target) {
        
        Set<List<Integer>> ans = new HashSet<List<Integer>>();
        int n = nums.length;
        
        Arrays.sort(nums);
        
        for(int i=0; i<n; i++){
            
            for(int j=i+1; j<n; j++){
                
                for(int k=j+1; k<n; k++){
                    
                    int x = target - (nums[i] + nums[j] + nums[k]);
                    
                    if(Arrays.binarySearch(Arrays.copyOfRange(nums,k+1,n),x) >= 0){
                        List<Integer> r = new ArrayList<Integer>();
                        r.add(nums[i]);
                        r.add(nums[j]);
                        r.add(nums[k]);
                        r.add(x);
                        
                        ans.add(r);
                    }
                }
            }
        }
        
        List<List<Integer>> result = new ArrayList<List<Integer>>();
        
        for(List<Integer> list : ans){
            result.add(list);
        }
        
        return result;
    }
}
```
What I learnt last week #02 
Tags: webdev, beginners, weeklyretro
Published: 2022-01-30 13:28:15

Styling pages using css. primarily referred MDN's guide. 
got to know about major league hacking. 
planning to make a submission for this week's hackathon #hacknado

Saw parts of binary search video. 
came across css with leon on twitch.
Why you should consider Web Application over Desktop for both Present and  Future .
Tags: webdev, programming, productivity, discuss
Published: 2022-01-30 13:19:15


<u>
## **Web Applications**
</u>

- Web applications are more convenient,than Desktop Application. As, it doesn't requires any installation.

- As, network speed is increasing and with improved cloud computing, it made or will make possible to use large and heavy applications in our browser itself.

- Don't want to wait , instantly accessible.

- Due to advancement of web its easier to build & deploy web applications.

- Flexible Access. It can be easily accessible all around the globe via laptops, mobile phone , tablets ,etc... you name it (Cross-platform compatibility).

- Always up-to-date. Since everyone accesses the same version of a web application via a URL, they will always have access to the latest version of the software.

- With cloud availability, storage space is virtually unlimited.

- And,Many more!

## **Conclusion** 
Web applications have a great future. Many popular desktop application Companies are devloping there alternative Web Apps, As web based app's popularity is rising. As we are human beings, No one likes to wait. We need everything Instantly, this dream is fulfilled by web apps. So, naturally we choose web apps.
And, That's it. Wishing you all a great day ahead!

<u>IF YOU WANT TO SUPPORT ME ,SUPPORT ME HERE 👇</u>
- https://www.buymeacoffee.com/Alan.Tech



Thank you,
I made my first website which sends response from Html form to my Email.
Tags: webdev, beginners, css, html
Published: 2022-01-30 12:57:46

<p>I made a simple static website which receives response from the user and send them to my email account. </p>
<h5>The idea to create this website came from the need of providing free career guidance/counselling to the students of 10th & 12th class.</h5>

<p>So I created a simple website using Html, Css and javascript.</p>

<p>The other technologies used in the website were node and express for mailing.</p>


![Home Page Image Of my site](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zr12wxcsuqohjdw57jzk.jpeg)
I have used 2 npm package **node mailer** and **nodemailer-mailgun-transport**. With the help of these packages I was able to send and receive the mails.

![Form Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwo9s1622p3ebrgye74c.jpeg)
After the completion of the website, I deployed it on **Heroku**.
[Visit the Site](https://freecareerguidance.herokuapp.com/)
<p> If you liked my idea please share it with students, so they can avail this opportunity.</p>

**Follow me on**
[GitHub](https://github.com/SHIVANGISINGH1)
[LinkedIn](https://www.linkedin.com/in/shivangi-singh-4686b5206/)
Websites that will make your website's Css on another level 🚀
Tags: listing, sh20raj, sopblog, css
Published: 2022-01-30 12:44:13

## 1. https://cssbuttons.io/


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

Get Css Buttons, Cards and more...

Choose from numerous UI components and get the CSS for the ones you like. Everything is open-source and free to use.

---

## 2. https://animista.net/


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ad2mqa3tx9r0d2pcfuv.PNG)

Animista is a CSS animation library and a place where you can play with a collection of ready-made CSS animations and download only those you will use.

---

## 3. https://cssgradient.io/gradient-backgrounds/

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4d8wqsvwf8qy28z78b84.PNG)

Discover the best gradient backgrounds from  a curated collection of the ultimate list of gradient sites. With 1000+ gradients, it's easy to find the 👌 color!

---

## 4. https://neumorphism.io/


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

CSS code generator that will help with colors, gradients and shadows to adapt this new design trend or discover its possibilities.

---

# 5. https://freefrontend.com/

Free hand-picked HTML, CSS and JavaScript (jQuery, React, Vue) code examples, tutorials and articles.

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

---

# 6. https://free-css.com/

Free CSS has 3292 free website templates, all templates are free CSS templates, open source templates or creative commons templates.

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

---

> # 7. [SopLoader :- Free Preloaders for Website or Blogger](https://sh20raj.github.io/SopLoader/)

SopLoader :- Free Preloaders for Website or Blogger

SopLoader is a free JavaScript Library that make Users to add Preloaders to their website/blog. Using and id of images hosted on imgur.com


![SopLoader :- Free Preloaders for Website or Blogger](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxixwtjvw84jf3yran6u.PNG)

---

> # 8. [SopScrollbar - Free Custom Css Scrollbar Codes](https://sh20raj.github.io/SopScrollbar/)


![SopScrollbar - Free Custom Css Scrollbar Codes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lmpj0d0k77su0unau7j1.PNG)

SopScrollbar - Free Custom Css Scrollbar Codes

## Bonus [https://sh20raj.github.io/SopProducts/](https://sh20raj.github.io/SopProducts/) :- Get Useful Tools Here


🚀 ++
starting my IT career
Tags: beginners, ethicalhacker, programming
Published: 2022-01-30 11:45:16

Hai am muhammed abdul latheef studying in 11th std .last 1 year i have been enrolling with programing and all. I have learned c++ from youtube,udemy etc currently learning python..
behalf  i get to know about cyber security then started to get to know more about cyber security  i have learned many things now . Now my dream is to become an professional ETHICAL HAC4R .
and like to work in company's like google,microsoft,mcafee etc
basically an MNC company........
Here's why you'd better test your website in production
Tags: testing, building, productivity, devops
Published: 2022-01-30 11:17:41

## Let's start with an observation

I've been working in the IT industry for a few years now, creating and helping to create many applications, and I've noticed something: no matter how good your development is, or how much testing you do, there always comes a time when things go wrong. 

When your application goes offline overnight, it's usually pretty simple: you have to find the source of the problem and fix it (which can be a bit of an effort, I admit). 

But, when only certain parts of your application go down, that's usually when it gets tough. And I think I've found the reason for this: as developers, we too rarely test our applications after they go live. 

## But why does this happen? 

Indeed, manual testing is usually an extra workload that we often only do once, after our product has been delivered. But when it comes to day-to-day quality assurance, it's often more complicated. 

"We too often rely on the shoulders of others (or even our users) to let us know when something goes wrong." 

This can be seen in the tools we use to ensure the quality of our software. They are often: 
- either focused on the development phase (via unit tests) 
- or on monitoring, from a technical point of view (log analysis, exception raising, ...) 

However, what counts for our users is generally quite different: it is the finished product, the functionality of the interface. 

## Hence the importance of production testing 

This is where production testing comes in. Often neglected, this is a practice I want to encourage in this post: if you know how to do it, create synthetic tests, simulate the interaction of your users with your different features, and run them periodically: you will see much faster when something goes wrong. 

These tests don't have to be very numerous and don't take much time to develop, but they can be vitally important. 

You don't even need to have advanced skills in testing frameworks and tools. There are many applications, SAAS or otherwise, that will allow you to add these tests, which will guarantee much better stability to your applications. 

## A small promotional note 

Based on this observation, I decided to add my own contribution by creating my own website monitoring tool. It's called Nodown (I let you understand the etymology of the name), and its purpose is precisely to create this kind of test. Of course, you can also do it by yourself with scripts or other SAAS software, but if you want to try it, you are welcome (just go to https://nodown.io) ;)
3 Ways you can use Jupyter Notebook as an excellent Communication Tool
Tags: codequality, coding, jupyter, notebooks
Published: 2022-01-31 04:53:50

---
title: 3 Ways you can use Jupyter Notebook as an excellent Communication Tool
published: true
date: 2022-01-30 11:33:00 UTC
tags: codequality,coding,jupyter,notebooks
canonical_url: https://dramsch.net/posts/3-ways-you-can-use-jupyter-notebook-as-an-excellent-communication-tool/
---

![](https://dramsch.net/images/banner/banner-python.thumbnail.jpg)

 

People love to hate Jupyter Notebooks!

They're missing out on a great communication tool.

Here's how data scientists and machine learners can

build great Jupyter Notebooks that people love to read

## 🧮 Fix your dang code

You can make a mess in notebooks when experimenting.

1. All Imports into Cell 1
2. Extract some functions and classes
3. Comments.
4. Fix your variable names
5. Fix the order and outputs
6. Use [black](https://github.com/drillan/jupyter-black) to standardize your code format

## ✒️ Jupyter has Markdown Cells!

Use them.

If you're not using Markdown in your Notebooks, you should not be using Notebooks.

Write some prose to explain your code.

Whether analysis or model, do yourself a favour and document it.

In case you need a [markdown guide](https://www.markdownguide.org/getting-started/).

## 🔂 Final checks

We all do it.

We forget to run a cell and wonder for an embarrassing amount of time, why we have an error in the next one.

Before you share your notebook:

1. Restart Kernel to forget all variables
2. Run All Cells

Not by hand. Automatic.

It'll show any mix ups

## 🏆 Extra Credit

🦾 Use nbconvert to run all cells from the command line

🧠 Write a utils file with reusable functions

⌨ Learn keyboard shortcuts for efficiency

🎨 Make it interactive with ipykernel

## Conclusion

- Care about code quality
- Use markdown cells (More than just headings)
- Make sure the notebook runs
- Use extra tools to make your life easier
New In Laravel 8.80.0 - Support For Route Group Controller
Tags: laravel, nrkdrk
Published: 2022-01-30 11:24:50

In this video, we will be looking at a new support for the route group controller added to the latest version of Laravel which is 8.80.0.

https://www.youtube.com/watch?app=desktop&v=MWRPF8T2M2c&feature=youtu.be
"Voir plus", ou comment faire un ellipsis personnalisé
Tags: css, customelipsis, javascript, html
Published: 2022-01-30 11:22:34

En HTML/CSS, lorsque votre texte est trop grand pour la place attribuée, vous pouvez ajouter la valeur `text-overflow : ellipsis` pour afficher `…` à la fin.

Le problème est que cela fonctionne uniquement sur les textes sur une seule et unique ligne et qu’il n’y a pas moyen de voir le texte en entier.

Aujourd’hui, nous allons donc voir 2 méthodes pour afficher du texte sur une ou plusieurs lignes sans qu’il ne dépasse !

## La méthode CSS only

Cette première méthode est probablement la méthode la plus “propre”, elle se réalise uniquement en CSS, mais nous verrons qu’elle n’a pas forcément le meilleur rendu. 

Cette méthode consiste à afficher en bas de la zone de texte un élément (ici un pseudo-élément `::before`) afin de cacher la fin du texte. De plus, pour éviter que le texte soit coupé en plein milieu d’un mot, nous ajoutons un dégradé sur le coté de l’élément.

{% codepen https://codepen.io/alexandrefauchard/pen/KKyPPqV %}

### Avantages

- “Responsive”
- CSS only

### Inconvénients

- Toujours présent meme quand ce n’est pas nécessaire
- Dans le cas du `::before`, l'élément qui reçoit le `onclick` est la balise `<p>`et donc pas uniquement le "Voir plus"

## La méthode JS + regex

Le principe de cette méthode est simple : une boucle javascript va parcourir le contenu de la balise de texte (fonctionne aussi bien avec un <p> qu’avec des headings) et retirer les mots de manière itérative jusqu’à ce que le contenu rentre dans la zone définie.

Ici, nous allons pouvoir définir une balise (inline) qui sera ajouté à la fin du texte, elle sera ainsi  parfaitement intégrée au texte d’origine. De plus, la vérification reposant sur le viewport, l’élément « voir plus » n’est ajouté que s’il est nécessaire !

{% codepen https://codepen.io/alexandrefauchard/pen/gOxJXLb %}

### Avantages

- Intégration parfaite
- Répond à tous nos besoin : cache le texte en trop et permet d’afficher quand même ce texte grâce à un bouton fonctionnel

### Inconvénients

- Processus un peu lourd
    - Processus d’implémentation un peu lourd et nécessitant l’utilisation du javascript
- Besoin de recalculer si changement de viewport
Looking for a Lead Developer/CTO shares + salary
Tags: javascript, job, typescript, offers
Published: 2022-01-30 11:19:02

Lead Developer in Start-up for Shares + Salary

We are currently raising money to build a new start-up enhancing Matterport virtual tours through additional features thanks to a partnership with them.

Matterport is the leading spatial data company focused on digitizing and indexing the built world.
Their all-in-one 3D data platform enables anyone to turn a space into an accurate and immersive digital twin which can be used to design, build, operate, promote, and understand any space.

Our project is to create and add many features through a developed web software with the SDKs and APIs Matterport is giving us.

What are we looking for?
A new associate inside the founding team. We are not looking for an employee, but a true associate who will build the project with us and will be accountable for the technical part of the project.

What do we offer?
A strong position inside a start-up, a position as a co-founder of the project, shares and a seat inside the Board Team, a salary after the company is created.

Missions?
You will be the Lead Developer/CTO of the company and will have to manage the technical team as well as the creation and well-being of the project.
- Creation of the product requirements document with all details, descriptions, features and architecture
- Building and test of the time required to develop the whole project + amount of money needed
- Building of a basic MVP
- Management of the technical team (developers, quality testers, designers, etc.)
- Overview and management of the global development of the software with deadline respected
- Be a leader to the technical team, motivate them, show them the right path and have the technical knowledge to assure they provide a good work
- Recruitment of the technical team
And more…

Skills?
Software:
- Strong knowledge and Experience of Javascript
- Strong knowledge and Experience of GraphQL
- Typescript
- REST API
- Yarn
- Webpack
- VS Code
- Git
- UX/UI Design

Team :
- Business sense
- Management
- Organisation
- Effective Communication
- Determination
- Risk-taking
- Leadership
- Decision-Making
- Ability to employ tech talent


Experience ?
As much experience as possible to be sure that the technical part of the company will be into good hands.
At least few years of experience into JavaScript and software dev experience.

Studies?
No requirements

Where?
Toulouse, France

Languages: French and English level C1 minimum for each

We need someone extremely motivated who will see his start-up as his baby and work with us to make this start-up successful.