teleren/devto huggingface dataset:
How to set up a PHP Console
Tags: php, console
Published: 2021-04-28 14:08:09

**Hello Dev's**

In this blog, we will learn how to set up a PHP console.
#Why we need this?
PHP is a server-side language (Backend) of web development.
In general, we don't require to take input from the console but sometimes for a small function or block of code, we require this because we don't want to disturb our whole code. It is also required to run some code that does not require a webpage (Interface) or sometimes we must require to take input from the console.
#Requirements?
1. **Server:**  Xampp or WampServer

#How to set up this?
First, we have to set up a path in our system environment variable.
**Step 1:** Goto C drive where your Xampp is installed
![step 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qgfat7toj0mfxogxg0dl.jpg)
**Step 2:** Goto **php** folder in Xampp folder
![step 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/azxcqdjr0tsa8m19ldg2.jpg)
**Step 3:** Copy the path of that folder
![Step 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p96bod3uqptsoomgpl8n.jpg)
**Step 4:** Now Goto System Properties then Advance System Settings
![step 4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cs85lgdp6m03vdeov6bf.jpg)
![step 5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/woyh69717bj0qd2n2wfn.jpg)
**Step 5:** Goto Environment Variables and follow the below steps and paste the copied path and press ok ok ok...
![step 6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4wjtyzxdnoecyzyik5k6.jpg)
![step 7](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z6pl2lop0ghi4593ipn5.jpg)
![step 8](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8t1b2mi7z274fw8iwvgh.jpg)
![step 9](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ati2eoljgxkzujju62zq.jpg)

#Now How to run the php file?

**Step 1:** open command prompt go to the directory where your code is saved ...
you can use **cd** command like  cd C:\xampp\htdocs
Now to run php code use this command -> php file_name.php  
![step 10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yl4hfmk0cjik69dz0cwm.jpg)


**Hope you will understand 😊....**
**If you have any problem you can comment below.**
**Thankyou 🙏**
Cassette tape in CSS 🎵
Tags: css, tricks, scss, html
Published: 2021-04-28 13:39:33

Good afternoon dear community Dev!
I decided to share with you my craft item - this is a audio-cassette made in CSS. 

Demonstration:
https://mrtoxas.github.io/cassette-tape-css/

Code:
https://github.com/mrtoxas/cassette-tape-css

I hope this will make you feel a pleasant nostalgic and in a good mood :)
Why should you Hire AngularJS Developers for Web App Development?
Tags: angular, javascript, html
Published: 2021-04-28 13:33:36

Why should you Hire AngularJS Developers for Web App Development?

Before, most of the companies used to have a product-centric marketing approach. However, things have changed right now. At present, the businesses are trying to go for a customer-centric approach for ensuring maximum revenues. They are going to emphasize the requirements of the purchasers and the usage of services and products. Angular JS happens to be a well-known JavaScript framework that helps create web apps at the front end. Angular JS developers will be the best solution for any company which likes to create a web application.

Below, we have mentioned the most notable reasons to Hire Angular JS developers to develop web apps and mobile application development.

 
1. Provides high-performance

When you select angular JS for developing your customer-centric business app, you are selecting a framework that will create highly-functional and feature-rich applications. Angular JS is reputed for its high-end features, which help support the development process of the application to provide top-quality performance. Some notable features of this framework happen to be its flexibility, data binding, form validation, routing, filters, and so on.

Other notable factors for which the web applications developed in this framework are producing high-performance are the ability to monitor mistakes, instant correction of the errors, and effective IDE, which provides simplicity of error for the developers. Moreover, it is possible to code faster thanks to the command-line interface, which helps create apps within a short period.

 
2. Helps to develop an interactive user interface

It becomes very simple to create a highly interactive user interface with the help of Angular JS. This system likewise helps the developers to create lightweight and user-friendly mobile apps.

