teleren/devto huggingface dataset:
Redirect User based on condition in Laravel Fortify
Tags: laravel, fortify, php
Published: 2020-11-26 22:37:24

3aslema (means Hello in Tunisian)
Recently I had a Laravel project, where I had to redirect users based on their role, to their dashboards. 
I'm using Laravel 8, so I thought about using Laravel Fortify. 
So after installing and configure it, create a new PHP file, name it, let's say "LoginResponse" 
This class will implement the "LoginResponseContract" and it will override the "toResponse" method, and in that method we will implement the logic. 
So the class will be like this 
```
use Illuminate\Support\Facades\Auth;
use Laravel\Fortify\Contracts\LoginResponse as LoginResponseContract;

class LoginResponse implements LoginResponseContract
{
    
    /**
     * toResponse
     *
     * @param mixed $request
     * 
     * @return RedirectResponse
     */
    public function toResponse($request): RedirectResponse
    {
        if(Auth::user()->role === "Admin")
            return redirect()->route('admin');
        return redirect()->route('user');
        
    }

}

```
In this example, we will check the role of the authenticated user, if it's admin, we will redirect it the admin route, otherwise, we will redirect it the default route. 

After creating the class, all you need to do now, is to bind the newly creating class to Fortify.

All you need to do is open `FortifyServiceProvider.php`, and in the `boot` method, add this code 

```php
        $this->app->singleton(\Laravel\Fortify\Contracts\LoginResponse::class, LoginResponse::class);

```

And that's it ♥

P.S : I'm not a Laravel Expert, I'm just writing real-world examples I encounter, so Please correct me if I'm wrong.
What exactly is SEO?
Tags: bigseobazar
Published: 2020-11-26 17:31:05

SEO is short for “<a href="https://www.bigseobazar.com/">search engine optimization</a>.” To put it simply, SEO is any action is taken that is meant to better optimize or improve your website’s performance in organic search results. The end goal of SEO is usually to get a website to rank in the #1 spot on search engines like Google, or at least on the first page.

More and more businesses are selling online every day, and competition is getting harder for everyone. SEO has emerged as a way to tell search engines which websites and online stores deserve the valuable attention of shoppers and searchers. Without SEO, Google might rank stores that no one shops at in the very top spot of search results!

SEO is made up of a lot of smaller components, including keyword and keyphrase optimization, link building, content marketing, and more. It also involves some extensive research to determine what actions need to be taken on websites, and where specifically to take them. We’ll be exploring a few of these specific SEO services a little further down this page.
Running Istio in Production
Tags: microservices, servicemesh, istio, engineering
Published: 2020-11-26 22:02:35

We started using Istio for better visibility and control over our microservices that ran on K8s about 10 months ago. The journey wasn't easy, but it was totally worth the results. 

Read upon our experience from running Istio in production

https://blog.cure.fit/engineering-design/service-mesh-story/
Keeping Netflix reliable, tech leaders' views on customer experience, and the Advent of Code
Tags: performance, monitoring, performancematters
Published: 2020-11-26 22:00:53

Hi folks, 

Welcome back to Performance Matters. This time, we're proud to bring you the recording from our live [Tech Leaders event](https://raygun.com/blog/tech-leaders-panel-auckland/). With Raygun's CEO John-Daniel Trask at the helm, the conversation brought together a wealth of insights into how to prioritize the customer during design and development. 

Read on for the latest engineering article from Netflix, the t-shirt inspired by 40ms of latency, and the holiday challenge Avent of Code is almost here. 

Enjoy! 

Your Curator 


------------------------------

### FEATURED ARTICLES

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

<strong>How tech leaders are prioritizing customer experience</strong>

In today’s climate, companies are faced with many challenges. But one thing should remain the same — the focus on delivering value to the customer. Raygun's latest Tech Leaders' Panel brought this sentiment front-and-center. 


