teleren/devto huggingface dataset:
★ Easily switch PHP versions in Laravel Valet
Tags: laravel, php
Published: 2020-01-02 23:05:31

---
title: ★ Easily switch PHP versions in Laravel Valet
published: true
date: 2018-10-22 19:17:20 UTC
tags: laravel, php
canonical_url: https://freek.dev/1185-easily-switch-php-versions-in-laravel-valet
---

Besides enjoying some greenfield work, we often have to work on legacy projects at [Spatie](https://spatie.be) too. Sometimes those projects don't run on the latest PHP version. I this blogpost I'd like to show you a way to switch PHP version easily when using [Laravel Valet](https://laravel.com/docs/5.7/valet). (I know you could also use Docker or Virtualbox to solve this problem, but that's out of scope for this blogpost.)

I'm going to assume that you already use the latest versions of [homebrew](https://brew.sh/), Laravel Valet and have PHP 7.2 installed. In order to easily switch PHP versions you first should install the older versions of PHP.

Run these commands in your terminal

```
brew install php@7.0
brew install php@7.1
```

Next were are going to define a bash function and some aliases to easily switch the current PHP version. If you don't know how to create a bash function and where to put this code, read [this blogpost](https://medium.com/devnetwork/how-to-create-your-own-custom-terminal-commands-c5008782a78e) first.

```
phpv() {
    valet stop
    brew unlink php@7.0 php@7.1 php@7.2
    brew link --force --overwrite $1
    brew services start $1
    composer global update
	rm -f ~/.config/valet/valet.sock
    valet install
}

alias php70="phpv php@7.0"
alias php71="phpv php@7.1"
alias php72="phpv php"
```

With this out of the way, you can easily switch to PHP 7.0 by executing `php70` in your terminal. You can switch back to 7.2 by performing `php72`. The first time you switch to a particular PHP version might take a while. Subsequent switches will go much faster.

Credits for this `phpv` function go to my colleagues [Seb](https://twitter.com/sebdedeyne) and [Willem](https://twitter.com/willemvbockstal). They created it based on [this excellent blogpost on how to use multiple PHP versions in Mojave](https://getgrav.org/blog/macos-mojave-apache-multiple-php-versions).
Yet another motivation to write an article on dev.to ...
Tags: justthoughts, devto
Published: 2018-10-22 19:10:15

---
title: Yet another motivation to write an article on dev.to  ...
published: true
description: in one sentence
tags: #justthoughts #devto
---

Yet another motivation to write an article on dev.to. You can copy the text back to your GH documentation. It is already in markdown, it has no grammar errors and it is about your project (:
Welcome Thread - v19
Tags: welcome
Published: 2018-10-22 18:35:38

---
title: Welcome Thread - v19
published: true
description: Introduce yourself to the community!
tags: welcome
---

Hey there! Welcome to dev.to!

![Homer Simpson comes out of the hedge smiling](https://media.giphy.com/media/12FLhMHdanoLJK/giphy-downsized.gif)

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment and say hello or ask them a question. 👋

3. Or answer this question: What are you learning about right now?
Is there some kind of Machine learning roadmap?
Tags: machinelearning, ai, discuss
Published: 2018-10-22 17:40:34

---
title: Is there some kind of Machine learning roadmap?
published: true
description: 
######cover_image: https://thepracticaldev.s3.amazonaws.com/i/wjpyxgftw6bdz2ytfphl.jpg
tags: Machinelearning, ai, discuss
---

There's a [wonderful roadmap](https://github.com/kamranahmedse/developer-roadmap) for web developers, and I wonder if there something like it for ML specialists.
cover image [source](https://www.redbull.com/au-en/iconic-australian-road-trips)
🌧️ devSwag #6 — #Swagtoberfest is in Full Swing
Tags: programming, beginners, opensource, hacktoberfest
Published: 2018-10-22 17:35:05

---
title: 🌧️ devSwag #6 — #Swagtoberfest is in Full Swing
published: true
description: 😎👕🧦 Keep yourself updated with the latest swag opportunities for developers!
tags: programming,beginners,opensource,hacktoberfest
canonical_url: https://medium.com/swag-for-dev/%EF%B8%8F-devswag-6-swagtoberfest-is-in-full-swing-14dcf738a76e
cover_image: https://thepracticaldev.s3.amazonaws.com/i/soe7nmokjk3fnnv9d9xr.png
---
### Swag is in the Air

We just crossed [3000 stars on GitHub](https://github.com/swapagarwal/swag-for-dev/) and have been [Featured on Changelog Weekly](http://email.changelog.com/t/t-675F8F9C3E9A6D8E2540EF23F30FEDED). Thank you everyone for your kind support! 🙏

It’s raining swag!
Here are SIX new swag opportunities:

#### [Auth0](https://auth0.com/blog/celebrate-hacktoberfest-with-auth0/)
Have one accepted pull request in a qualifying Auth0 Github project in October 2018 and receive a kickass 2018 Hacktoberfest t-shirt courtesy of the awesome Auth0 team, along with a psychedelic Auth0 sticker pack!

#### [OpenEBS](https://blog.openebs.io/celebrate-hacktoberfest-2018-with-openebs-206daa1d653c/)
Have one accepted pull request in an OpenEBS repository during October 2018 to earn an OpenEBS t-shirt and stickers. The best PR will also receive a laptop.

#### [Twilio](https://www.youtube.com/watch?v=r9MPBJjPQdA)
Complete the first set of objectives in [Twilio Quest](https://twilio.com/quest) and get a Twilio Quest t-shirt right to your door.

#### [SendGrid](https://sendgrid.com/blog/hacktoberfest-2018-has-arrived/)
Five accepted pull results from SendGrid will qualify you for a special edition SendGrid Hacktoberfest T-shirt.

#### [Hasura](https://blog.hasura.io/announcing-hacktoberfest-2018-with-hasura-621045dc9560)
Submit a PR to Hasura’s [GraphQL Engine repo](https://github.com/hasura/graphql-engine) in October 2018 and get a Hasura sticker pack. If your PR to an issue tagged as ‘hacktoberfest’ gets merged, you also get a Hasura t-shirt!

#### [Nexmo](https://www.nexmo.com/blog/2018/10/09/join-nextoberfest-tis-the-season-to-be-hacking-dr/)
Make one pull request in October 2018 to any [Nexmo Repository](https://github.com/nexmo/), earn a limited edition #nextoberfest T-shirt!

You can keep tabs on all of the #hacktoberfest swag opportunities at our new dedicated URL: [devswag.io/hacktoberfest](http://devswag.io/hacktoberfest)
You can also filter items based on tags (like accessories, clothing, device, stickers, etc.)!

To get these updates in your inbox, subscribe to our newsletter: https://upscri.be/67d2fa

You can find the complete list on GitHub: https://github.com/swapagarwal/swag-for-dev
Getting prepared for an interview in top-tier IT company: books, links & tips.
Tags: career, advice
Published: 2018-10-22 17:10:55

---
title: Getting prepared for an interview in top-tier IT company: books, links & tips.
published: true
description: 
tags: career, advice
---

A few days ago I had a chance to have a chat with one of the top-tier HR experts. And that guy shared with me a bunch of tips and materials that might be useful to those who are seeking for a job in top-tier IT companies.

* Prepare for a long hiring process. It can take more than 6 interviews. HRs, managers and other developers will dig deep into your skills and your psychology.  

* You will be writing actual code during the interview. Make sure you are familiar with the latest specs and syntax features of your favorite language.  Make sure you remember all the classical patterns.
https://www.hackerrank.com/ may help you with that.

* You will be solving algorithmic puzzles and some of them might be really tricky.  Take some practice on that. 

    * https://projecteuler.net/index.php?section=problems — kinda ol' school website full of the classical computer since problems.
    * http://algorist.com/algorist.html this page contains detailed information on classical algos and data structures. This stuff never gets old.
    * Take a look at 'Algorithms and Programming: Problems and Solutions' by  Alexander Shen 

* The behavioral interview. You will be asked to describe a specific event or situation, not a generalized description of what you have done in the past. Sounds a bit tricky, so here comes a more detailed description of behavioral interviews. https://careerservices.wayne.edu/behavioralinterviewinfo.pdf

Walk carefully thru all these materials and make sure that you are able to take all kinds of questions. 

Don't freak out, be prepared, eat well,  sleep well, be calm and focused. Show them the best of you can do.
The 7 Most Popular DEV Posts from the Past Week
Tags: top7, bestofdev
Published: 2018-10-22 16:58:46

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi, bestofdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---

#1. Who would you like to work with? 

Ali shares 11 non-technical skills and traits that she values in good co-workers. It's not always about your technical chops!

{% link https://dev.to/aspittel/the-most-important-non-programming-skills-for-programmers-iii %}


#2. Oops, something went wrong!

A few ways to make your logs a bit more visually informative, and interesting. Ever heard of `console.table()`?

{% link https://dev.to/wangonya/better-consolelogs-448c %}

#3. I choose you!

A quick overview on the serverless framework and a tutorial that involves building a RESTful API w/ pokemon 👌

{% link https://dev.to/sagar/build-a-restful-api-with-the-serverless-framework-ene %}

#4. How to Brainstorm ⚡️

Have you ever thought to 'blog more' but then decide you didn't know what to write about? 🙋‍♀️ <-- that's me. 

This post breaks down the brainstorming process, from identifying topics to applying common design patterns to said topic. 


{% link https://dev.to/gsto/choose-your-next-article-topic-with-this-exercise-17m2 %}

#5. CTE > Subquery

How common table expressions work and why you might want to use them instead of subqueries. 

{% link https://dev.to/helenanders26/why-you-should-use-sql-ctes-25lk %}

#6. Don't use it just cause it works!

How `sudo pip install` can lead to malicious code and what you can do for a better and more secure installation. 

{% link https://dev.to/elabftw/stop-using-sudo-pip-install-52mn %}

#7. Guide line lackings

How PEP8, the style guide for Python, could be improved. 

{% link https://dev.to/edelvalle/python-beyond-pep8-16g6 %}

_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
Dev Community Talk
Tags: dev, community, talk
Published: 2018-10-22 16:46:52

---
title: Dev Community Talk
published: true
description: Dev community group
tags: #dev #community #talk
---

What about being in touch with each other on slack or something and be the biggest dev community out there?
- Supporting each other with their queries
- Sharing job posting from all over the world
- Work on our open source project
- Learn something together

If you are interested, lets discuss this here in a new slack group I just created..
Invitation link:
https://join.slack.com/t/dev-community-talk/shared_invite/enQtNDYxNDY4NDAxNzk2LTNkMTMxMmQyMmI4NmU5MzdkMWEzMWMxNjM4MTEzZjcwYjA4OTBmNTJjYTRlNDJjN2ZmY2ZmYzZkNmRmYzZjMWM

Waiting for you, guys!
Need Help, building off-line & file based airtable
Tags: javascript, electron, react, mysql
Published: 2018-10-22 16:39:36

---
title: Need Help, building off-line & file based airtable
published: true
description: 
tags: javascript,electron,reactjs,react,mysql
---
Web apps like notion,coda,airtable bring new dynamics to spreadsheet database, but most of them are backed up with back-end database,primarily online first and only allow for import and export, for local copy.

What is the best direction to building similar product but limited scope(ie small feature) and most importantly off-line first using file based storage as database, like excel, since am a programmer interact with file storage using sql like abstraction but allow for large dataset.

Basically off-line excel using web technology(react + electron ) but without bundling a database for the app to work, and off-line 90% of the time, thus using file as storage, but program interact with file using a sql abstraction. in future add express server for collaboration.

thanks for the help, this is for insurance company i work at, in Africa, so off-line is crucial.
Having The Right Growth Mindset
Tags: mindset, motivation, node, mochatesting
Published: 2018-10-22 16:35:41

---
title: Having The Right Growth Mindset
published: true
description: Having The Right Growth Mindset
tags: Mindset, Motivation, NodeJs, Mocha Testing
---

Having the right Mindset in life is one of the more important things an individual can have to succeed and be outstanding.

I recently came across a challenge, requiring me to develop a simple application that utilizes the RESTful API architecture to return details about products in a store, then it should respond to tests, i.e. continuous integration tool: travis-ci and code coverage tool: coveralls which I call auxiliary coding tools.

I’ve never come across such a task previously and so I decided to take-on the challenge. Firstly, I did a little research on Google, searching for articles written by those with experience in writing similar applications and I found about 2 results which were easy to comprehend and easy to setup, after about 30 minutes of searching.

I ensured to look into what they did, step-by-step to see if I could figure out what information they had put down, assimilate & articulate, then understand.
Afterwards I came up with a plan to tackle the challenge at hand, modelling my solution after the ones I saw online especially with the aspect of using the auxiliary coding tools to ensure my application is free of bugs and additional code added won’t break the whole chain of code written previously.

Having the right growth mindset involves having humility, making oneself teachable and possessing an infinite desire to never stop learning. Having a positive mentally also helps.

Also remember to put your trust in God.
Creating Bounding box for different code generated shapes
Tags: help, gamedev, javascript, aabbcollision
Published: 2018-10-22 16:15:48

---
title: Creating Bounding box for different code generated shapes
published: true
tags: help, gamedev, javascript, aabb collision
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wwuoq6vq3oalu67fqnte.jpg
description: How to create an aabb bounding box for shapes made with Bezier curves
---

Hello word,
I've been learning html5 game development for a few months and now I'm creating a _breakout game_ in **vanilla JS** without any plugins for physics. And I'm also using assets generated through code. I'm doing this to learn basic game physics and to prove to myself that I can develop a game without 3rd party plugins or framework.

I'm using axis aligned bounding box (AABB) for collision detection. It was easy to implement it for the bricks, the paddle and the ball. Next, I wanted to add powerups. I thought about using shapes other than rectangles and circles for power drops like _stars_ or _clouds_ for powerups and _hearts_ for extra lives. I managed to find the code to draw these shapes but, I can't figure out how to create a bounding box for these odd shapes. 


I need guidance for programmatically creating bounding boxes for different shapes generated via code. I hope I'm clear with my question 🙂🤞🏽.
React Native Route Configuration Example Using React Navigation Library
Tags: react, reactnative, android, javascript
Published: 2018-10-22 15:45:31

---
title: React Native Route Configuration Example Using React Navigation Library
published: true
description: React Native Route Configuration Example Using React Navigation Library
tags: #react #reactnative #android #javascript
---

Post Link : <a href="https://www.skptricks.com/2018/10/react-native-route-configuration-using-react-navigation.html" > React Native Route Configuration Example Using React Navigation Library<a/>

In this tutorial, we are providing the simple example to setup initial route configuration using react navigation library in react native application. As you already know React Navigation provides this for you, along with the iOS and Android gestures and animations to transition between screens. Routing configuration setup part is very easy and simple, we will provide simple guide to setup route using createStackNavigator function. 

<a href="https://www.skptricks.com/2018/10/react-native-route-configuration-using-react-navigation.html" > React Native Route Configuration Example Using React Navigation Library<a/>

<img src="https://3.bp.blogspot.com/-o3xXi78ez0E/W83rdCA2mSI/AAAAAAAACDs/e_-RkPzbGegNrP_8LmidsN_9SXix_-CiwCLcBGAs/s640/rr.png" />
Getting Started With React 360 and Elixir
Tags: react360, elixir, tutorial
Published: 2018-10-22 15:23:33

---
title: Getting Started With React 360 and Elixir
published: true
description: We will be using Elixir, a little phoenix ( little ), and React 360.
tags: React 360, Elixir, Tutorial
---

#### Great walkthrough explaining how to configure and use React 360, phoenix, and Elixir.

[Getting Started with React 360 and Elixir](https://www.smoothterminal.com/articles/getting-started-with-react-360-and-elixir)
Jest testing with a hernia
Tags: jest, firebase, webpack, npm
Published: 2018-10-22 15:19:13

---
title: Jest testing with a hernia
published: true
description: 
tags: Jest, Firebase, Webpack, NPM
---

Josh and Brian cover the basics of adding tests to a small app that was put together quickly as an experiment.

{% youtube asnKfTTuRgM %}
Should I learn Web Frameworks as a Beginner?
Tags: frameworks
Published: 2018-10-22 15:05:16

---
title: Should I learn Web Frameworks as a Beginner?
published: true
description: 
tags: frameworks
---

I have been doing front end web development on and off as a hobby for a few years now. I don't have any fully published works for public view, mostly due to self-doubt and thinking my code is 'ugly'.

Recently I have been more involved in front end coding and am starting to really love it more and more. My biggest issue is that there are so many resources out there that use frameworks and packages that do much of the heavy lifting for you. This sounds great but I feel it doesn't teach me very well, I want to know why the code works not just make it works.

My question is should I as someone who is still considered a beginner learn more about frameworks or is it better to focus on vanilla code?
SSI Platforms
Tags: ssi
Published: 2018-10-26 12:52:35

---
title: SSI Platforms
published: true
tags: SSI
canonical_url: https://perfectial.com/blog/self-sovereign-identity-platforms/
---

The regulatory environment is becoming ever more stringent for companies who collect and process clients’ personal data. The fines for non-compliance with the modern data protection laws ([such as the GDPR](/blog/secure-outsourcing-how-to-protect-your-data-and-achieve-gdpr-compliance/)) are extensive, and the reputational damages for mishandling personal records seem irreversible. There’s also the general public’s growing distrust of corporations and government bodies caused by frequent reports of their inability to protect databases from [hacking and data breaches](/blog/secure-outsourcing-how-to-protect-your-data-and-achieve-gdpr-compliance/).

The “traditional” digital identity management model is fundamentally flawed.

[Self-sovereign identity (SSI)](https://perfectial.com/blog/self-sovereign-identity-platforms/), according to many, can resolve these issues. The core principle behind SSI systems is putting end-users in complete control of their identity data and allowing ordinary people to sign digitally and verify claims/transactions without third-party involvement. 


![Principles of self-sovereign identity systems](http://perfectial.com/wp-content/uploads/2018/10/Principles-of-self-sovereign-identity-systems.jpg)

## Principles of self-sovereign identity systems

1. An individual is the only authority
2. The identity must be transportable and interoperable
3. Transactions with minimum exposure
4. SSI must focus on users, not service providers
5. The administrative procedures used by identity networks must be open-source and transparent
6. Users must be able to maintain persistent identifiers
7. A right to be forgotten should be maintained


## Conclusion

It’s possible to disagree defiantly to collaborate with governments and ignore completely all of their requirements. We can still build an SSI platform on a blockchain that no regulating body will be able to shut down. However, such approach might turn out very short-sided; the governments can restrict the individuals using such platforms from paying taxes with it, or renting a car, etc., and the users will have to create separate identities, involving centralized authorities, to complete such transactions. This is at polar odds with what the SSI movement is trying to achieve.


The post [How Self-Sovereign Identity Platforms Help Businesses and Clients Assert Their Digital IDs](https://perfectial.com/blog/self-sovereign-identity-platforms/) appeared first on [Software Development Company Perfectial](https://perfectial.com).
Tracking down the painful bugs
Tags: opensource, tools, vscode
Published: 2018-10-20 22:06:41

A few months ago I was helping a co-worker fix a bug in the [XML language server](https://github.com/angelozerr/lsp4xml) that had to do with the hover feature. The bug wasn't throwing exceptions, attempts to debug it yielded no results that were easily found and for some reason, the language server just kept crashing. It wasn't really clear at all what was happening and the code just sort of died. Since this bug was seemingly undetectable we spent a really long time (probably more then we should have) doing a brute force comment out of sections that we thought might have been causing the issue.

What's sad/funny is what was actually going on. For those of you who don't know, language servers connect to a client (such as VSCode) and VSCode sends requests to the server based on a user event. For example, if you hover over an element it sends a request to the server and the server sends a response back. The language server protocol dictates what should be sent/returned for a request/response. The bug was extremely simple and rather funny, but painful to debug. Basically what was happening was there was 
```java
System.out.println("test");
```
inside of the part of the server that controls what happens when you hover over an element. Since VSCode was seeing that we were trying to hover, it would send a hover request to the server. The server would then react but when it hit 
```java
System.out.println("test");
```
it was sending back "test" to the client, resulting in the language server crashing.

Let me know your worst bug experience in the comments!