Angular JS depends on HTML for defining the codes required for creating attractive interfaces out there. There is no need for the developers to put additional effort into writing codes since it is relatively simple to write codes in HTML, unlike in JS.

 
3. Code re-usability

One of the most significant reasons to hire Angular JS developers for developing your app will be code re-usability. This happens to be a boon for Angular JS developers and the owners of mobile apps. It is possible to reuse the code for some applications or be saved for later. It can be reused by the developers if required to develop any app in the upcoming days without much problem whatsoever. These happen to be the most notable advantages of code re-usability, the time for development, and the lessening of the development expenses.

The developers in the code for customizing applications according to their requirements need to make only minor changes. Reusing the codes will help them to save lots of time in the long run.

Learn more here: https://www.rlogical.com/blog/why-should-you-hire-angularjs-developers-for-web-app-development/
A stupid reason why cy.intercept() doesn't work when you reload Cypress tests
Tags: todayilearned
Published: 2021-04-28 13:13:47

When trying to intercept a search api of my website, a strange bug almost drove me crazy : the first time I ran the test, it worked, but then failed once I tried to reload the test !

{% youtube NJZ308BKs1s %}

It turned out that there was a cache on the api side, so the browser is not doing an actual request once it's cached in the disk :
![CleanShot 2021-04-28 at 15.09.54@2x](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/69q95cttoc8izvuorand.png)
 
So from now on, I know that when I want to work with intercepted api responses that are cached, I must tick the "disable cache" checkbox.
 ![CleanShot 2021-04-28 at 15.13.07@2x](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jk6vy2l2f4w9xsq7ml42.png)
Skillshare Review
Tags: lms, skillshare
Published: 2021-04-28 13:08:33

Neue Fähigkeiten zu erlernen ist eine großartige Möglichkeit, dein berufliches Netzwerk zu erweitern und dir sogar dabei zu helfen, einen neuen Job zu finden, und es gibt viele Websites, die dir dabei helfen können. Skillshare ist eine der besten Seiten für das Online-Lernen da draußen. Es funktioniert wie ein soziales Netzwerk, in dem Studenten ihre eigenen Kurse erstellen und teilen, die von den Kursen inspiriert sind, die bei Skillshare selbst unterrichtet werden.

