teleren/devto huggingface dataset:
PHP 7 - Two useful operators, You Need to Know
Tags: php, opensource, beginners
Published: 2020-07-17 13:50:11

##**Spaceship operator:**##

We all are using comparison operators like *greater than (>), less than (<), greater than equals(>=), less than equals (<=)*, etc. These operators are very useful in daily programming tasks.

In PHP 7, We have one more comparison operator ***Spaceship Operator (<=>)***. This operator is used to compare expressions.

It will *Return 0 if values on either side are equal, Return 1 if the value on the left is greater, Return -1 if the value on the right is greater*.
```php
<?php

echo 5 <=> 5; // Output 0 as 5 equals to 5
echo 4 <=> 5; // Output -1 as 4 is less than 5
echo 6 <=> 5; // Output 1 as 6 is greater than 5
```
***Example :***

Suppose, we have an array of products having product name & price like below :
```
$products = [
				['name' => 'Product 1', 'price' => '25'],
				['name' => 'Product 2', 'price' => '50'],
				['name' => 'Product 3', 'price' => '46'],
				['name' => 'Product 4', 'price' => '80'],
				['name' => 'Product 5', 'price' => '15'],
			];
```
And we want to sort it by price so that products with the highest price should come first on the array. For that, we can use <code>usort</code> function of PHP with a spaceship operator like below :
```php
<?php

usort($products, function ($prod1, $prod2) {
    return $prod2['price'] <=> $prod1['price'];
});

print_r($products);
```
**Output :**
```
// The output will be sorted products by price in descending order.

$products = [
				['name' => 'Product 4', 'price' => '80'],
				['name' => 'Product 2', 'price' => '50'],
				['name' => 'Product 3', 'price' => '46'],
				['name' => 'Product 1', 'price' => '25'],				
				['name' => 'Product 5', 'price' => '15'],
			];
```

##**Null coalescing operator:**##

Another cool operator is ***Null Coalescing Operator (??)***. which can be replacement of the ternary operator ( isset($a) ? $a : $b ) in conjunction with isset() function.

If you ever used Javascript or VueJs you might be familiar with this operator already.

The null coalescing operator returns its first operand if it exists and is not NULL; otherwise, it returns its second operand.
```php
<?php

$authorName = $author ?? 'Unknown'; 
// Output author name if $author is set or else 'Unknown'

// This is equivalent to:
$authorName = isset($author) ? $author : 'Unknown';
```

The null coalescing operator can be chained and will return the first defined value from chain.
```php
<?php

$authorName = $author ?? $currentUser ?? 'Unknown';
```
It will return author name from first defined value out of *$author, $currentUser* if both are not set then return *'Unknown'*.

...
What are the best hours to post your tech tips on Twitter?
Tags: discuss
Published: 2020-07-17 13:42:17

Just wanted to ask you, when do you think are the best hours or timeframes to post your content on Twitter?

### From my quick tests during these days I found:
**Mornings**: Reported my article a **0** views increase, so not too good specially for people like me that does not have any followers.

**Afternoons**: Reported my article a **30** views increase, so looks like a better time.
[Challenge] 🐝 FizzBuzz without if/else
Tags: challenge, javascript
Published: 2020-07-17 13:35:10

> _This challenge is intended for Javascript, but you can complete it with any language you like and can._

****

