teleren/devto huggingface dataset:
Change Gnome Network 
Tags: python, webdev
Published: 2021-05-05 09:57:29

Sometimes we need to use proxy server for boring stuff (never mind!),thus in this scenario we can change the gnome's network settings just using a script or we can write bash script(i'm so lazy so Didn't wrote ). In this whole process... 


Calling the subprocess will execute terminal command.


```
import os
import subprocess

def change_network():

    change_to_manual  =  subprocess.call([ "gsettings", "set", "org.gnome.system.proxy", "mode", "'manual'"])
    change_https =       subprocess.call(["gsettings", "set", "org.gnome.system.proxy.https", "host", "'172.0.0.1'"])
    change_port =        subprocess.call(["gsettings", "set", "org.gnome.system.proxy.https", "port", "8888"])
    change_http =        subprocess.call(["gsettings", "set", "org.gnome.system.proxy.http" ,"host" ,"'172.0.0.1'"])
    change_port =        subprocess.call(["gsettings", "set", "org.gnome.system.proxy.http" ,"port" ,"8888"])


if __name__==__main__:
    change_network()
```
 Walah!!! We have changed network settings. 
☺ happy coding!
Live Frontend Designing Session
Tags: frontend, webinar, design, lowcode
Published: 2021-05-05 09:45:45

Say hello to the future of frontend design!

Join the Live Frontend Designing Session of Employee Self Service Portal.
Learn how easily can frontend developers and designers leverage the power of low-code to build a theme like Workday Control Centre in 30 minutes!

Date: 6 May 2021, Thursday
Time: 6 pm IST / 8:30am ET

Register Here: http://bit.ly/dronahq-live-build
Making a React Typescript application work on Internet Explorer 11
Tags: programming, typescript, react
Published: 2021-05-05 09:57:26

---
title: Making a React Typescript application work on Internet Explorer 11
published: true
date: 2021-05-05 09:33:17 UTC
tags: programming,typescript,react
canonical_url: https://siderite.dev/blog/making-react-typescript-application-work-on-ie11/
---

  Original post at: https://siderite.dev/blog/making-react-typescript-application-work-on-ie11/

  So you started working on a React application with Typescript and, after running _npx create-react-app someapplicationname --template typescript_ you executed _npm run start_ and Internet Explorer 11 opened up with a blank page and an unexpected colon issue in the console. Heh, that's not a pun! You click on the error and you see that somehow the rendered website is using Javascript modules which, of course, are not supported by Internet Explorer.

  Why, oh why, would the default browser be set to Internet Explorer? Because you might be working for a company that is high in paranoia and low in technical competence and the only way its house of cards security would work is using obsolete bug ridden hackable systems based on old technology. This post is not about solving corporate culture, though.

  Don't overthink it! Just follow these steps in the Visual Studio Code terminal or an admin command prompt in the folder of your application and never think about it again:

- make sure you kill the server if it is running (Ctrl-C, then Y in the terminal where you ran _npm run start_)
- run _npm i fast-text-encoding_ in the terminal
- edit index.tsx and add these lines at the very beginning: 
 
_import 'react-app-polyfill/ie11';_
_import 'react-app-polyfill/stable';_
_import 'fast-text-encoding/text';_
- edit package.json and add the value _"ie 11"_ in the _browserlist/development_ array (or you might want to replace the entire browserlist value with a simple array containing _["ie 11"]_)
- from the left side expand the node\_modules folder and delete the .cache folder (Shift-Right click to avoid deleting to Recycle bin)
- run _npm run start_ in the terminal again
- make sure that the page in Internet Explorer 11 is also completely refreshed by pressing Ctrl-F5

  Now the page should work.
List of tools for code review engineers
Tags: github, tooling, codereview, productivity
Published: 2021-05-05 09:28:40

# List of tools for code review engineers