Möchtest du mehr wissen? Lies am besten meinen [Skillshare Testbericht](https://kursprofi.com/review/skillshare/) vom Kurs-Profi.
Voices from Women in the digital industry Pt. 6
Tags: career, womenintech, leadership, interview
Published: 2021-04-28 12:55:54

*Illustration by [Marina Vishtak](https://dribbble.com/shots/15285621-Girls)*

*As part of International Women's Day, we at SinnerSchrader created an internal website that was filled with content from our employees. Among other things, we asked various women in leadership positions the same three questions. The answers were so inspiring that we didn't want to withhold them from the rest of the world. The last part of the series presents [Feli Kugland's](https://dev.to/kotzendekrabbe) (Executive Principal Engineer) answers.*

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

## What does female leadership mean to you?

Lead by example, like everyone in leadership should do, doesn’t matter which gender they have. Give your voice to those who are not being heard and challenge your male colleagues to do the same. Stepping out of your comfort zone and fighting for a change.

## Would you say that being a woman has influenced your way of leading and/or did you have to acquire (or drop) certain qualities to be successful?

When I started my career I was very quiet and shy (it’s fine if you don’t believe me). To get heard I needed to get loud, get comfortable speaking up for myself and others. Nowadays I try to be more quitish, to give others room and try to change those habits I developed over years. Speaking up for others is what I never want to change.

## What would you like to tell young women who aim to take a leadership role in the future?

Search for a Mentor and work for your success, nothing comes from nothing. Most important:

Don't let anyone tell you that you can't achieve something.
Springboot Project Structure
Tags: java, springboot, maven
Published: 2021-04-28 12:32:16

In this short article we will try to explore some of the discussions around best practices for packages

##Project by code structure
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdqdur8v3krwpmsrdpxx.png)

Above structure defined is more a classic structure followed mostly :) ... (At least on the projects that I worked on)

##Project by feature structure
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nweieyo4elur4pmx4jz4.png)
 
 
###package by feature
Follow this article which more are less explains the spring [pet clinic](https://github.com/spring-projects/spring-petclinic) project structure.
https://www.baeldung.com/spring-boot-package-structure

###package by code structure
Below is the good article I found about project by code structure, if you find anything better, please comment.
https://medium.com/the-resonant-web/spring-boot-2-0-project-structure-and-best-practices-part-2-7137bdcba7d3

which ever approach you choose from above for enterprise you would like to standardize the project structure for all the development team and provide some template classes. If you are using maven you can do this by arch-type.

###Maven Archtype

We can use maven archtype to create structure. Personally I feel it's important in enterprise to have a common structure defined for consistency and readability perspective.

Good Articles to follow for creating a maven archtype.

https://rieckpil.de/create-your-own-maven-archetype-in-5-simple-steps/

https://maven.apache.org/guides/mini/guide-creating-archetypes.html

https://medium.com/@inthiraj1994/creating-your-own-archetype-840136fc7818

https://www.javacodegeeks.com/2019/05/creating-custom-maven-archetype.html

*you can also use IntellIJ feature for storing project templates locally for future reference.
https://www.jetbrains.com/help/idea/saving-project-as-template.html*



In this article I try to summarize the package structure and how we can use maven archtype to create our package structures and templates.
My First Ruby on Rails Project
Published: 2021-04-28 12:21:45

Phew 😮💨

It has been a hell of a crazy month 🤣...yes a month. The initial two weeks to create the project plus the other two, to pass the review, but I finally did it 👏!

My third project here at Flatiron was required to build a Web App using the Ruby on Rails framework. I decided to create a parent forum website, open to current and soon to be parents in the surrounding neighborhoods of Brooklyn NY. 

This forum has the customary signup/login/logout functionality, as well as a third party login authentication using a google.  

There were many challenges with this project that ran from appropriately setting up my google omniauth, getting my delete button to work, but my biggest challenge by for was rendering the proper routes within my methods as well as within my  forms. 

# My Skeleton App Setup 

## class User < ApplicationRecord
    
    has_secure_password
    has_many :posts 
    has_many :comments, through: :posts

    validates :username, :email, presence: true, uniqueness: true 

## class Post < ApplicationRecord
    belongs_to :user
    has_many :comments 
    has_many :users, through: :comments

    validates :title, :content, presence: true

## class Comment < ApplicationRecord
    belongs_to :user
    belongs_to :post

    validates :content, presence: true 

...
# Overview
Once a user joins/signup and is logged in, they are directed to their homepage/profile, where they're able to create and then share a post.
 
Users can respond to a question or suggestion to any of the post shared, by responding with a comment. 

Only the creator of the post can edit and or delete said post.

## Conclusion 

I honestly thought that phrase 3/rails project would have been the simplest, being that the labs were very self explanatory, but after weeks of mulling over errors after errors, I was finally able to get the web functionality I wanted!. I must admit it was a very close one, but having that drive and determination to succeed in becoming a Developer...kept me going!! 
Happy Coding y'all!😁
Creating Favourites with Local Storage and useRef() in React.
Tags: react, webdev, typescript, beginners
Published: 2021-04-28 12:05:21

Hello folks!

I was working on a task the other day and thought would be great to share my experience on building favouriting that is saved on localStorage when the component isClicked.

Hope you enjoy.

###Ingredients:
- npm package ``react-use-localstorage``
- useRef
- theme-ui
- TypeScript
- full heart icon
- empty heart icon
- You can find the icons on iconmonstr -> [https://iconmonstr.com/]()

### Process

The idea is to create a ``Favourite.tsx`` re-usable component so that we can add it wherever we wanton our project.

NOTE: The npm package is replacing completely the localStorage API.

The idea is that every time I click any Person component to be added on my local storage.

### Details: 

- The id is referred to an individual props - in my case is referred to the unique id of each person of a list of many people.
- ``JSON.parse(storageItem)`` is our initialValue.
- ``setStorageItem`` is a function that basically will push the current storageItem to the [].
- I am using the JSON.stringify() method since the useLocalStorage is accepting strings.
- useRef() works perfectly since after you re-render the component it will remember the how many items you stored on your local storage.
- If is favourited(when we click the IconButton) then push that item to the storage if not then remove it.
- We are using the indexOf() since we don't know each time the item we clicked in which index position is every time, and then with the splice method we remove it.
- Now if is clicked and favourited then show the full heart otherwise the empty heart.


```js
export interface FavouriteProps {
  id: string
}

export const Favourite = ({
  id,
}: FavouriteProps): JSX.Element | null => {
  const [storageItem, setStorageItem] = useLocalStorage(
    'DFX-favourites',
    JSON.stringify([]),
  )
  const storagedArray = useRef(JSON.parse(storageItem))
  const isFavourited = storagedArray.current.includes(id)

  const handleToggleFavourite = (): void => {
    if (!isFavourited) {
      storagedArray.current.push(id)
      setStorageItem(JSON.stringify(storagedArray.current))
    } else {
     const indexFavouritedId = storagedArray.current.indexOf(id)
      storagedArray.current.splice(indexFavouritedId, 1)
      setStorageItem(JSON.stringify(storagedArray.current))
    }
  }
  return (
    <IconButton
      onClick={handleToggleFavourite}
    >
      {isFavourited ? (
        'Add here your full heart icon'
      ) : (
        'Add here your empty heart icon'
      )}
    </IconButton>
  )
}
```

The on the code you want to pass the component:

```js
<Favourite id={id} />
```
Daily Developer Jokes - Wednesday, Apr 28, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-04-28 12:00:21

---
title: "Daily Developer Jokes - Wednesday, Apr 28, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Wednesday%2C%20Apr%2028%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e125894734cf.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What diet did the ghost developer go on?

___A:___ Boolean
 -->
IT Staff Augmentation vs Offshore Development
Published: 2021-04-28 12:00:00

Here we compare two popular models that have gained momentum in the software industry — IT staff augmentation and offshore development. While these two phrases are often used interchangeably, there are some differentiating characteristics of each model.

<b>IT staff augmentation — a flexible outsourcing strategy</b>

Staff augmentation is a model where businesses evaluate their existing staff and determine the additional skills required to bring a specific project to fruition. By implementing the staff augmentation model, organizations can leverage existing resources as well as outsourced contract workers to hire the skilled IT talent they need to keep their businesses afloat. 

Staff augmentation has become increasingly popular in the IT industry because of the acute shortage of specialized tech talent. 

<b>When to use IT staff augmentation</b>

1. To increase capacity to meet a sudden demand
2. To access skills for one-off projects
3. To stay ahead of the competition 

<b>The advantages of staff augmentation </b>
- Flexibility
- Cost-effectiveness
- An opportunity to focus on the core business</list>

<b>The disadvantages of staff augmentation </b>
- Not sustainable over the long term
- Hidden costs
- Inconsistent quality

By going offshore, you no longer have to engage with external vendors to fulfill internal capacity. Instead, you can leverage the large talent pools in growing tech hubs like India and build a dedicated team of skilled developers abroad.

Both IT staff augmentation and offshore development have their own set of benefits and drawbacks.   

Know more about <a href= "https://thescalers.com/it-staff-augmentation-vs-offshore-development-the-better-model/">IT staff augmentation </a> and offshore development in detail.

Original Source of content: https://thescalers.com/it-staff-augmentation-vs-offshore-development-the-better-model/
Germany/Remote- Smartly.io - Senior Fullstack Developer (Core Platform Services)
Tags: german, javascript, node, career
Published: 2021-04-28 11:58:54

Location: Germany-wide/Berlin/Remote
Salary Expectation: Up to €80K+ OTE

About Us:
Smartly.io is a fast growing SaaS product company with over 400 Smartlies with footholds in 17 cities, serving more than 650 brands worldwide, including eBay, Uber and Zalando.

We are looking for a full-time Senior Fullstack Developer to join our team Aether. In the team you will get to build Smartly's cross-platform functionality by developing services and functionality to end-users as well as to other developer teams within Smartly. Aether is a remote working team so you can work either anywhere from Finland or from Berlin!

We are quite agnostic about technology and always aim to choose the best tools for the job. On the backend, our favoured stack is NodeJS in combination with TypeScript usually coupled with PostgreSQL and/or RabbitMQ. On the front-end side of things, React with TypeScript is the flavour du jour.

(https://www.smartly.io/careers/senior-fullstack-developer-core-platform-services-4008117004)

Key Resposibilities:
• User identity management
• Role based control (RBAC) and dynamic access control
• Designing and implementing roles for different types of users
• Single Sign On (SSO) functionality and Just-in-Time User Provisioning
• Notifications (both Email and In-App) and messaging

Requirements:
• 5+ years of relevant experience
• Experience in building web backends using any reasonable stack. We appreciate experience in the NodeJS stack, and ability to understand PHP code as that is our legacy stack that we're trying to break down into microservices, but if you have experience in another web stack we can work it out.
• Fluency with current frontend development toolchains, whether that be React, Vue or Angular.
• Drive to solve customer problems and deliver value at a fast pace.

Benefits:
• Relocation Supports
• Comprehensive salary and bonus
• Full 5 weeks of paid vacation
• Health coverage
• Wellness program
• Company-paid learning opportunities (courses, conferences, books)
• Computer (MAC or PC) + phone with plan + Bose headphones
• Offsite and team outings

If you look to step-up your career as a senior developer, a Smartly.io self-organizing team could be your next home!

Contact:
Alice Pham - Technical Sourcer @ Smartly.io
Email: alice.thungan@smartly.io
Skype: alicepham_268

• Software Engineering at Smartly.io (https://www.smartly.io/blog/how-engineers-work-at-smartlyio)
• Smartly.io DevTalks (https://www.youtube.com/watch?v=-kJhMGLLXtQ)
Where should I put this?😕
Tags: help, developers, python, programming
Published: 2021-04-28 11:53:55

# I need a small help!
Well, just now I wanted to add a new function to my python library - py-everything! But I am not sure in which module I should put it? First I thought, ok, it should go into maths. But then I thought it is not really a mathematical operation, you are checking if a number is even or not? I Will, be happy if you helped!

The function takes in a number and returns True if it is even, False otherwise.

## So, should I put it in `maths` or `__init__` - the base module?
Simulate slow responses with Cypress using cy.intercept()
Tags: todayilearned
Published: 2021-04-28 11:51:32

Today I was trying to debug a flaky test that regularly breaks our jenkins pipeline. The fault appeared to be due to a randomly slow api response.

What I usually do is that I add a delay in my server to simulate the slow response and break the test, work my way to fix it and remove the delay in the server code.

But today, I didn't have any control over the server. I had to find out another way to do that.

Turns out it's quite easy with the Cypress `intercept` command.
You can pass a `req` as an argument to intercept the request, and from there use `req.continue(response)` to change the response.

```javascript
cy.intercept(
  {
    method: 'GET',
    pathname: `_search`,
    query: {
      q: 'genera',
    },
  },
  req => {
    // do nothing with the req, only call the response with a 10s delay.
    req.continue(res => {
      res.delay = 10000;
      res.send();
    });
  },
).as('practitioner')
```