teleren/devto huggingface dataset:
Add sendgrid as email provider with Laravel.
Tags: laravel
Published: 2020-06-01 19:56:57

---
title: Add sendgrid as email provider with Laravel.
published: true
description: Add sendgrid as email service to your Laravel project.
tags: Laravel
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/qxibl619z6jjt00pkbsf.png
---

## Install the package

```php
composer require s-ichikawa/laravel-sendgrid-driver
```

## Add service provider 

Add service provider in "config/app.php" in "providers" key, at the very bottom:

```php
'providers' => [
    Sichikawa\LaravelSendgridDriver\SendgridTransportServiceProvider::class
];
```

## Add the service configuration in "config/services.php" at the very bottom of the file:

```php
    'sendgrid' => [
        'api_key' => env('SENDGRID_API_KEY'),
    ],
```

## Add credentials

Now we need to change the “.env” file to add the SendGrid Values, you can sign in with a free account in https://app.sendgrid.com and get 100 monthly emails for free or get a payment plan for more.

## Create credentials.

The username and password to "signin" are going to be used in ".env" file.

You can go to settings on sidebar and click on "API keys" option.

Then press the blue button "Create API Key", you can set any name to your api key, and in “API key permissions” by default is selected “Full access” so create it with it.

## The ".env" file:

```env
MAIL_DRIVER=smtp
SENDGRID_API_KEY='your-generated-token'
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME='your-user-email-to-login-on-sendgrid'
MAIL_PASSWORD='your-password-to-login-on-sendgrid'
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourapp.com
MAIL_FROM_NAME=yourapp.com
```

## Note:
___

MAIL_PORT will change from “25” or “587” for unencrypted/TLS connections and 465 for SSL connections.
Install Laravel Valet
Published: 2020-06-01 19:56:29

---
title: Install Laravel Valet
published: true
description: Install Laravel Valet.
tags: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/a2nj88r8r7ibh1gdut6p.png
---

## Install Homebrew

If you has not homebrew you can install it here: https://brew.sh

### command to install homebrew:

Open your terminal command+space:

```php
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```

### If you have installed homebrew you can update it with the next command:

```php
brew update
```

### Install PHP

```
brew install php
```

### Install composer

If has not composer installed you can go to: https://getcomposer.org/download/

And in terminal paste:

```
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
```

Move the "composer.phar" file:

```
mv composer.phar /usr/local/bin/composer
```

Then run:

```
composer
```

You must see this output:

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

### Install the Laravel valet:

```
composer global require laravel/valet
```

Move valet to home path:

```
export PATH=”$PATH:$HOME/.composer/vendor/bin”
```

Valet install command

```
valet install
```

### Create a folder to host Laravel projects.

In this example I named it "www" or "Laravel" as you wish:

```
mkdir wwww
cd www
```

### Install composer Laravel installer:

In terminal add the command:

```
composer global require laravel/installer
```

Create a bash profile file:

```
nano ~/.bash_profile
```

This command will open nano editor in the terminal.

Write bash profile content

Add the next line as bash profile content:

```
export PATH=~/.composer/vendor/bin:$PATH
```

Save and exit (press first control+x and then press y).

Then execute the next command in terminal:


```
source ~/.bash_profile
```

### Create a new Laravel project

```
laravel new yourapp
```

Now you can go to the browser and type the next URL: yourapp.test, you will see:

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

### Install Mysql

Install mysql:

```
brew install mysql@5.7
```

Restart mysql service:

```
brew services start mysql@5.7
```

Now to add to your setup, maybe you would need a GUI to view database structure and content easier, I strongly recommend SequelPro: https://sequelpro.com/download

To set a connection your credentials are:

- name: anything you wish I used 'development'
- username: root
- password: empty

If you press add to your favorites you would have this connection in your sidebar all the time available with just one click.
Basic Summary of Machine Learning
Tags: machinelearning
Published: 2020-06-01 19:50:29

Artificial Intelligence - It is such a broad term that everyone has been hearing of since the last decade, and it is often used in a very vague manner. What is exactly Artificial Intelligence i.e AI?
It is basically a kind of technology, which is used to make a machine smart, and this concept has been actually found since the 50s!

You must have used alexa/siri and you may have seen many recommendations specially designed for you while surfing through amazon or netflix! These are some applications of AI. The concept includes training the machine with known data and then letting it make outputs on its own for some other data. There is no more need of hard coding for infinitely many cases! Hence, we are making the machines smarter.