If you perform code reviews at your company we hope that this list of tools adds value to your GitHub workflow.
We created this [list on GitHub](https://github.com/codacy/tools-for-code-review-engineers) recently and we'll periodically keep adding more tools.
Feel free to contribute your suggestions.

| Tool | Description |
| ---- | ----------- |
| [Gitpod](https://gitpod.io/) | Gitpod is an open-source Kubernetes application for automated and ready-to-code development environments that blends in your existing workflow. It enables you to describe your dev environment as code and start instant and fresh development environments for each new task directly from your browser. |
| [Pull Reminders](https://pullreminders.com/) (from Pull Panda) | Review and merge pull requests faster with Slack reminders and notifications. |
| [Pull Assigner](https://pullpanda.com/assigner) (from Pull Panda) | Pull Assigner assigns code reviews to make your process more balanced and efficient: 1) Organize reviewers into groups using GitHub Teams 2) Assign pull requests to teams or automate it with CODEOWNERS 3) Pull Assigner auto-assigns one or more members of the team as reviewers. |
| [Gitify](https://www.gitify.io/) | Gitify is all about making your life easier. Sitting on your menu bar, it informs you of any GitHub notifications without being annoying and of course without adverts. It just gets the job done. Works with GitHub and GitHub Enterprise. You can even connect multiple accounts. |
| [Quests](https://steamclock.com/quests/) | Quests is similar to Gitify but with one important difference: Quest also supports GitLab. |
| [DevHub](https://devhubapp.com/) | Create columns for the repositories and people that matter to you; Receive Desktop Push Notifications; Manage Notifications, Issues, Pull Requests & Activities; Bookmark things for later. |
| [Bolt](https://www.whitesourcesoftware.com/free-developer-tools/bolt) | Designed to close the gap between code development and security, Bolt helps GitHub developers create more secure products. It detects and alerts you of vulnerable open source components in your repository. |
| [Imgbot](https://imgbot.net/) | Imgbot is a friendly robot that optimizes your images and saves you time by leveraging the power of pull requests. |
Beginner Python Project (9) - Insta Spam Bot
Tags: python, programming, productivity, codenewbie
Published: 2021-05-05 09:28:02

Am pretty sure that all of us at some point have wanted in one way or the other to get back our friends for something they did to us, right? 
Now if that is the case how would it be to send that person lots of messages to his account, that sounds great. In this part 9 of the [Python Projects for Beginners](https://dev.to/larymak/series/12034) we will be creating a spam bot for that purpose.  
We are going to use python and pyautogui to write the code, by the way, it's only going to take 5 lines of code.  
You can also watch the video to code along:  
[![](https://yt-embed.herokuapp.com/embed?v=yb2icRAvzBE)](https://www.youtube.com/watch?v=yb2icRAvzBE "How to make Instagram Spam Bot Using python")  

You can also check the Source code [HERE](https://github.com/larymak/Python-project-Scripts/tree/main/InstaSpamBot)  

Like my work: 
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/V7R03ZL69)
Also check out my other Python Beginner Projects: 
- [Youtube Video Downloader](https://dev.to/larymak/beginner-python-project-4-youtube-video-downloader-4gpj)
- [WhatsApp SpamBot](https://dev.to/larymak/beginner-python-projects-part-1-5h1d)  


Connect With me at [Twitter](https://twitter.com/larymak1) | [Insta](https://www.instagram.com/nextgencoders/) | [YouTube](https://www.youtube.com/channel/UCrT1ARRZfLOuf6nc_97eXEg) | [LinkedIn](https://www.linkedin.com/in/hillary-nyakundi-3a64b11ab/) | [GitHub](https://github.com/larymak)
Postman: how to send api requests w/t json objects
Tags: postman
Published: 2021-05-05 08:57:29

Postman is, at this point probably, **the tool** used to run and test application endpoints. As you might imagine, especially for working on in-progress or already developed feature even, it is faster and convenient to quickly test your endpoints instead of manually running a flow and waiting to see if an endpoint returns fine.  
I needed to go back to using postman for an in-progress feature and thought it would be nice to have this article for future reference for myself and for anyone else. Especially, since this took me a few mins to properly set up.
## Installation
I'm using Ubuntu, so I just used the snap store to install:
`sudo snap install postman`
## Objectives
The request I want to test   
* is a POST request
* uses authentication
* uses a json object, to pass data  

## Usage
This section will have a few screens for clarity and so its easier, and maybe faster to skim through
1. Set your request type and fill in your endpoint url  
![Endpoint url and request setup](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k1lphq8vz05tk75ja4wa.png)
2. Since the endpoint has authentication, you can navigate to the authorization section, and select and set your corresponding authorization token/credentials. For me its a basic authentication token.
![Authentication Token](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yj1or7i258o30but5s7n.png)
3. Finally, since we have a json object, it is supposed to be passed in the body tab. I am using test data to demonstrate how to go about doing it. Since we are sending json data, I switched the input type to raw, which allows us to write raw text, and changed the type from text to json, just so postman gives us some nice highlighting
![Json Object Filling](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8h0cdmggzfc66uviwzs.png)
Once done we can save, and run the endpoint, and it will return data, or an error in case it fails.
Introducing Code Modes
Tags: vscode, showdev, productivity
Published: 2021-05-05 08:54:56

Lately, I've been finding myself showing/hiding folders/files again and again depending on what I am doing. To make this easier, I created a VSCode extension called Code Modes.

{% github SiddharthShyniben/code-modes %}


Basically, there are a bunch of modes, which you can choose. When you are in a certain mode, certain files get excluded from the file tree. 

For now, the extension is very basic (I made it in 1 day and I had the most amazing feeling when it worked bug-free) and there is no way to add custom modes, etc. 

If you have any suggestions for any modes, feel free to comment!
Different React Patterns for Enterprise Apps
Tags: webdev, react, javascript, architecture
Published: 2021-05-05 08:51:46

Are you a React Developer?

If you want to Simplify large React applications by separating your component logic, state and display properties to make React components more flexible then do explore more about different patterns & approaches you should follow:


1. Compound Components

2. Render Props

3. Provider Pattern

4. Combining Pattern

5. Component Injection
 
What is your strategy, approach and thought process in creating such enterprise React Apps?

Let me know if you want to learn more about any pattern or topic in React.
Building a game server in elixir
Tags: elixir, phoenix
Published: 2021-05-05 08:18:31

I am not an expert so take this post with a grain of salt like every other posts of mine.

https://github.com/sushant12/snake_ladder/tree/v0.2.0

Okay, now that it is out of the way let me tell u what I think a game server is first. I think that a game server is a process that keeps the state of the game and their implementation depends on the type game itself.

As a kid, I used to play snake and ladders a lot. So, I built one but with minimal rules and two players only.I am not going to go through the code one by one , what I would like to tell you is what approach I took to build it.

Since I am building a 2P game, I have to keep track of who is what. So, whoever visits the root url is "Player 1" because a random token and a `foreman=true` is appended to the url. Player 2 will have just the random token in their url.

When someone visits the root url, I am treating it as start of a new tournament which will start a new "GameServer" which is a GenServer process. The "GameServer" is a child of DynamicSupervisor which was started with "mix phx.server". The state is kept in sync between the connected players via phoenix pubsub.

I know that the game will need to have structures so that's why the "game" and "player" struct. The "game" struct would store the list of players, dice state, game token and current players turn. The "player" struct stores the player name and their position. The "game" struct has functions to help manipulate/update itself. For eg: updating the dice state when user rolls a dice.


I have used liveview to dynamically show the changes in the UI. I do need to show some animations like rolling a dice when clicked on "roll", moving the piece, etc for which I will use js hooks.

So, that's about it for now. I have couple more things that I want to implement like cleaning off zombie game servers, notifying user when a player leaves the game, etc. I guess when I finish implementing it, it will be a time for new blog.

:)
Rlogical Techsoft 
-Top Mobile App Development Company in the World 
Tags: android, ios, flutter, kotlin
Published: 2021-05-05 08:41:02

Great achievement👏 of Rlogical Techsoft Family

We proud to announce that Rlogical Techsoft Pvt. Ltd.
have listed the Top Mobile📱 App Development Company in the World on Topappfirms.co.

Check out here👉:https://topappfirms.co/developers/app-development-companies/
How to Ban/Suspend Users in Laravel 8
Tags: laravel, programming, php, tutorial
Published: 2021-05-05 08:24:06

Laravel 8 does not include the auth system by default now, You can install it By using laravel/ui package.
The common feature of ban any user from authentication is major missing in Laravel. 


Here is What the login form Will looks like after banning any user from the application.

![Login Ban](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ks00c4mfyf70ldl1lvst.png)

# Steps To Achieve the outcome

##Step 1 - Add New Column 'status' in the users table

Create a migration by running the command below

```php
  php artisan make:migration add_status_to_users_table
```
After Migration File created update the following code in the up() function.

```php
      Schema::table('users', function (Blueprint $table) {
         $table->integer('status')->default(1);
      });
```
Add 'status' in Fillable in app\Models\User.php

```php
      protected $fillable = [
        'name',
        'email',
        'password',
        'status'
    ];
```

##Step 2 - Create a Middleware - CheckBanned

Create a middleware by running the command below.

```php
      php artisan make:middleware CheckBanned
```

Replace the handle method in app/Http/CheckBanned.php

```php
    public function handle(Request $request, Closure $next)
    {
        if(auth()->check() && (auth()->user()->status == 0)){
            Auth::logout();

            $request->session()->invalidate();

            $request->session()->regenerateToken();

            return redirect()->route('login')->with('error', 'Your Account is suspended, please contact Admin.');

        }
        
        return $next($request);
    }
```

##Step 3 - Register the Middleware - app/Http/Kernel.php

IN 'web' Middleware group register the CheckBanned Middleware by putting the code below.

```php
    \App\Http\Middleware\CheckBanned::class,
```
##Step 4 - Display The Error on the log in page.

Open login blade 'resources/views/auth/login.blade.php'

Add The following code to display the error message.

```php
  @if (session('error'))
     <div class="alert alert-danger">
         {{ session('error') }}
     </div>
  @endif
```

#The Output result will look like

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

You Can Watch the video for detail explanation
{% youtube MY6BcDW8zwo %}

Thanks for reading.
Reach out to me 
[Twitter](https://twitter.com/shanisingh03)
[Instagram](http://instagram.com/shanisingh03)
Live pair programming developing ReactJS application
Tags: react, python, programming
Published: 2021-05-05 08:17:19

---
title: Live pair programming developing ReactJS application
published: true
description: Live pair programming - ReactJS, NodeJS, Python
tags: react, python, programming
//cover_image: https://logos-download.com/wp-content/uploads/2016/09/React_logo_wordmark-700x235.png
---

I have started to learn **ReactJS** while developing two applications in tandem with two people both of whom have a lot more experience in ReactJS than I do.

The first one is called [self knowledge](https://github.com/devill/selfknowledge). It is a an application for organizing online self knowledge workshops. The back-end will be probably in **NodeJS**. You can watch the first episode in this [video](https://code-maven.com/online-self-knowledge-workshop)

The second one is called [workout-app](https://github.com/rnewstead1/workout-app). It is to help manage your workouts. The back-end of this one is in **Python**. You can watch the first episode in this [video](https://code-maven.com/workout-app).
My hope is that while I learn ReactJS these videos will also provide an insight to the real-life development process in which we learn as we go. In which we make mistakes, we need to look up stuff etc.

We would welcome any comments on the projects. Suggestions for improvements. etc.

If you are interested to join one of the [live](https://code-maven.com/live) sessions, check out our schedule.

If you prefer to watch the episodes after they were recorded you can follow my [youtube channel](https://www.youtube.com/channel/UCGsgaBYSAcia5op2Umer-9g)
Merge sort
Tags: cpp, python, ruby
Published: 2021-05-05 08:11:21

In `cpp`
```cpp
#include <iostream>
using namespace std;
void ms(int *arr,int low,int mid,int high)
{
	int b[low+high];
	int i=low;
	int j=mid+1;
	int k=low;
	while(i<=mid && j<=high)
	{
		if (arr[i]<arr[j])
		{
			b[k]=arr[i];
			i++;
		}
		else
		{
			b[k]=arr[j];
			j++;
		}
		k++;
	}
	while(i<=mid)
	{	
		b[k]=arr[i];
		i++;
		k++;
	}
	while(j<=high)
	{
		b[k]=arr[j];
		j++;
		k++;
	}
	int p=low;
	while(p<k)
	{
		arr[p]=b[p];
		p++;
	}
}
void divide(int *arr,int low,int high)
{
	if(low<high)
	{
		int mid=(low+high)/2;
		divide(arr,low,mid);
		divide(arr,mid+1,high);
		ms(arr,low,mid,high);
	}
}
int main()
{
	int arr[]={5,6,8,9,1};
	divide(arr,0,5);
	for (int i = 0; i < 5; ++i)
	{
		cout<<arr[i]<<" ";
	}
	cout<<endl;
}
```
In `python`
```python
def ms(n):
    if len(n)>1:
        mid=len(n)//2
        lefthalf=n[:mid]
        righthalf=n[mid:]
        ms(lefthalf)
        ms(righthalf)
        i=j=k=0
        while i<len(lefthalf) and j<len(righthalf):
            if lefthalf[i]<righthalf[j]:
                n[k]=lefthalf[i]
                i+=1
                k+=1
            else:
                n[k]=righthalf[j]
                j+=1
                k+=1
        while i<len(lefthalf):
            n[k]=lefthalf[i]
            i+=1
            k+=1
        while j<len(righthalf):
            n[k]=righthalf[j]
            j+=1
            k+=1
    return n
a=[9,1,5,3,4,3]
print(ms(a))
```
in `ruby`
```ruby
def ms n
	if n.size>1
		mid=n.size/2
		left=n.slice(0,mid)
		right=n.slice(mid,100)
		ms left
		ms right
		i=j=k=0
		while i<left.size && j<right.size
			if left[i]<right[j]
				n[k]=left[i]
				i+=1
				k+=1
			else
				n[k]=right[j]
				j+=1
				k+=1
			end
		end
		while i<left.size
			n[k]=left[i]
			i+=1
			k+=1
		end
		while j<right.size
			n[k]=right[j]
			j+=1
			k+=1
		end
	end
	return n
end

n=[9,6,4,1,2]
print ms n
puts
```
TDD, BDD, ATDD and Agile timeline
Tags: tdd, agile, testing
Published: 2021-05-05 07:48:55

# Timeline

- 2000 [Test Driven Development: By Example](https://amzn.to/3uiVvUj) by Kent Beck
- 2001 [Agile Manifesto](https://agilemanifesto.org/history.html)
- 2002 [Scrum Alliance](https://www.scrumalliance.org/)
- 2003 [Domain-Driven Design: Tackling Complexity in the Heart of Software](https://amzn.to/33eq29Y) by Eric Evans, BDD and JBehave by Daniel North
- 2003 [FitNesse](https://github.com/unclebob/fitnesse/)
- 2004 BDD getting traction among the community
- 2005 RSpec by Dave, Aslak
- 2006 [Introducing BDD](http://dannorth.net/introducing-bdd/) by Daniel North
- 2008 [Cucumber](https://cucumber.io/) by Aslak
- 2010 [Growing Object-Oriented Software, Guided by Tests](https://amzn.to/2SegZTZ)
- 2010 [The RSpec Book](https://amzn.to/3efUS8a)
- 2011 [The training wheels came off](https://aslakhellesoy.com/post/11055981222/the-training-wheels-came-off) by Aslak
- 2012 [Page Object pattern](https://martinfowler.com/bliki/PageObject.html)
- 2013 [Screenplay pattern](https://www.slideshare.net/RiverGlide/a-journey-beyond-the-page-object-pattern)
- 2014 [TDD is dead. Long live testing.](https://dhh.dk/2014/tdd-is-dead-long-live-testing.html) by DHH
- 2018 [gauge](https://www.thoughtworks.com/news/gauge-test-automation) by ThoughtWorks

# Background and Motivation

I'm not so crucial about BDD, nor a ritual practitioner of it. Even so I occasionally come up with an idea that BDD must be suited to the issues I encountered sometimes.

This time I wish to be a little more thoughtful. I've collected the important events in BDD and Agile field, and sorted them chronologically so I can grasp a brief history and trend of TDD, BDD and ATDD.

Any information and advice would be appreciated, especially events since 2014 which seem missing in this list.

# Sources 

- [History of BDD](https://cucumber.io/docs/bdd/history/)
- [Test Driven Development:By Example](https://amzn.to/3uiVvUj) and [its Japanese translation](https://www.amazon.co.jp/dp/4274217884/ref=cm_sw_r_cp_awdb_imm_T4K57RQDWVDKEVFT23MQ)
- [Clean Agile](https://www.amazon.co.jp/dp/0135781868/ref=cm_sw_r_cp_awdb_imm_SM7Y3PXXN2W9S2342NP1)
- [Why I recommend against using Cucumber](https://www.codewithjason.com/recommend-against-cucumber/)
Vue3.0 & Vue2.0 
Published: 2021-05-05 07:37:18

Vue 3:
```javacript
in vue2 the syntic si right:
@keyup.enter.native="dataFormSubmit()
vue 回车触发聚焦 @keyup.enter.native
12:84  error  '.native' modifier on 'v-on' directive is deprecated  vue/no-deprecated-v-on-native-modifier

```
ref link: https://eslint.vuejs.org/rules/no-deprecated-v-on-native-modifier.html
```html
<template>
  <!-- ✓ GOOD -->
  <CoolInput v-on:keydown.enter="onKeydownEnter" />
  <CoolInput @keydown.enter="onKeydownEnter" />

  <!-- ✗ BAD -->
  <CoolInput v-on:keydown.native="onKeydown" />
  <CoolInput @keydown.enter.native="onKeydownEnter" />
</template>
```
Python 3.10 Preview Release New Features
Tags: python, new, release
Published: 2021-05-05 07:18:33

The preview release of Python 3.10 was released on May 2, 2021.  But this is not a Stable release. Because the specialty here is the addition of a lot of new features. With the release of Python 3.10 stable release, there is no doubt that users will get a new experience. [Read More] (https://ilabacademy.blogspot.com/2021/05/python-310-preview-release-new-features.html)
What's your biggest struggle with Regular Expressions?
Tags: programming, productivity, discuss, codenewbie
Published: 2021-05-05 07:07:37

There seems to be a shared struggle when it comes to Regular Expressions. Some suffer readability, some think it's completely useless, others find it difficult to learn. What do you think? What are struggles you face with Regular Expressions? 

For those with no problems with it, what would you give as advice? What helped you grasp them?