[Read the highlights and watch the full panel](https://raygun.com/blog/tech-leaders-panel-auckland/)

------------------------------

<strong>Keeping Netflix reliable</strong>


The Netflix engineering team share how they build a more resilient system with load shedding.

[Read the breakdown](https://netflixtechblog.com/keeping-netflix-reliable-using-prioritized-load-shedding-6cc827b02f94)

------------------------------

<strong>40 milliseconds of latency</strong>

Rachelbythebay recalls no matter what the team tried, 40 milliseconds of latency remained.  

[See where it was found](http://rachelbythebay.com/w/2020/10/14/lag/)

------------------------------

### BUG OF THE WEEK

<strong>Hacking Apple</strong>

A white-hat hacker team of 20-year olds spent three months hacking into Apple. They found 55 vulnerabilities, 11 of them critical, potentially earning the team half a million dollars. 

[Read the overview](https://arstechnica.com/information-technology/2020/10/white-hat-hackers-who-had-control-of-internal-apple-network-get-288000-reward/)

------------------------------

<strong>The large-scale AWS outage</strong>

At the time of writing this edition of Performance Matters, AWS is currently having an outage, taking a portion of the internet down with it. 

[View the status page](https://status.aws.amazon.com/)

------------------------------

### COMMUNITY

<strong>The Advent of Code is here</strong>

A fun and collaborative project for you and your team to get involved in is the Advent of Code challenge. A new coding challenge unlocks every day from December 1st. 

[Join in and create a leaderboard](https://dev.to/klyse/advent-of-code-2020-2c04)

------------------------------

If you think Performance Matters is pretty great, why not [sign up](https://performancematters.dev/) to receive it in your inbox every week? 🙌

------------------------------


![Made with Love by Raygun](https://dev-to-uploads.s3.amazonaws.com/i/gylnptlhm42m5jlmim8p.png)

------------------------------
PyLady na onda d@s PyBabies
Tags: python, braziliandevs
Published: 2020-11-26 21:36:13

@s [PyBabies](https://calango.club/temas/pybabies) é uma iniciativa criada para reunir pessoas com interesse em incentivar crianças e adolescentes a experimentarem o mundo científico e tecnológico. E, inicialmente, foi divulgada na 12ª Python Brasil.

Nesse sentido, resolvi criar essa postagem para descrever alguns recursos tecnológicos que encontrei e seu uso pedagógico para as crianças e adolescentes. 

## [WBO](https://wbo.ophir.dev/?lang=es)
  É uma ferramenta web de fácil para criação de imagens, similar ao programa paint. É ideal para usar com criança em processo de alfabetização, desenvolvendo a prática criativa de criação de imagem digital.

## [Etherpad](https://etherpad.aberta.org.br/)
  É uma ferramenta web de produção colaborativa de texto. Pode ser utilizado em qualquer faixa etária. Apresenta o recurso de sala de bate-papo para dinâmica síncrona de interação online. Possibilita também salvar o arquivo em diversos formatos. 

## [Scratch Jr.](https://www.scratchjr.org/)
 É uma ferramenta para programação em bloco, serve para iniciar a criança na lógica de programação. Com Scratch Jr., crianças pequenas (entre 5-7 anos) podem programar seus próprios jogos e histórias interativas. Ainda oportuniza um reforço na alfabetização na matemática.

## [Scratch](https://scratch.mit.edu/)
 É uma ferramenta web para programação em bloco, serve para criança e adolescente, sendo criada pela [MIT](https://pt.wikipedia.org/wiki/Instituto_de_Tecnologia_de_Massachusetts). Pode desenvolver jogos e animações. Ainda é possível adicionar script de algumas linguagem de programação.
universal data science template for python and jupyter (for now)
Tags: python, docker, jupyter, datascience
Published: 2020-11-26 21:29:28

Hi everyone! I'm new in this community.

I have little experience with python and data science in general but i would like to start with a strong foundation so i decided to try doing this little project.

Now if someone that want to do some algorithm in datascience, like machine learning with Tensorflow (in this case I use python language), he has to set up an environment, "classic" with Python stock, and install pip, and with pip install dependencies. But for virtual environments exist conda, that is beatiful! But has some limitation, like cross platform, and collaboration, (suppose that your friend try your code with a single library version different), and you have to choose between "conda packages" or "pip/pyenv packages"? And exists also other environment managing tools...

The project is based on VSCode, and VSCode remote container extension, that uses docker (that for windows10 use WSL2)

I would like to make this project with these main points:
Scalable, Generic (not python environment, or conda environment, or R environment), simple (simple -> scalable, just better xd), complete, cross platform, updated, and collaborative (you can share your project to everyone and everyone has your exactly enviroment)

Link to project:
https://github.com/LorenzoTinfena/data-science-vscode-remote-development-template

Now is very very basic, and the main part for now is the idea, but if someone want to take part, is welcome :)
Crear un Token ECR20 en ETH
Tags: blockchain
Published: 2020-11-26 21:24:05

Les dejo este articulo que escribí en Medium de como crear un Token ECR20 en Eth, agregarlo a Uniswap un Exchange descentralizado, crear un pool, agregarle liquidez a nuestro token y crear una billetera en MetaMask. Espero les guste

https://jperaza.medium.com/token-ecr20-d236a92f474
DevOps Engineers
Tags: hiring
Published: 2020-11-26 20:34:17

## About Us

Berkeley Square IT are a boutique recruitment agency specialising in technology recruitment

## About The Opportunity

A number of our clients (four leading public sector consultancies, a major bank and a multi-national communications company) are looking for DevOps Engineers across a number of locations and seniority levels.

Locations include: Edinburgh, Belfast, Manchester, Leeds, Birmingham, Coventry, London, Southend-on-Sea

Salaries ranging from 40k all the way up to 135k and really great progression opportunites across the board.

All completely remote until at least March, most only going back 2-3 days per week from then on.

## Skill & Qualifications

AWS or Azure
Docker, Jenkins, Ansible, Terraform, Kubernetes
Agile
CI/CD pipelines
Leadership / mentoring
Groovy / Python
Elligible for SC clearance (for 3 out of 4 of the consultancies)

## How To Apply

To apply, please email your CV to ashleigh@bsqit.com.

_Please feel free to leave questions in the comments section / email / give me a call on 0117 927 0195._
How to make text based games in C++?
Tags: cpp, opensource, oop, computerscience
Published: 2020-11-26 21:11:25

Computers can be used for different uses, we can use computers for playing games. By hearing the word game we start thinking about great animation and graphics but there is a category of games “text-based games” in which we only use text. Text-based games are fun. In this article we are going to discuss them and how to create them. I am assuming that you have some knowledge of programming. We will be using C++ for programming in this article.

 

#Ideas

Before creating the game we need ideas for the game. Idea is the first step towards the creation of the game. The game should be enjoyable and somehow unique. You can create your own story for the game just imagine and write down your story.

 

You can tell your story in two ways. First is unfolding at once and the second is unfolding it while you create.

* **All at once.** Write your story then reveal it in a linear or parallel way in your game.

* **While you create.** In this method you let your imagination flow as fire while you write your story bit by bit.

 

Choosing the method for telling the story is completely your call. In text-based games we have to make the player interact with the game. Start with the simple question or a simple sentence. Remember not to throw random sentences since it will make the player uncomfortable.

 

##Step 1 Taking Text Input

In this step we have to take the input from the player. We have to interact and take input from the user so many times in this game. So it is important to learn how to do that. For example in a game, you are asking the player for his/her name and then you will be returning the name.
```
#include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std;
 
int main()
{
    char name[50];
    cout << "What is your name, warrior?" << endl;
    cin.getline(name, 50);
    cout << "You better move fast, " << name << ". The goblins are attacking the city." << endl;
    cout << "\n----------------------Press any key to continue----------------------" << endl;
    _getch();
    return 0;
}
```

[Read more](https://www.kodlogs.com/blog/466/how-to-make-text-based-games-in-c)
Should we be Correct?
Tags: javascript, html
Published: 2020-11-26 21:11:11

Let's talk about a framework which made me question my core beliefs.

I want to love [Riot.js](https://riot.js.org/) but I have learned to follow correctness and smite those who have deviated from the holy will of specifications. Of course that last bit is totally true. 🤣 2% true.

I see Riots beautiful Vue like syntax and then I realize it spits out invalid html ‼️, to Riot.js this is a web component vs the wc3 specification, how am I supposed to feel about that?!

A framework that makes me question my values.. super, so let's get into it.

### Questions Stack Up
Years back I recall my first stack overflow question which was something like this "why can't I use deprecated or invalid html?"
You can imagine what the response was, far from constructive.

What I wanted was an answer such as "the browser will ignore your element entirely and report your webpage to the internet police"

I never got that answer, but years later I found out that the reason, the single and only reason that matters to me, accessibility, elements all have symantec meaning to help assistive technology. If you have limited sight then you can have a screen reader help you understand what is infront of you. An invalid element does not. Although not quite as important but still highlighting how browsers like known elements, a user agent stylesheet exists to define default styling... Just so we can undo it.

Now, that means that `<fish>` element has no apparent use and no meaning whatsoever, it is undefined behavior. A div and span are defined to have no meaning which is somehow the same difference if you see my point, atleast that's my theory. 

Should I feel guilty for using Riot.js ... Well I think that's putting me off starting a project 😭.

### The web component
The specification for web components has some really anoying parts and some great powers too but it's a specification none the less, Riot says no, no to hyphans which I actually agree with, it doesn't register the element with the browser... What does that mean though? why did I always register my elements? 

So this library is very controversial for me. Clearly some specifications are not created equal, so does that mean we have to live with them?

What do you think, should I chill out maybe not care and do what I like not what I am told is right, is that correctness, can a developers personal correctness actually be correct without consensus?
Recreating Famous Presidential Neckties in Pure CSS
Tags: css, codepen
Published: 2020-11-26 21:09:53

The background patterns are generated from a single CSS-property, using multiple background-image gradients to achieve the approximated woven effect.

*Nixon:*
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ccx2mibvhz8q8jfhttaf.jpg)
{% codepen https://codepen.io/mikaei/pen/bGePjEo %}

*Johnson:*
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/h2kyz89ren7nm9fj4xjf.jpeg)
{% codepen https://codepen.io/mikaei/pen/jOrjKPr %}

*Truman:*
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/e7ejicp9l9q355y8g3gv.jpg)
{% codepen https://codepen.io/mikaei/pen/vYKoBZM %}

*Ford:*
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qenl4jdc66i5w3r5v6nz.jpg)
{% codepen https://codepen.io/mikaei/pen/wvWVvjp %}
Double Free or Corruption error in C++
Tags: cpp, oop, computerscience
Published: 2020-11-26 21:08:12

C++ programming language uses the free() function to “free” the run-time allocated in the memory of the operating system. Basically, the function reallocates more memory, other functions use that memory. The parameters in free function are null or block of memory allocated, and denoted by a pointer to a memory (ptr) block previously allocated with malloc, calloc or realloc. If ptr is null, the free( ) function does nothing else; Malloc, calloc and realloc allocate a memory block. 

#Cause

**The double-free error occurs when free( ) is called over one time with the same memory.** The program memory data structures become corrupted or altered, and an intruder like a hacker can write values in the memory spaces. A program can crash or alter execution flow. 

Corruption (Fasttop) error happens when memory blocks allocated on the runtime or on the stack or workspace used to manage the heap. The error is hard to detect because the memory is valid for reading and writing unlike double free. 

The memory corruption include

* Register memory 

* user virtual memory 

##Solution
[Read more](https://www.kodlogs.com/blog/1913/double-free-or-corruption-error-in-c)
S2E8 Learn JMeter Series - CSS Selector Extractor
Tags: performance, webperf, testing, tutorial
Published: 2020-11-26 21:06:53

Welcome to Learn JMeter Series!

In this Season Two, Episode Eight, you will learn following:

🔹 CSS Selector Extractor in JMeter

{% youtube k3ld4GVepWk %}

☑ Buy me a tea 🍵 : https://www.buymeacoffee.com/qainsights
☑ [My Blog](https://qainsights.com)
☑ [My Udemy Course](https://www.udemy.com/course/performance-testing-using-truweb)
How to block someone on youtube from replying to your comments.
Tags: youtube, internet
Published: 2020-11-26 21:03:25

The user can disable replies to your Google+ posts and Youtube comments in your Google+ settings. The only tricky step is to make sure that you are updating the settings for Google+ profile or page connected to the channel that’s doing the commenting.

#Steps to follow:
This functionality can be performed by the following steps;

## 1. Sign in to youtube channel:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/l7ef4dsy0lpm8yzcgu69.jpg)
Always sign in with the channel identity that you use to post comments. You can switch channel identities by clicking your avatar in the upper right corner and selecting a different channel.

## 2. Open the page connected to channel:
Click on the avatar in the upper right corner, then click your avatar a second time. That will open your channels profile page with you are acting as a manager.

## 3. Go to settings:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0bp9o754gtgsalgxatng.jpg)
[Read more](https://www.kodlogs.com/blog/687/%C2%A0%C2%A0%C2%A0%C2%A0-how-block-someone-youtube-from-replying-your-comments)
org.codeaurora.btmultisim
Tags: computerscience
Published: 2020-11-26 20:58:10

There are so many data file managers over there. On ios, AppStore and android google play store contains tons of the data managers. Many of them are provided by the authentic sources and contains many features. But on the ark side, there are many of the managers are corrupted and sending some data of your phone or keep track of your data by using these data managers.

Many corrupted data managers use the file making tactics for keeping a track record. 

#How it works?

→ The track of the files can be done by two types. Installing additional files into the platform. OR adding files or extracting constantly for hours and hours.

‘org.codeaurora.btmultisim’ is the most data corrupters are using. It is a file transfer protocol and contains the power of the tackle each anti corrupt software. It causes the overwhelming of the files of gigabytes in the pc or phones. 

##How to stay away?
[Read more](https://www.kodlogs.com/blog/17/org-codeaurora-btmultisim)
How to get checked and unchecked checkbox array value in PHP?
Tags: php, webdev, webperf
Published: 2020-11-26 20:56:58

This process has 5 steps
**Step 1: For getting value of a checked checkbox
Code:**

```
<form action="#" method="post">
<input type="checkbox" name="gender" value="Male">Male</input>
<input type="checkbox" name="gender" value="Female">Female</input>
<input type="submit" name="submit" value="Submit"/>
</form>
<?php
if (isset($_POST['gender'])){
echo $_POST['gender']; // Displays value of checked checkbox.
}
?>
```

**Step 2: For getting values of multiple checked checkbox
Code:**

```
<form action="#" method="post">
<input type="checkbox" name="check_list[]" value="C/C++"><label>C/C++</label><br/>
<input type="checkbox" name="check_list[]" value="Java"><label>Java</label><br/>
<input type="checkbox" name="check_list[]" value="PHP"><label>PHP</label><br/>
<input type="submit" name="submit" value="Submit"/>
</form>
<?php
if(isset($_POST['submit'])){//to run PHP script on submit
if(!empty($_POST['check_list'])){
// Loop to store and display values of individual checked checkbox.
foreach($_POST['check_list'] as $selected){
echo $selected."</br>";
}
}
}
?>
```

**Step 3: php_checkbox.php (HTML code)
Code:**

```
<!DOCTYPE html>
<html>
<head>
<title>PHP: Get Values of Multiple Checked Checkboxes</title>
<link rel="stylesheet" href="css/php_checkbox.css" />
</head>
<body>
<div class="container">
<div class="main">
<h2>PHP: Get Values of Multiple Checked Checkboxes</h2>
<form action="php_checkbox.php" method="post">
<label class="heading">Select Your Technical Exposure:</label>
<input type="checkbox" name="check_list[]" value="C/C++"><label>C/C++</label>
<input type="checkbox" name="check_list[]" value="Java"><label>Java</label>
<input type="checkbox" name="check_list[]" value="PHP"><label>PHP</label>
<input type="checkbox" name="check_list[]" value="HTML/CSS"><label>HTML/CSS</label>
<input type="checkbox" name="check_list[]" value="UNIX/LINUX"><label>UNIX/LINUX</label>
<input type="submit" name="submit" Value="Submit"/>
<!----- Including PHP Script ----->
<?php include 'checkbox_value.php';?>
</form>
</div>
</div>
</body>
</html>
```

[Read more](https://www.kodlogs.com/blog/451/how-to-get-checked-and-unchecked-checkbox-array-value-in-php)
Display html form values in same page after submit using javaScript
Tags: javascript, computerscience
Published: 2020-11-26 20:51:17

#Method 1

```
<!DOCTYPE html>
<html>
  <head lang="en">
  <meta charset="UTF-8">
  <script language="JavaScript">
    function showInput() {
        document.getElementById('display').innerHTML = 
                    document.getElementById("user_input").value;
    }
  </script>

  </head>
<body>

  <form>
    <label><b>Enter a Message</b></label>
    <input type="text" name="message" id="user_input">
  </form>

  <input type="submit" onclick="showInput();"><br/>
  <label>Your input: </label>
  <p><span id='display'></span></p>
</body>
</html>
```

**Another way you can do that. Point to be noted input type is button**

`<input type="button" onclick="showMessage()" value="submit" />`

##Follow this code:

```
<!DOCTYPE html>
<html>
<head>
    <title>HTML JavaScript output on same page</title>
    <script type="text/JavaScript">
        function showMessage(){
            var message = document.getElementById("message").value;
            display_message.innerHTML= message;
        }
    </script>
</head>
<body>
<form>
Enter message: <input type="text" id = "message">
<input type="button" onclick="showMessage()" value="submit" />
</form>
<p> Message is: <span id = "display_message"></span> </p>
</body>
</html>
```

###MEthod 3
[Read more](https://www.kodlogs.com/blog/138/display-html-form-values-same-after-submit-using-javascript)