Machine Learning and AI are often linked together. AI is a very broad term, while ML includes all the processes behind it with all the algorithms. So we can say that ML is a subset of AI. 
Deep Learning is also ML, but it is applied to large datasets, so it is a subset of ML.

There are many applications which make ML so fascinating!
For example, detecting the object given in the photo, recognising human speech (used in siri), processing and understanding human language, predicting house prices, producing it's own music, self driving cars etc. and the list goes on. Yes, a machine can do all these!

And with technological advancements, ML has been introduced in so many fields and applications and it is just ever-growing. It will be really interesting to see how much ML will grow in the coming years!
E8: Are Your Messages User Friendly (& How To Design Them)
Tags: ux, ui, design, designer
Published: 2020-06-01 19:47:20

💪In this video:
I want to share the top six recommendations on how to write and design user-friendly error messages. The recommendations are based on guidelines created by Microsoft and Apple design guidelines.



⬇️Previous episodes:
- [Are You New to UX? Here Are The Best 5 Tips (And How To Actually Make Them Work)](https://dev.to/eleftheriabatsou/e2-are-you-new-to-ux-here-are-the-best-5-tips-and-how-to-actually-make-them-work-4id4)
- [Should Designers Learn To Code & Why It's Not A Good Question] (https://dev.to/eleftheriabatsou/e1-should-designers-learn-to-code-why-it-s-not-a-good-question-860)!
- [7 Practical & Effective Methods To Improve At Visual/UI Design](https://dev.to/eleftheriabatsou/3-7-practical-effective-methods-to-improve-at-visual-ui-design-3480)
- [To Be a Successful UX Designer Give up these 15 Things](https://dev.to/eleftheriabatsou/4-to-be-a-successful-ux-designer-give-up-these-15-things-j0c)
- [New to a UX workplace? Know these 22 things!](https://dev.to/eleftheriabatsou/5-new-to-a-ux-workplace-know-these-22-things-45gd)
- [A Brief Guide in Color Theory](https://dev.to/eleftheriabatsou/e6-a-brief-guide-in-color-theory-1hm5)
- [How to build a design system](https://dev.to/eleftheriabatsou/e7-how-to-build-a-design-system-1oj)


👋Hello, I' m Eleftheria, an app developer, master student, freelancer, public speaker, and chocolate lover.


This is a new series on my channel and I'm going to be talking about UX and UI.
This is the 8th episode out of 8.
If you have any feedback, please do share it with me. Thank you.



😎Top 3 list:
- How to stay motivated | A developer's edition | @BatsouElef: https://youtu.be/qMvEtb5OxNo
- How to be a Better Problem Solver | Tips and solutions: https://youtu.be/dELt7yKIxIA
- Simple Tips to Build a Personal Brand as a Developer (+ personal examples): https://youtu.be/7s0o1gi0iP0

🥰If you liked this video please share

🍩Would you care about buying me a coffee? You can do it here: [paypal.me/eleftheriabatsou](paypal.me/eleftheriabatsou) but If you can't that's ok too!


**************************************

🙏It would be nice to subscribe to my [Youtube](https://www.youtube.com/c/EleftheriaBatsou) channel. It’s free and it helps to create more content.

🌈[Youtube](https://www.youtube.com/c/EleftheriaBatsou) | [Codepen](https://codepen.io/EleftheriaBatsou) | [GitHub](https://github.com/EleftheriaBatsou) | [Twitter](https://twitter.com/BatsouElef) | [Site](http://eleftheriabatsou.com/) | [Instagram](https://www.instagram.com/eleftheriabatsou/)
My First Rust SO Accepted Answer 
Tags: rust, codenewbie, codepen
Published: 2020-06-01 19:37:14

After years of on and off learning, I've finally earned my first Rust accepted answer on StackOverflow. 

{% stackoverflow 62034733 %}

I'm beginning to feel my increased power to fight the Borrow Checker. Like I'm a martial art student being able to evade a blow from the Sensei for the first time.

So if anyone is learning Rust, keep at it and don't get too stressed out climbing the learning curve. Just follow the instructions, and use lots of libraries to avoid facing the Borrow Checker head-on.

<hr/>

If you're interested in my non-programming thoughts, you can [subscribe to my newsletter BETA School](https://joechasinga.substack.com/).

[![Joe Chasinga Newsletter BETA School](https://dev-to-uploads.s3.amazonaws.com/i/nhx7l8n1ufgeoqlc3pc7.png)](https://joechasinga.substack.com/)
JS Double Equals Vs Triple Equals	
Tags: javascript, beginners
Published: 2020-06-01 19:12:34

<strong style="color: red; opacity: 0.80;">Triple Equals </strong>
 It looks for both types and value 

```
 - Both Number and equal values
     2  === 2 // true

 -  Both String and equal values
    “Hello” === “Hello” // true 

 - Both booleans and equal values 
    true === true  //true 

 - Number Vs String

    43 === ’43’ //false

 - Different types ( Boolean Vs Number)
   
   false === 0 //false 
```

<strong style="color: red; opacity: 0.80;">Double Equals </strong>
It just looks for value. Double does type coercion which means it tries to convert them into common type before comparing.

```
   77 == ’77’ //true
  
   77 === ’77’ //false

   false === 0 //false

   false == 0 //true  
```

<strong style="color: red; opacity: 0.80;">Falsy Values Comparison:  </strong>
There are 6 falsy values in JS: false, 0, "", null, undefined and NaN 


     false == 0 //true
    
     0 == “” // true
    
     “” == false //true

     null  == null //true
  
     undefined == undefined //true
  
     null == undefined // true  

     - Note: NaN is not equivalent to anything 
  

     NaN == NaN //false
  
     NaN == null //false
Destructuring arrays as objects
Tags: javascript, webdev, react, angular
Published: 2020-06-01 18:48:54

Destructuring is one of the widely used feature of ES6. Since arrays are also objects in javascript we can destructure them by using their indices.

```js
let fruits = ["Banana", "Orange", "Apple", "Mango", "Kiwi"];
let { 0:first } = fruits;
console.log(first); // Banana
```
In above example we are grabbing the first element of the array. Now we will go a little deep and try to grab the first, last and middle elements.

```js
let fruits = ["Banana", "Orange", "Apple", "Mango", "Kiwi"];
let { length, 0:first, [Math.floor(length/2)]:middle, [length-1]: last } = fruits;
console.log(length, first, middle, last); // 5, Banana, Apple, Kiwi
```
Array have length property, so we grabbing that length and destructuring allows us to use that length right inside. Hence, we are using that length to calculate the middle position.

Happy coding 😃.
Leveraging DynamoDB Split for Heat: an Architecture Suggestion
Tags: dynamodb, nosql, aws
Published: 2020-06-01 18:48:12


>_Disclaimer: I'm not affiliated with AWS and this is not technical advice. In case you consider using this pattern in production, please be aware the core feature is very briefly documented and there is actually no performance guarantee._


According to the [docs](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html#bp-partition-key-partitions-adaptive-split), DynamoDB's auto-split, _split-for-heat_ or _Adaptive Capacity auto-split_ is a (briefly documented) feature that "_rebalances your partitions such that frequently accessed items don't reside on the same partition_".

After performing [some tests](https://dev.to/ndrestone/why-you-can-t-yet-deprecate-write-sharding-on-dynamodb-4ak1) to have a better understanding on how this feature actually works, and to acknowledge that it isn't a replacement for [_write sharding_](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-sharding.html), I came up with this architecture as a way to improve read costs **for, maybe, some use cases**.

## Lazy Sharding

![Lazy Sharding](https://dev-to-uploads.s3.amazonaws.com/i/er6hlhjyccboiue43fz2.png)
<figcaption>Lazy Sharding</figcaption>

Basically, the idea here is to only write-shard the partition if our requests are being throttled. If they are, run a _de-sharding_ strategy to rewrite the items to a single partition, while DynamoDB takes care of the repartitioning. When reading, also perform an attemptive read on the main partition first, only performing a sharded read as a second attempt.

Alternatively, for cases where the reads are disproportionally high, not allowing the partitioning to happen based on write velocities, similar _de-sharding_ jobs can be run, so attemptive reads on a single partition can be done in order to save RCUs.

## Is it Worth it? Would it work?

Honestly, in addition to the fact that there's no performance guarantee on the underlying feature, I'm not sure if there are many use cases for this. So, please tell me what you think, leave your feedback!

--
André
Learn SQL using Dolt
Tags: sql, database
Published: 2020-06-01 18:47:24

Hi dev.to,

I'm the CEO of the company that built Dolt. Dolt is a SQL database with git-style versioning. DoltHub is a place on the internet to share Dolt databases.

We think Dolt is an especially good way to learn SQL. Dolt is almost effortless to set up, contains real data, you can make write queries without fear, examine your diffs, and publish your work to the DoltHub community. 

We wrote a blog post expanding on all those topics here:

https://www.dolthub.com/blog/2020-06-01-learn-sql-dolt/

Check it out!
A better way to publish CSVs
Tags: database, sql
Published: 2020-06-01 18:43:37

I'm the CEO of the company that built [Dolt](https://github.com/liquidata-inc/dolt) and DoltHub(https://www.dolthub.com). Dolt is as if Git and MySQL had a beautiful baby. DoltHub is GitHub for Dolt, a place on the internet to share Dolt repositories.

I wrote a blog about how to publish CSVs on DoltHub so you can do it too.

https://www.dolthub.com/blog/2020-04-29-dolt-dolthub-publish-csv/

This blog uses the Tatoeba sentence translation database as am example. It's a collaborative database of sentence translations that is published weekly.

Check it out and publish some data. Pretty please.
View All EC2 Instances from all the regions
Tags: aws, devops
Published: 2020-06-01 18:25:21

A commonly asked question - I see it on SO, fb groups, quora and everywhere else. Few suggests python scripts, few suggests manual methods - here I am gonna share a very easy and quick method to view EC2 instances (or any other service) across all your regions without any scripting or anything.

Login to aws console and click on "Resource Groups" from the top bar, from the dropdown shown, select "Tag Editor".
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/934knxn0cex74uzqldbe.png)


From the regions dropdown, select "All regions", then select the resource type (`AWS::EC2::Instance` for this example), click 'Search resources'.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bxo8qdv5xgs8tn4l6xfc.png)
Lazy-loading nativo para la web 
Tags: html, webdev, javascript, css
Published: 2020-06-01 18:07:59

Hace un par de semanas @addyosmani nos sorprende con este tweet  

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6kqwyi32qbwkm3a415ru.PNG)

Esto tiene unas implicaciones magnificas  ya que  mejorará muchísimo
el rendimiento de nuestros sitios.   

##**¿En qué consiste ?**

Desde la versión 76 de chrome ya nos es posible usar el atributo **loading** sin la necesidad  de crear lógicas  complicadas y  solo 
cargando las imágenes  o iframes  solicitados en el punto exacto del 
scroll.   

## **¿Cómo funciona ?**
Su implementación es muy sencilla, solo debemos agregar  el atributo  
**loading** a el elemento img,  con esto debería ser suficiente 
para tener una carga diferida de  nuestras imágenes qué estén en foco y 
fuera de el.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mx1scxpau15nz003ktgh.PNG)

- **Auto**: Comportamiento por defecto del elemento, es como si notuviera 
  el trbuto 
- **lazy**: Aplaza el llamado al recurso hasta que  este en foco de 
  pantalla
- **eager**: carga el recurso inmediatamente sin importar donde este 
   localizado en nuestra pagina.

## **Compatibilidad en navegadores**

Hasta el día de hoy esta funcionalidad esta soportada por navegadores basados en chromium  y Firefox. Pero siempre es posible consultar [Compatibilidad en buscadores](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#Browser_compatibility)  

## **Demo**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wnmpt5j29bm1jev2mkvl.PNG)

{% codepen https://codepen.io/Corovino/pen/JjGPyZG %}

## **Conclusiones**

Este es un gran aporte para mejorar el desempeño de nuestros proyectos, solo queda ponerla aprueba y disfrutar. 

Este post es un resumen en español del articulo en ingles
[web.dev](https://web.dev/native-lazy-loading/?fbclid=IwAR2CgCFtNfXBLCMm0dvOtAxUbp8Cz9TymNPaEninvl3JUTedjoPhFkegItA) donde podrás profundizar mas sobre esta nueva funcionalidad.
Using Cloudflare Workers for an entire API
Tags: sanitycheck, question
Published: 2020-06-01 18:03:35

Has anybody used Cloudflare Workers (or any other serverless provider!) for an entire REST API?

I am thinking of creating my new app's API using workers. The API will include user authentication w/ JWT, as well as multiple CRUD repositories either using Cloudflare's KV database or some other storage system.

My question is, is Worker's (or serverless in general) a good option here?

My normal experience is renting a full server (root access) and running my applications through that, which is a stark contrast to writing an application and deploying to hundreds of edge servers!

Do I need to worry about sync issues, etc?
Does anyone have any meetup alternatives?
Tags: watercooler, discuss, eventsinyourcity
Published: 2020-06-01 17:52:32

[I found this article on meetup alternatives interesting](https://marcusnoble.co.uk/2019-10-21-meetup-alternatives/). I'm an organiser for [Cardiff R Usergroup](https://www.meetup.com/Cardiff-R-User-Group/), and regularly attend quite a few other events in the city. 

Is meetup common for tech groups where you are? Do you or events you go to use anything different?
Vanilla by Cinnamon
Tags: gftwhackathon, opensource, webmonetization
Published: 2020-06-01 17:35:57

[Instructions]: # (To submit to the Grant For The Web x DEV Hackathon, please fill out all sections.)


## What I built
Vanilla is a new API which adds an extra layer of security for monetized content. When users attempt to access monetized content they will transfer Vanilla’s payment information to a WM Provider, instead of their own, WM Provider then streams payments to Vanilla which we forward to a creator's Payment Pointer. Additionally we shield information of individual Payment Pointers with ours.

### Submission Category: 

Foundational Technology


## Demo
* [Sandbox](https://ty7rd.sse.codesandbox.io/)
* [Live Code](https://codesandbox.io/s/vanilla-express-demo-ty7rd)
* [Github Repo](https://github.com/vanilla-wm/vanilla-express-demo)

## Link to Code

https://github.com/vanilla-wm

[Note]: # (Our markdown editor supports pretty embeds. If you're sharing a GitHub repo, try this syntax: `{% github link_to_your_repo %}`)


## How we built it 

[Note]: # (For example, what's the stack? did you run into issues or discover something new along the way? etc!)

Vanilla provides Web Monetization verification features for applications that require higher level of flexibility.

>💡 Vanilla is currently working on implementing [STREAM Receipts](https://interledger.org/rfcs/0039-stream-receipts/). STREAM Receipt is a proof of payment provided by Web Monetization Wallet.

Vanilla solves complex use-cases where websites want to ensure
that a visitor is paying. This can be very tricky and requires deep knowledge of ILP and Web Monetization. We made this much easier for anyone. Current Vanilla project includes Vanilla Admin, Vanilla API, Vanilla ILP and Vanilla App.

### [Vanilla App](https://vanilla.so)
App was written in Next.js and describes the Vanilla project
and the main features for Websites.

### [Vanilla Admin](https://admin.vanilla.so)
Users are able to set the payment pointer and read Vanilla API documentation. Admin was build in Next.js as a simple client-side React application that uses GraphQL for fetching data. We will extend the endpoints and features for Web Monetization in the future.
 
### [Vanilla API](https://wm.vanilla.so/graphql)
It is an GraphQL API that provides a set of endpoints for payments verification and Web Monetization features.

### Vanilla ILP
Vanilla ILP is the foundation of our Vanilla project. It is build with Nest.js and WM access. It enables payment verification and multiple other WM features such as payment splitting and analytics. 

## Additional Resources/Info 
Read more about it in our Coil Blog post at https://coil.com/p/Cinnamon/Hackathon-/vNQIJIL6-

[Reminder]: # (We hope you consider expanding your submission into a full-on application for the Grant for the Web CFP, due on June 12.)
Write a blog explaining your granny about ML.

Published: 2020-06-01 17:33:15

ML is a term which is actually a bit hard to understand even for a young mind. As even we don't know what are the applications of this and where and where are they used. ML for a non programmer is equivalent to magic as things what one can imagine is done by a human is done by a machine which is something really ineradicable. 

Predicting something is one of the example of it. Like there is a match which is yet left to begin or even a tournament. A conclusion can be made without even letting the match start that who is gonna win and due to latest technology and programming alogs. its really possible to find out what are the percentage of chances that which team will win and most of the time this does happen.

ML is something which is made to make our life's easy. Just the way the kings of the older time used to have servant or guidance or ministers to help him out for suggestion. ML is something which is like our guide which will help each and every person in the coming time to choose whats right for them and find solutions for problems when a person cant think of a solution. A tech helps us improve our life and make all of us feel like Kings.