teleren/devto huggingface dataset:
Laravel Sweet Alert Confirm Delete Tutorial Example

Tags: laravel, php, tutorial, programming
Published: 2021-05-15 11:12:04

<p>Hello Dev,</p>
<p>Now let's optically discern example of how to utilize sweet alert in laravel. This is a short guide on laravel if sweet alert. We will utilize how to utilize sweet alert in laravel. Here you will learn how to utilize sweet alert in laravel. We will utilize how to utilize if sweet alert in laravel. Let's get commenced with how to sweet alert use in laravel.</p>

<p>Here i will give you many example how you can check sweet alert in laravel.</p>

<strong class="step">Step 1: Add Table and Dummy Records</strong>
<p>I always prefer to give example from scratch, So in this example we will engender "users" table with id, denomination, email, engendered_at and updated_at column. So you have to engender table utilizing migration and run that. After engendered prosperously engender table, ascertain integrate some dummy data like as bellow</p>


<pre class="prettyprint">
INSERT INTO `students` (`id`, `name`, `email`, `created_at`, `updated_at`) VALUES
(1, 'coding, 'coding@gmail.com', NULL, NULL),
(3, 'tracker, 'tracker@gmail.com', NULL, NULL),
</pre>
more..

if you want to see full example follow this link..

https://codingtracker.blogspot.com/2021/05/laravel-sweet-alert-confirm-delete.html
Core OOP in JavaScript
Tags: javascript, webdev, oop, codenewbie
Published: 2021-05-15 11:10:02

Hello,
I just released the first phase of my JavaScript eBook titled **Core OOP in JavaScript**, with respect to JavaScript as a prototyped based language. Go check it out here: https://lnkd.in/eF6mVQv

NB: read the docs to find your way around!
Sample web page with wordpress data tables
Published: 2021-05-15 11:05:08

we have developed a custom govt jobs data tables application with the help of wordpress plugins and some custome code written by our engineers. have a look on it . 
example page : the below page is created for ,<a href="https://www.jobsedit.in/railway-recruitment/">latest railway jobs in india </a>. find url below. 
https://www.jobsedit.in/railway-recruitment/
how to install passport in laravel 8
Tags: laravel, api, auth, webdev
Published: 2021-05-15 10:47:31

In this section, I will implements how we can create REST API using laravel passport package by developing four API signup, login, logout, and getuser.

```
composer require laravel/passport
```
Laravel makes API authentication using Laravel Passport, which provides a full OAuth2 server implementation for your Laravel application in a matter of minutes.
[Read More...](https://larainfo.com/blogs/how-to-install-passport-in-laravel-8)
React does task queue very weird.
Published: 2021-05-15 10:32:36

React does task queue very weird.

useEffect(()=>{
    if(count===2){
        const history2 = history.push('/page2');
        console.log('history2', history2)
    }
})

const onClickEvent = async ()=>{
    await new Promise(resolve => {
        setCount(2);
        resolve(true);
    });
    const history1 = history.push('/page1');
    console.log('history1', history1);
};
First promise works
Then useEffect works, reacting to state changed
Last command works after promise, it does redirect to page1
This goes out to console

history2 undefined 
history1 undefined
I agree with this, first works history2, the last works history1. But, browser does redirect to page2.

Why? Last redirect should be page1.

Why not? Can anyone explain this to me?
Keep Track of your Investments 💵 using this Template
Published: 2021-05-15 10:07:15

Hey folks 👋🏼

We just launched another Product on Product Hunt. It's a notion template that helps you track your investments and drive higher profit.
### ETF and Stock Rebalancer
On your journey to financial independence, it's crucial for your portfolio to be aligned according to your plans for the future. This template will make sure your investment portfolio is balanced the way you need it to, making sure you're on track to achieve your financial goals.

{% youtube 1bqnzQLxDOM %}

It has three main components to it:
### Accounts
The accounts section is one that is used to hold the different items in your portfolio. This breakdown will help filter and sort the items held in your portfolio database.

**Properties:**

* Name
* Type
* Portfolio Investments (Relation)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6dthxne1385v3or7hsm8.png)

### Asset Classes
An asset class is a group of investments that have similar characteristics and are subject to the same laws and regulations. It's important to have a balance between them that fits the risk you are willing to take as well as your time to retire.  
A target, in the form of a percentage, should be set for each of the asset classes.

The asset classes considered in this database are:

* Canadian Equity
* Fixed Income
* U.S. Equity
* International Equity
* Emerging Markets
* Cryptocurrency
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kt6fsiqavenl12d2u4pz.png)

### Portfolio
The main database in this template. This is a list of every asset in your portfolio, and it should be the database you interact with and update the most.

Every item in the portfolio should correspond to at least one asset — although they often fit multiple (e.g. ETFs). It is very important you specify the distribution across all asset classes available such that the sum is 100%.

**Properties:**

* Name
* Ticker
* Market Value
* % Fixed Income
* % Canadian Equity
* % US Equity
* International Equity
* Emerging Markets
* Cryptocurrency
* Account (Relation)
* Status: 🟢 or 🔴 when the asset allocation percentages do not add up to 100%.
Assets Classes: Every entry in this database must contain all asset classes available in order for it to be included in the balancing calculations. To help with this, there is a "New Entry" template that can be used to create new items, which contains all relations it needs. Moreover, because a filter selecting all asset classes has been set, they will be added to any new row that is added.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1od8wgoh21bdvz90vc0o.png)
### Want One?
![](https://media.giphy.com/media/S2wAes3xRCu4PBFyHB/giphy.gif)
***Here is your link*** 👉 [***Balance your Portfolio***](https://prototion.com/notion-for/balance-your-portfolio)

We are on Producthunt today. Go show some love here🔥
[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qpbl45jr6gyjnoggz29b.png)](https://www.producthunt.com/posts/notion-portfolio-manager)
Personal Search Engine 
Tags: cpp, startup
Published: 2021-05-15 09:52:24

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zjg55hpwn0x0hpaf29g3.jpg)
A custom search engine can be useful for those who have many bookmarked sites. All of them can be added to your search engine and quickly find what you have read, but do not remember where exactly. Perhaps this project will help you in your studies and work - https://kavunka.biz/
Cloud Computing
Tags: aws, beginners, cloud, devops
Published: 2021-05-15 09:01:30

I'm starting a new journey to start learning cloud computing skills. To start it a questions come into my mind.

1. What is cloud computing ?
1. Why cloud computing ?

Let us try to answer these.

## What is cloud computing ?

Cloud computer is buying compute power, RAM, storage on demand as and when needed. In this we actually don't want to own the IT systems as it creates a lot of problems. It's highly flexible and we can choose the right amount and size of the computing powers and pay as we go according to how much we use the resources. This makes an easily scale able network of servers which we can increase and decrease as demand goes up and down.

## Why cloud computing ?

In traditional infrastructure of servers we need to buy resources as we scale up and down. This causes a lot of problems as there may be a seasonal need but you may need to buy extra servers and there will be a lot of maintenance cost for these servers i.e. server room rent, cooling charges, wiring costs and hiring people that can do all this stuff. 

Cloud Computing solves much of these disadvantages and gives several other advantages like

- It reduces capital cost and converts it to operational cost i.e. you don't need to buy a huge server upfront rather than you can pay as you use those resources which provides high flexibility. Which result in total reduction of cost.

- Less guess work involved you can increase or decrease your servers as and when required so you don't need to guess how many servers are needed.

- No need for maintaining server rooms or have physical space for these servers

- With cloud you can go up and running in a few minutes 

- Most clouds runs at massive scale which provides the benefit economies of scale in prising and maintaining

After researching there seems to be a lot of cloud providers available right now like GCP, AWS, Azure, Alibaba, Oracle, IBM. I've chosen AWS as my platform of choice for running the cloud. AWS is the leader in cloud services and contains the most variety of service. Stay tuned on how I learn AWS cloud.
Jump and Slide
Published: 2021-05-15 09:35:20

<p>Original animation by Vitaly Silkin: <a href="https://dribbble.com/shots/4268258-Evitare-loader" target="_blank">https://dribbble.com/shots/4268258-Evitare-loader</a></p>

<p>Also inspired by the @keyframers! <a href="https://www.twitch.tv/keyframers" target="_blank">https://www.twitch.tv/keyframers</a></p>

{% codepen https://codepen.io/ste-vg/pen/OEbYqZ %}
Debugging by taking a break
Tags: coding
Published: 2021-05-15 09:33:39

We all know that if you're stuck on something, taking a break makes it easier to solve when you get back. I knew it too. And then this week I discovered I didn't *know* it. So this is a reminder to everyone who, like me, needs one from time-to-time.

# If you are stuck, take a break

Any length will do.

If it's the end of the day and will wait until tomorrow, leave it until tomorrow. You will solve it in 5 minutes.

A 5 minute break can do wonders. If you're at home it's a good time to do a quick household chore. Your brain will work on the problem in the background and as a bonus, that household chore also gets done!

Longer breaks also work. Have you got something else pressing to do? Then do that and come back to this.

Are you trying to get just this one thing done before lunch? Take an early lunch and come back to it. You'll get it solved quicker and you won't be hungry.

### You can also ask someone

You don't even necessarily need an answer. Just explaining the problem to someone can often mean you figure out the problem.  [You can get yourself a rubber duck](https://en.wikipedia.org/wiki/Rubber_duck_debugging) or write it out, as if you're going to send it to someone or post it somewhere. You might well solve it before you've finished typing it all out.

Here's the reminder again:
# Don't stay stuck, take a break
Why Rest api's are Good and Graphql api's Better
Tags: graphql
Published: 2021-05-15 09:25:50

GraphQL was internally developed by Facebook in 2012 and was later open sourced in 2015. The idea came up when facebook needed to rebuild its mobile native application, Facebook needed a data-fetching API powerful enough to describe all of Facebook yet simple enough to be easy to learn by their developers, now graphql powers tech giants like Netflix, Twitter, Shopify etc.

Now wondering what it is about graphql that outweighs rest, well lets get on with it.

##Data Fetching
![Graphql and Rest data fetching](https://res.cloudinary.com/practicaldev/image/fetch/s--Ihk6Q-tj--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/i/57q0p05ztpasjs90wpkd.png)
Data fetching is one of the obvious reasons we use api's, graphql makes data fetching easier by only exposing one endpoint to access data from the server, unlike rest where we have to make multiple requests to multiple endpoints.

##Network Requsts
![Graphql and Rest network requests](https://blog.testproject.io/wp-content/uploads/2020/05/Screenshot-2020-06-01-at-10.42.35-PM.png)
As said earlier, Graphql exposes only one endpoint which reduces trips and network requests to the server to fetch data, while Rest exposes multiple endpoints and increases trips and network requests to the server.
As you can see in the image above, to grab a users profile, users posts and users followers with graphql we only make a request to the server while we make 3 requests to the server using rest apis to grab all the data we need.

##Over/Under Fetching
* Graphql is a declarative data fetching specification and query language.
![Graphql fetching](https://cdn-media-1.freecodecamp.org/images/7oVDwxTOP3hSztQqeOs98Qp8jXHF-MvmqWUl)
we only fetch what we need from the server by constructing our query to only include what we need.
* Rest apis gives you more or less data than is needed for the client at a point.
![Rest fetching](https://image.slidesharecdn.com/elixirgraphqlabsinthe-chicagoelixir2019-190412180345/95/elixir-graphql-absinthe-20190410-15-638.jpg?cb=1555092335)
This makes the server spit unecessary data that would not get used by the client, therefore making uneccessary requests.

##Api Versioning
When the arise for addition of new features come in, you can easily add additional fields, queries, mutations etc to the server and other parts would not be affected, also it is easier to remove old features and make them backward compatible without any breaking changes.

#Should I Abandon REST for GraphQL?
Graphql can be a life saver when when building scalable applications, but you do not need to rewrite or migrate applications that have been designed to use REST api. Rather you should plan to use GraphQL for future applications.

#Conclusion
REST for sure is not going anywhere soon. For most small applications, there would not be significant increase in performance over REST, the real magic of GraphQL plays in as applications scale and the application becomes bigger.
Bootstrap 5 Responsive Search Box
Tags: css, html, bootstrap, webdev
Published: 2021-05-15 08:50:00

The search box is the main part of a dynamic website like an e-commerce website to find your queries. So here we made a responsive search box in bootstrap 5.


In this element, we used bootstrap 5 grid system and utility classes. Also, we used the form component to make this search box. Here we used custom class form background and we customize bootstrap class. For making responsive we used CSS media quires.

Make it yours now by using it, downloading it, and please share it. we will design more elements for you.


[Source code](https://w3hubs.com/bootstrap-5-responsive-search-box/)
crypto is king for easy transfer
Published: 2021-05-15 08:29:30

After a positive opening, the markets turned negative and stayed in the red for most of the day. The market breadth was negative, with 34 of the Nifty50 stocks declining today.
The Nifty FMCG (+2.1%) was the only sectoral index to close in the green, while Nifty Metal (-3.7%) declined for the third consecutive session, and was the top loser today. It was followed by the Nifty Realty index (-3.1%).
How to send email using PHP?
Tags: webdev, beginners, opensource, programming
Published: 2021-05-15 08:26:22

Recently I started learning PHP. I was building a practice project where I want to send the email to my email address from the contact us page on my site. Then I wrote the following code. 

I know many of the beginners struggle in this part so I am sharing the code so that one can use it with any HTML form they have on their site.

So the steps are:

Step 1: Create a HTML contact form

Step 2: Create the .php file when someone clicks the submit button it will go to the .php file which we defined in the form action.

```
<?php
//get data from form  
$name = $_POST['name'];
$email= $_POST['email'];
$message= $_POST['message'];
$to = "youremail@mail.com";
$subject = "Mail From website";
$txt ="Name = ". $name . "\r\n  Email = " . $email . "\r\n Message =" . $message;
$headers = "From: noreply@yoursite.com" . "\r\n" .
"CC: somebodyelse@example.com";
if($email!=NULL){
    mail($to,$subject,$txt,$headers);
}
//redirect
header("Location:thankyou.html");
?>
```

Hope you will find it helpful.
When was the last time you have implemented one of the design patterns? what was the problem you were trying to solve?
Tags: discuss
Published: 2021-05-15 07:55:05

There are a lot of resources out there explain the different kinds of design pattern. Most (if not all) these resources are based on imaginary scenarios for simplification. 


So, what about sharing the last time you have implemented one of the design patterns in a real world project?
HTML : chucknorris is color or martial artist?
Published: 2021-05-15 07:48:52

# Who is Chuck Norris?
[Chuck Norris](https://en.wikipedia.org/wiki/Chuck_Norris) is American martial artist and actor.

# How is he related to HTML color?
The reason is the browser can not understand `chucknorris` as color and try to somehow translate it to what it can understand and in this case into a hexadecimal value.

Most browsers will simply ignore any NON-hex values in your color string, substituting non-hex digits with zeros.

`chucknorris` starts with `c` which is recognized character in hexadecimal, also it's converting all unrecognized characters into 0!

So `chucknorris` in hexadecimal format becomes: `c00c00000000`, all other characters become 0 and c remains where they are.

Now they get divided by 3 for RGB(red, green, blue) as -
`R: c00c, G: 0000, B:0000`

But we know valid hexadecimal for RGB is just 2 characters, means `R: c0, G: 00, B:00`

So the real result is:
```css
#c00000
```
Let's understand this with below presentation from browser point of view -
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/psfe07lybz8c6m0xh55e.jpg)

Let me demonstrate this to you but with legacy `font` tag but we are focused here for color so let's understand -
```html
<p><font color='chucknorris'>Reddish</font></p>
<p><font color='#c00000'>Same as above</font></p>
<p><span style="color: chucknorris">Black</span></p>
```
Let's see the live demo -
{% stackblitz js-gwpdzm file=index.html %}

<a href="https://www.buymeacoffee.com/rkycom" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

With all that being said, I highly recommend you keep learning!

Thank you for reading this article. Please feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/www-rajeshkumaryadav-com/) and [Twitter](https://twitter.com/rky_com).
Laravel Anonmyous Blade Components
Tags: laravel, components, blade
Published: 2021-05-15 07:31:54

Blade Components have been around Laravel since long, however they gain immense popularity with the release of Jetstream. Jetstream uses Blade Components to keep all the Views consistent and helps to avoid duplicating any Html and thereby keeping the things DRY.

However, if you have never used Blade Components, the syntax `x-` in blade could be daunting.

In this Video, I explain how you can get Started on using Components. The Video also explains the Slots, Multiple Slots, Attributes Merging and Props.

{% youtube wwUlcV4_c9U %}

For more amazing content related to Laravel, you can follow me on [Twitter](https://twitter.com/TheLaravelDev).
Laravel 8 Ckeditor Image Upload Example Tutorial With Preview

Tags: laravel, php, programming, tutorial
Published: 2021-05-15 07:25:56

<p>Hi Friends,</p>
    
<p>Today, i would relish to apportion with you how to utilize and install ckeditor with image upload in laravel 8. i will utilize simple laravel image or file upload code with ckeditor file upload in laravel 8 follow step by step.</p>

more..

If you want to see full example follow this link..

https://codingtracker.blogspot.com/2021/05/laravel-8-ckeditor-image-upload-example.html
How to use aria labels in your HTML – and why you should: the video
Tags: a11y, webdev, html
Published: 2021-05-15 07:21:26

If you need to display multiple links with the same text on a web page — such as 'read more' — this short video helps you understand why you should be using aria labels to improve accessibility for people who use screen readers and assistive technology such as VoiceOver, on your website.

{% youtube dnhnSoMEv6Q %}

Prefer to read a blog post? [Click here to read the post on DEV](https://dev.to/whitep4nth3r/when-to-use-aria-labels-in-your-html-18ph).

Build stuff, learn things, love what you do.
HANGMAN - Bollywood & Hollywood Movies
Tags: codecademy, python, hangman, gamedev
Published: 2021-05-15 06:38:22

## Why Hangman
Back in school, whenever we were stuck with a boring teacher or a boring lesson, we'd turn to playing the guessing game. In our slightly different version of Hangman we guessed only Bollywood movie names. It was one of my favourite games growing up.

Then one day in college while I was smoking up for the first time, I started playing another version of Hangman called [Hangaroo](https://www.miniclip.com/games/hangaroo/en/#) with a couple of friends. I was pleasantly surprised that I was guessing almost everything correctly. I remember asking my friends in total amazement if that sudden rush of brains was due to Marie Jane, to which they laughingly, but convincingly said yes. And I fell in love with that game all over again. No wonder, on being tasked to create a game as a part of my [Computer Science skill path on Codecademy](https://www.codecademy.com/learn/paths/computer-science), I chose Hangman! In my version of Hangman, you can choose a category out of these 3 to play - Bollywood Movies, Hollywood Movies & Famous Tourist Places, and you can change the category after any round.

## The Code
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sfa3u66307q00aql9r2j.gif)

I wrote the code on [replit](https://replit.com/@nptl) which I've connected to a github repo. The current code of the game that you'll [find here](https://github.com/nptl/hangman) is the second iteration. The first time I nearly finished writing the code without much pre-planning, I got stuck in the complicated structure I had created and it got too difficult for me to debug. So I scrapped it altogether, planned better and then wrote again. What I've done basically is - identify the most common element which will be displayed to the player often and break it down into components which will be varying with different situations.

Every time the player makes a guess, the following gets printed:
* The hangman picture
* A message from the hanging man
* The status of the word/phrase being guessed
* Missed characters so far
* Optional final message - if game over or round won

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

So I created a class and defined methods for each component of the above output, in addition to various other methods to choose a word randomly from a long list, to check if the guess is correct, to print the final response, etc., so that I could refactor the code as much as possible.

## Final Touches
Then at last, for garnishing, I added some ASCII art to open the game with. Checkout this dope page where you can [create big ASCII letters in different fonts](https://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Your%20input%20here).
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3xvajq1s06xzgbz8hnft.png)

## Code on Github
**You can find the code for the game here on [github](https://github.com/nptl/hangman).**
Check it out and let me know your thoughts in comments.