Most of us will know the [**FizzBuzz**](https://en.wikipedia.org/wiki/Fizz_buzz) game/exercise and probably have done it many times. It should be a simple and straightforward exercise for most developers...

**BUT can you do it without using `if/else` statements?**

****

## Challenge Description
Write a program that outputs the string representation of numbers from 1 to N.

But for multiples of 3, it should output "Fizz" instead of the number and for the multiples of 5 output "Buzz". For numbers which are multiples of both 3 and 5, you should output "FizzBuzz".

**Curveball:** You must not use if/else statements, and ideally, no ternary operator.

**Example:**

```js
const n = 15;

/* 
Return:
  [
    "1",
    "2",
    "Fizz",
    "4",
    "Buzz",
    "Fizz",
    "7",
    "8",
    "Fizz",
    "Buzz",
    "11",
    "Fizz",
    "13",
    "14",
    "FizzBuzz"
  ]
*/
```


****

I will comment my solution in a couple of days.

💪 **Best of luck!** 💪  

****

**Credits:**
_Cover Image from https://codenewbiesite.wordpress.com/2017/01/29/fizz-buzz/_
YouTube Video | HTML Crash Course - 3
Tags: youtube, html, webdev, showdev
Published: 2020-07-17 13:28:55

I had decided to create a HTML tutorial for absolute beginners. This video is for those who are just starting in Web-development. After this video, you can take the code in this tutorial and treat as as your little cheatsheet for HTML.

Here is the final part of the series.

{% youtube d8Xp1SYbR9M %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
new Github README feature is awesome
Tags: github, html
Published: 2020-07-17 13:27:19

In Github a great README file helps your project to stand out from the sea of open-source software on GitHub. A README is like the face of your project. But now it can also be used to elaborate your current work and profile.
####All you have to do is
* create a new repository with your username, Initialize it with README.md file
* In this README.md file You will notice a format which you can edit or you can use markdown and create a new one.And that's it.
* If you want a cover image, just design one and upload it to this repository, And to show it use `<img src="https://github.com/yourUsername/YourUsername/blob/master/imageName.extension">`.
Note: when you use `<img src="imageName.extension">` it won't work (I don't know why, Although your cover image will show correctly in preview but after commit it won't show in your profile feature preview).
* If you want to add social network badges, Visit [https://github.com/alexandresanlim/Badges4-README.md-Profile](https://github.com/alexandresanlim/Badges4-README.md-Profile)

So, This is it guys,I hope i helped you and you will create a better one.

####You may see my markdown code below,
```<img src="https://github.com/myusername/myusername/blob/master/coverImage.ImageExtension">```
`<h3>👋HI THERE,</h3>`
`<h4>I'm Nalini Ranjan Jatwar</h4>`
`<h4>4TH YEAR UG STUDENT AT IIT KHARAGPUR, INDIA</h4>`
`<p>I'm a Flutter Developer,Competitive Programmer and an Open Source Enthusiast who is highly passionate about building fast,Creative applications. I also like to design wireframes and prototypes in adobe xd</p>`
`<p>🔭 I’m currently working on a Quiz Web Application</p>`
`<p>🌱 I’m currently learning node.js,typescript</p>`
`<p>🤝 I’m looking to collaborate on flutter,firebase projects or Web applications using html,css and javascript</p>`
`</br>`
`<p><a href="myFacebookProfileLink" target="_blank"><img src="https://img.shields.io/badge/facebook-%231877F2.svg?&style=for-the-badge&logo=facebook&logoColor=white" height="32px"></a>
<a href="myInstagramProfileLink" target="_blank"><img src="https://img.shields.io/badge/instagram-%23E4405F.svg?&style=for-the-badge&logo=instagram&logoColor=white" height="32px"></a>
<a href="myLinkedinProfileLink" target="_blank"><img src="https://img.shields.io/badge/linkedin-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white" height="32px"></a></p>`
####Thank You Guys  
You can follow me on [github](https://github.com/nalini21) to see my other projects.
This is my first post here so i'm sorry for any typos.
Send Text Messages from Scraped Website Data with Python on the Cloud
Tags: python, tutorial, wayscript
Published: 2020-07-17 13:18:13

Introduction
------------

Web scraping on the cloud has never been easier. Setting up an automated web scraping script on WayScript only takes a few minutes to do.

Prerequisites
-------------

No prerequisites but some content you might find helpful:

*   [Working with Python](https://docs.wayscript.com/library/modules/python)

Automating a Script to Run Daily
--------------------------------

Most things you create on WayScript can be activated daily by using a time trigger. When setting up the time trigger, we select our time that we want the script to run, and build the script below that tree in the workflow.

![](https://cdn.wayscript.com/blog_img/70/1.png)

#### Scraping our content

We'll scrape our content in this example by using the python module. We'll drag this into our workflow and write some code that looks like this:

<pre>
import requests
from bs4 import BeautifulSoup

ticker = 'AAPL'
url = 'https://finance.yahoo.com/quote/' + ticker

res = requests.get( url )
html = res.text

soup = BeautifulSoup( html, 'html.parser' )
market_cap_elem = soup.find( 'td', { 'data-test' : 'MARKET_CAP-value' } )
market_cap = market_cap_elem.text

print( ticker, 'Market Cap', market_cap )

variables[ 'MarketCap' ] = market_cap
</pre>

With that code, we'll go and scrape information off another webste, and return it to our script as a variable using the variables dictionary. We'll use it to send ourselves a text message.

![](https://cdn.wayscript.com/blog_img/70/2.png)

#### Questions, Concerns?

If there's any questions feel free to message us on discord. We're happy to help! If you want to see this full script template, you can find it [here](https://wayscript.com/user/derrick/sRN003of)
Bootstrap 5 is here! But what has changed?
Tags: css, tutorial, beginners, webdev
Published: 2020-07-17 13:14:29

- jQuery was removed
- Switch to Vanilla JavaScript
- Drop Internet Explorer 10 and 11 support
- Improved grid system
- Improved documentation
- Improved modularity
- Improved forms
- New responsive font
- New utilities & helpers
- Easier customization & theming
- Lighter package
- New API available

One of the frustrating experiences of being a developer is reinventing the base HTML, CSS, and JavaScript for each project. While some prefer to write their own code, it still makes sense to just use an existing framework like Bootstrap.

With all the new updates coming in Bootstrap 5, it’s safe to say that the Bootstrap team is making huge steps to make the framework lightweight, simple, useful and faster for the developer’s benefit.

If you use Bootstrap in your projects, then you will probably love Startup app – Bootstrap Builder. It is a great development tool with lots of ready-made designed and coded templates and themes for faster deployment of your projects.

Access: [Bootstrap 5](https://v5.getbootstrap.com/)
How to prepare for AWS Interview
Tags: aws, amazon, cloud, interview
Published: 2020-07-17 13:13:36

Amazon Web Services (AWS) is a cloud platform that helps companies build apps using templates and containers to streamline the process of development. Since Amazon is such a dominant presence in all types of technology, and AWS is a common forum for multiple websites and services, it is essential for business developers to be able to answer questions from the AWS interview. You'll understand what you can expect in an AWS interview in this blog and how to go about the preparation.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/r1aait11eh28i8j4pl49.png)
Let's take a look at the few bizarre things about the Amazon Web Services before I state some AWS interview questions: 
<ul>
<li>With 47.8 percent of the IaaS public cloud services market share, AWS is the largest market leader among cloud providers. </li>
<li>According to ZipRecruiter, an AWS Software Architect's average monthly salary is $128,858 per year. </li>
<li>AWS Certification is considered one of the highest paying levels of credentials in the USA. </li>
The abovementioned points clearly demonstrate that there are strong demand and job prospects in the sector for practitioners who are capable of managing AWS applications.

<h3> <b> How to Prepare for the Interview? 

<UI>
<li> You can take up the online course at <a href="https://www.udemy.com/course/amazon-web-services-aws-interview-preparation/">Udemy</a> and other such platforms. The courses are mostly very detailed and cover almost all the topics from basic to advanced ones. </li>
<li> You can look for video tutorials on <a href="youtube.com">YouTube</a> to prepare for the interview. This will make you learn the basics of what AWS is and how everything works.</li>
<li> Enroll yourself in an <a href="https://aws.amazon.com/certification/"> AWS Certification</a> and clear the exam. It will help you a lot during the interview sessions as you will already have a lot of knowledge of the platform that will give you a little bit of edge. </li>
<li> Lastly, you can look for <a href="https://codersera.com/blog/51-top-aws-interview-questions/">AWS Interview Questions & Answers</a> to get an idea of the kind of questions that are posed during the interview. These questions will brush up your knowledge and having a look at them right before the interview will help you a lot to land the job.</li>

<h3> <b> To Sum Up...

I would suggest that you use a combination of sources to ace that interview. Keep reading about the platform and that is how you will keep yourself updated. AWS is an ever-growing cloud platform that will have a bright future, so for you to become an AWS professional, you must have full knowledge of it. The interviewers expect you to have an understanding of the basics as the rest can be taught during the training period of your job.
4 Best Drag And Drop Components To Create Draggable Elements on Vue.js
Tags: vue
Published: 2020-07-17 13:08:52

Drag and drop are traditional but enduring features that have been widely used in various web pages since the last century.

To simplify the implementation of the native HTML5 drag and drop features on Vue.js applications, I collect and list here the 4 best Vue.js drag and drop components for draggable elements.

## 1 - Draggable And Resizable Component For Vue.js
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4nxkb2aq7qz3to5u951g.png)
### Description:
A Vue.js component to create draggable and/or resizable elements in an elegant way.

### Features:
No dependencies
Touch friendly
Maintain aspect ratio
Use draggable, resizable or both
Define handles for resizing
Restrict size and movement to parent element
Snap element to custom grid
Restrict drag to vertical or horizontal axis
Provide your own markup for handles
[Demo](https://mauricius.github.io/vue-draggable-resizable/)
[Download](https://github.com/mauricius/vue-draggable-resizable/archive/master.zip)

## 2 - Smooth Draggable Sortable Component For Vue.js
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cb9g8hgupbhpg82cn8ou.png)
### Description:
A Vue.js draggable component to provide a smooth drag to sort experience on elements.

This library consists wrapper Vue.js components over [smooth-dnd](https://github.com/kutlugsahin/smooth-dnd/) library.
[Demo](https://kutlugsahin.github.io/vue-smooth-dnd/)
[Download](https://github.com/kutlugsahin/vue-smooth-dnd/archive/master.zip)

## 3 - vue-slicksort
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hxygynl5zi0wg1jjzgke.png)
Create mobile-friendly sortable lists using the Vue-slicksort component. Supports both horizontal and vertical lists. Nested lists are supported as well.
[Demo](https://jexordexan.github.io/vue-slicksort/)
[Download](https://github.com/Jexordexan/vue-slicksort)

## 4 - vue-drag-resize
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pyvmhh2s8pb7o8satfnp.gif)
A lightweight Vue Component for draggable and resizable elements.
[Demo](http://kirillmurashov.com/vue-drag-resize/)
[Download](https://www.vuescript.com/resize-and-drag-elements-in-vue-js-vue-drag-resize/)
Chainlink Flags Research Report as FUD As LINK Price Plummets
Tags: cryptocurrency
Published: 2020-07-17 13:01:28

Chainlink which recently entered the top 10 cryptocurrency list by beating BNB and LTC, is allegedly involved in ‘Pump and Dump’ technique.

The Chainlink officials flag the research report as FUD and term it as a paid dis-info campaign.

Chainlink continues to surge in the market maintaining its eighth position in the coinmarket cap listings.

Know more HERE :- https://coinpedia.org/news/chainlink-flags-chainlink-fraud-exposed-research-report-as-fud/
How I became a software engineer
Tags: career, webdev
Published: 2020-07-17 13:00:08

Hi everyone,

You might know me from a few posts as the creator of devchallenges.io. I really wanted to make youtube videos as it's challenging and I wanted to challenge myself.

Here is my first Vlog, this describes my story of coming to Finland and become a software developer and why I made devchallenges.io

Please check it out. Hopefully, some of you would enjoy it.

{% youtube bE2VqpOhiaY %}

Channel: [Thu Nghiem](https://www.youtube.com/channel/UCmSmLukBF--YrKZ2g4akYAQ)
Pricing Table HTML CSS
Tags: webdev, html, tutorial, beginners
Published: 2020-07-17 12:40:50

Creating a Pricing Table that is responsive in the latest Bootstrap 5 using their example as reference. This is a quick 10 minute video that will take you through the process of coding it from scratch, and just use some basic HTML and CSS with the latest bootstrap classes to help speed things up!

{% youtube HkT9VR_1r1A %}
<strong>[Youtube: Pricing Table HTML CSS](https://youtu.be/HkT9VR_1r1A)</strong>

* Header and Description
* Pricing Options
* Feature List
* Card Design and Shadow Effect
* Buttons
* Responsive Design

Their current website address for the v5 library is here:
https://v5.getbootstrap.com/

You can view the full example below (code included)
https://v5.getbootstrap.com/docs/5.0/examples/pricing/

## Follow and support me: 
Special thanks if you subscribe to my channel :)
* [🎞️ Youtube](https://www.youtube.com/channel/UCvM5YYWwfLwpcQgbRr68JLQ?sub_confirmation=1)
* [🐦 Twitter](https://twitter.com/adrian_twarog)
* [💬 Discord](https://discord.gg/nGdThpE)
* [❤ Patreon](https://www.patreon.com/adriantwarog)

## Want to see more:
I will try to post new great content every day. Here are the latest items:
* [Adobe XD to Fully Responsive WordPress Site](https://dev.to/adriantwarog/adobe-xd-to-fully-responsive-wordpress-site-16e0)
* [Adobe XD to HTML Full Process](https://dev.to/adriantwarog/adobe-xd-to-html-full-process-ao6)
* [Full Tutorial on how to use SASS to improve your CSS](https://dev.to/adriantwarog/full-tutorial-on-how-to-use-sass-to-improve-your-css-57on)
* [Creating a Mobile Design and Developing it](https://dev.to/adriantwarog/creating-a-mobile-design-and-developing-it-5c4o)
How to Write a Request for Proposal (RFP)?
Tags: webdev, showdev, writing
Published: 2020-07-17 12:39:11

An RFP document helps your company find suitable clients/vendors for the project, allowing you to fairly vet the strengths and weaknesses of different proposals without having to spend time and resources seeking them for yourself. The best way to create such documents is via an RFP template.

But let’s not get ahead of ourselves just yet. We will soon give you a perfect Request for Proposal template that will help you create visually stunning documents without any external help. But first, let’s learn everything there is to know about RFPs and what are the key elements you need to include in such documents. Read on…

 

##What is an RFP?
‍According to Wikipedia, A request for proposal (RFP) is a document that solicits proposals, often made through a bidding process, by an agency or company interested in procurement of a commodity, service, or valuable asset, to potential suppliers to submit business proposals.

In simple words, an RFP is a request for a proposal and is raised by organizations that are interested in third parties helping them with some part of their business. The document lays out what the organization is looking for along with the bidding process and contract terms and third parties apply accordingly.

##Follow these 11 simple steps for [writing a Request for Proposal (RFP)](https://blog.bit.ai/how-to-write-an-rfp/)
‍Here are the steps for creating a perfect and impressive Rfp:
1. Add the title of the proposal
2. Write a small description of the company
3. Include project name
4. Mention the schedule of proposal
5. Describe project overview
Give an overview of what the project entails.

6. Outline project goals
Explain the overall goals of the project.

7. Write scope of work
Spell out the deliverables that are necessary.

8. Explain how current roadblocks & barriers can be removed
Provide a list of risks associated with the project.

9. Include evaluation metrics & criteria
Provide a list of criteria the companies will be evaluated with.

10. Outline submission requirements of the proposal
Provide the requirements and deadline that needs to be met.

11. Provide contact information
Provide contact information for users to ask additional questions.


To make the process of creating your request for proposal documentation easier, we have created a ready-made RFP template for you! 
###[RFP Template](https://bit.ai/templates/rfp-template)
Introduction to Composer [installation and components]
Tags: php, composer, packagemanager, webdev
Published: 2020-07-17 12:33:04

---
title: Introduction to Composer [installation and components]
published: true
description: Install Composer in your machine and start using components

tags: php, composer, packageManager, webDevelopment
cover_image: https://anastasionico.uk/img/blog/basics-composer-install-windows-mac-linux-and-components.jpg
---

If someone asks you what was the best invention in the PHP realm during the last decade,
what would be your answer?

We have seen many updates in PHP during the last couple of years, we had the advent of PHP 7, Laravel and Symfony have reached a de-facto status, components such as PHPUnit and Xdebug are now standard for the majority of professionals, also through the use of package like Guzzle making and retrieving data from API has never been this simple.

If you have noticed all of these improvements come from the same place, and that would be my answer to the question above.

The best thing that has happened in PHP during the last decade is without any doubt Composer.

I still remember that more than a decade ago my teacher in school used to tell me that programmers are lazy people, and the lazier you are the best you can become as a programmer.

Composer is the essence of this statement.
There is no need to reinvent the weel.
Chance are that feature you need has been already developed and tested by a multitude of web developers all around the world.
Composer is a dependency manager, it provides packages containing the solution of your application problem under the shape of code.

in this new series, we'll go through all the documentation of Composer in an easy-to-read way and with lots of examples.




[CLICK HERE TO READ THE FULL ARTICLE
](https://anastasionico.uk/blog/basics-composer-install-windows-mac-linux-and-components)
Your code is garbage
Tags: career, tips, beginners, codenewbie
Published: 2020-07-19 00:51:56

---
title: Your code is garbage
description: Mine is too. So is every developer's. Don't be hurt when your code gets tossed because its job is done. I'll teach you how to turn that frown upside down.
published: true
date: 2020-07-17 12:28:00 UTC
tags: career,tips,beginners,codenewbie
canonical_url: https://raddevon.com/articles/your-code-is-garbage/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/q4u70d4sa6u1zlrxl0e1.jpg
---
Code isn’t always meant to be permanent. In fact, it rarely is. Unless you want to become outraged and feel that sting all the time as your code is taken out of service, you need to **shift the way you think about code**. Your code is kind of like a box. 📦

Watch to find out how!

{% youtube -L0hPhYB9GE %}

If you’re not careful, it will be more than just your code being tossed out. It will be your career aspirations. Transitioning is hard. You need some way to bring yourself back and refill your willpower when the going gets tough. You need a Big Goal.

Take [my free email course](https://raddevon.com/stick-with-web-development/) to help define your Big Goal **so that you don’t just quit** when it gets “too hard.”