teleren/devto huggingface dataset:
Why I want to become a software engineer.
Published: 2021-02-04 06:57:27

Throughout my life, I was always someone who loved everything. I never understood my place in life and what I wanted to do as a career not just that but something I liked. I went from being a personal trainer to studying real estate, and never really understood my why in all of this. One day as I was scrolling through Tik Tok I've seen a couple of videos about software engineering and how in reality it’s not as hard as everyone makes it seem! sure it’stough but not impossible. One day I ran into this one girl talking about how fun it was and not just that the pay was awesome! I know what you're thinking "pay isn't everything" and while that might be true it was just a bonus.
As a kid, I loved playing video games! and I always loved the idea of how websites worked even made a couple on WIX and Shopify and that alone was already fun I could only imagine actual live coding and creating something on your own... but back to my story, the girl on tik tok talked about the school she went to and it was flat iron! so that's when the thought-about making the decision began. I thought about my why if I was going to make this commitment, and how fun and interesting it was going to be and it all came to me.
I’m passionate about it, I want to do this not only for myself but to invest in myself to have a more comfortable, stable, and fun life! Not only that but you're independent as a coder and as a mid introvert, I loved the idea! I believe this will catapult me into my next opportunities and help me be the person I need to be. I would never take back the choice I made in deciding to pursue this career.
How to restore (recreated) a deleted remote git branch
Tags: git, github, restore, gitlab
Published: 2021-02-04 06:29:13

I ran into this when I was cleaning up my local git. I deleted both a local and its remote branch on origin! 🤦‍♂ And the branch I deleted is still in a Merge (Pull) Request! 💀 I used a third party app called *SourceTree* (I’m sure you heard of it) to delete them, so my commit is not in the `reflog`

What I did to restore the local branch is as follow:

- Since my commit is not in the `reflog`, I had to do this to print out and ultimately find my commit’s `sha`

  `git fsck --full --no-reflogs --unreachable --lost-found | grep commit | cut -d\ -f3 | xargs -n 1 git log -n 1 --pretty=oneline > .git/lost-found.txt`

- I could open this file with my editor to find the `sha` by my commit message (I was glad I remembered some key words in it) and made sure if the changes are what I did:

  `git log -p <sha>`

- Finally, I recreated the deleted branch by doing:

  `git branch hotfix-whatever-branch <sha>`

All I did to do after this is to push the branch and voila, the branch was restored successfully!

What I learned from this syntax:

`git fsck --full --no-reflogs --unreachable --lost-found | grep commit | cut -d\ -f3 | xargs -n 1 git log -n 1 --pretty=oneline > .git/lost-found.txt`

>--git fsck: file system check. It verifies the connectivity and validity of the objects in the database

>-no-reflogs Do not consider commits that are referenced only by an entry in a reflog to be reachable.  This option is meant only to search for commits that used to be in a ref, but now aren’t, but are still in that corresponding reflog

>--unreachable: Print out objects that exist but that aren’t reachable from any of the reference nodes.

>--full Check not just objects in GIT_OBJECT_DIRECTORY ($GIT_DIR/objects), but also the ones found in alternate object pools listed in GIT_ALTERNATE_OBJECT_DIRECTORIES or $GIT_DIR/objects/info/alternates, and in packed Git archives found in $GIT_DIR/objects/pack and corresponding pack subdirectories in alternate object pools.  This is now default; you can turn it off with --no-full.

>--lost-found Write dangling objects into .git/lost-found/commit/ or .git/lost-found/other/, depending on type.  If the object is a blob, the contents are written into the file, rather than its object name.

You can see the full documentations here:
https://git-scm.com/docs/git-fsck

The rest of the pipeline is to pick the info we need, format it and send it to a file.

The Linux cut command https://www.geeksforgeeks.org/cut-command-linux-examples/
ES6 dynamic key (name) for object & object property assignment
Tags: react, javascript, es6, todayilearned
Published: 2021-02-04 06:21:31

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3qjnq9nr9yjvzx0pwdvq.jpg)
_Hands up! Or I will dynamically access your property._

------

Recently, I’ve picked up Javascript again at my day job writing software using ReactJS and Elixir. It had been a while I hadn’t code javascript professionally since AngularJS 1. Since 2014, there are so many new changes to the JS libraries and communities! I need to catch up.

Today I learned the new way in ES6 to use a dynamic key to access or assign an object property.

ES6 enables developers to create or access an object by dynamic keys or names:

```js
const key1 = "make";
const key2 = "model;
const newObj = {
  year: 2020,
  [key1]: "toyota"
  [key2]: "prius"
}
```

You can think of many ways you can apply this to your coding scenario. How about the case where you might need to create an object with an increasing number in the key names?

```js
const name = "com";
let i = 1;

const radioDevice = {
  numberOfComs: 3,
  [name + "_" + i++]: "port 4556",
  [name + "_" + i++]: "socket 12",
  [name + "_" + i++]: "socket 15",
};

radioDevice.com_1; 
// => port 4556
```

Or, when you want to replace an item in an array with a dynamic index 😉

```js
let array = [
  {name: "Minh", age: 20},
  {name: "Brian", age: 22},
  {name: "Hugo", age: 12},
  {name: "Zelda", age: 56},
  {name: "Simon", age: 7}
];

const nameToFind = "Hugo";
const personToReplace = {name: "Ali", age: 34};

const index = array.findIndex(item => item.name === nameToFind);
Object.assign([], array, { [index]: personToReplace });
//=> [
// {name: "Minh", age: 20}
// {name: "Brian", age: 22}
// {name: "Ali", age: 34} <---------
// {name: "Zelda", age: 56}
// {name: "Simon", age: 7}
//];
```

ES6's Object.assign function is used to copy the values of all of the enumerable own properties from one or more source objects to a target object

Read more about it here: https://www.ecma-international.org/ecma-262/6.0/#sec-object.assign
How to Build a Super Simple HTTP proxy in Python in just 17 lines of code?
Published: 2021-02-04 05:58:56

It's super easy to build a rudimentary proxy server with Python. The trick lies in using the right modules.

Today we will use the SocketServer and the SimpleHTTPServer modules to listen for incoming requests and the URL lib module to fetch the target web pages.

Let's initialize and set the port.
then we inherit the SimpleHTTPRequestHandler to create our own proxy. The do_GET is called for all get requests.
the url will have a slash (/) in the beginning from the browsers so we need to remove it using
Browsers need the headers to report a successful fetch with the HTTP status code of 200 so we send those headers.
The last line uses the urllib library to fetch the URL and write it back to the browser using the copy file function.


to run this we use the ForkingTCPServer mode and pass it to our class to handle the interrupts.
We put the whole thing together in 17 lines.
Save the file as simpleServer.py and run.


And call it from the browser like so.


Or using cURL which is probably more appropriate as a programmer trying to scrape just HTML because we haven't built-in support for getting subsequent images, CSS, and JS files which the browser will call for.
You get:
This is great as a learning exercise but it is easy to see that even the proxy server itself is prone to get blocked as it uses a single IP. In this scenario where you may want a proxy that handles thousands of fetches every day using a professional rotating proxy service to rotate IPs is almost a must.

Otherwise, you tend to get IP blocked a lot by automatic location, usage, and bot detection algorithms.

Our rotating proxy server Proxies API provides a simple API that can solve all IP Blocking problems instantly.

With millions of high speed rotating proxies located all over the world,

With our automatic IP rotation

With our automatic User-Agent-String rotation (which simulates requests from different, valid web browsers and web browser versions)

With our automatic CAPTCHA solving technology,

Hundreds of our customers have successfully solved the headache of IP blocks with a simple API.

The whole thing can be accessed by a simple API like below in any programming language.


In fact, you don't even have to take the pain of loading Puppeteer as we render Javascript behind the scenes and you can just get the data and parse it any language like Node, Puppeteer or PHP or using any framework like Scrapy or Nutch. In all these cases you can just call the URL with render support like so.
Clarification of Typescript and JavaScript with respect to the mathematical term Set
Tags: javascript, webdev, beginners, typescript
Published: 2021-02-04 05:54:21

Hello Js Community,

Today we will be going theoretical and mathematical. It's quite unfortunate of how the downgrading/explanation of JavaScript has become since the release of Typescript due to the misinterpretation of the major keyword in Typescript definition "SUPERSET".

    Table of Content

    1. Mathematical Set
    2. Mathematical SuperSet
    3. Mathematical SubSet
    4. Javascript as a SubSet
    5. Typescript as a SuperSet

Before I proceed, I will love to remind you that the mastermind behind computer science is mathematics and will always remain mathematics, so it's good to go mathematical when you fall into confusion in computer science.


###1.Mathematical Set 
In mathematics,a Set is a single collection of a distinct element,it can be string, numbers, flowers etc 😊. 

In JavaScript Programming, a Set is an object of distinct keys, and mind you the distinct keys can have the same value as their sibling key.

---

###2.Mathematical SuperSet
In mathematics,we say A is a SuperSet of B when all B elements are present in A set.

In JavaScript Programming (lets key the class aside), we say object A is a SuperObject of object B when Object A has a complete extension of object B properties either by spreading, using the Object constructor which makes the object unenumerable(like Object.property or Object.properties, or Object.create), or & symbol.

---

###3.Mathematical SubSet
In mathematics,we say B is a SubSet of A when all B elements exist in A set but A primary element doesn't exist in B Set. On the other hand, B makes up the existence of A but B exists without A.

In JavaScript Programming, we say Object B is SubObject of Object A when all the properties of Object B exist in Object A but the primary properties of A don't exist in Object B. Meaning Object B enables the existence of Object A.

---

###4.JavaScript as a Subset of Typescript
I will like to conclude that from the mathematical representation, JavaScript enabled the existence of Typescript which we both know and that's why everything javascript gets transpile to javascript and shipped as javascript except interface which has no representation in Javascript(the interface is a good example of SuperSet primary element not being present in Subset)

---

###5.Typescript as a Superset of Javascript
I will like to draw a simple conclusion from the mathematical standard, that there can be no SuperSet without SubSet as such there can be no reason why Typescript exists if not for Javascript.

---
So in a nutshell, Typescript and Javascript is a mathematical representation of SuperSet and SubSet. So I hope from now you start looking at this two Combinatorics as turn-around for Js community and not the other way round, if you are coming from a primarily-typed-language like me i am certain you know what I am talking ☕️😀🍻

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/f1m2jh3ml0wi9oa99we9.png)
Node.js, Accept arguments from the command line
Published: 2021-02-04 05:15:21

When invoking a Node.js application on the terminal you can pass any number of arguments and arguments can be standalone or have a key and a value.

For example, let consider the below command
```
node app.js jose
```

What happens in a nutshell node.js expose an **argv** property, which is an array that contains all the command line invocation arguments.

The first element is the full path of the **node** command, the second element is the full path of the file being executed and all the additional arguments are present from the third position going forward, to check this out see the snippet below.

```javascript
process.argv.forEach((val, index) => {
   console.log(`${index}:${val}`);
});
```

You can get only the additional arguments by creating a new array that excludes the first 2 params:

```javascript
const args = process.argv.slice(2);
```

This said consider the below snippet

```javascript
const args = process.argv.slice(2);
console.log(args);
```
We can execute this program now

```
node app.js jose
```

Here is the result

```
jose
```

Now that we know how to accept arguments from the command line, let us built a simple calculator on top of this knowledge

```javascript
const args = process.argv.slice(2);
let result = 0;

if(args.length === 0){
	console.log('Pass two numbers to add');
	process.exit(1);
}
if(args.length <= 1){
	console.log('We need two numbers to add them');
	process.exit(1);
} 

args.forEach((value) => {
	result += parseInt(value);
});

console.log(`The sum of ${args[0]} with ${args[1]} is ${result}.`);
```

Running the app

```
node app.js 2 3
```

The result
```
The sum of 2 with 3 is 5.
```

I hope that you enjoy it, stay awesome!
Administrative Access Commands On Linux
Tags: linux, ubuntu, programming, cybersecurity
Published: 2021-02-04 04:53:23

We have multiple commands which deal with sensitive information like passwords, system hardware on Linux. By preventing regular users from executing these commands helps to protect the system. In order to gain administrative access and gain some of the privileged commands you have to be logged in as a root user.  
### List of Commands  
- The `SU` Command   
 syntax:`su OPTIONS USERNAME`   
 
The `su` command allows you to temporarily act as a different user.  
By default, if a user account is not specified, the `su` command will open a new shell as the root user, which provides administrative privileges.  
After executing the `su` command a password is required.  
As a security measure, the password will not be visible as it is typed, so you have have to type it correctly.  
```
admin@localhost:~$ su  -
Password:
root@localhost:~#
```   
As you can see the has changed and reflected to `root@localhost` switching from `admin@localhost:`. This means you are now logged in as a root user.  
To logout and return to admin account use `exit` command, It will change back
```
root@localhost:~# exit
logout
admin@localhost:~$
```   
To avoid executing any sensitive commands, we configure the Steam Locomotive command, the `sl` command, to require administrative access. If the command is executed as admin in this case, it fails:
```
admin@localhost:~$ sl
-bash: /usr/bin/sl: Permission denied
```   
To execute the `sl` command with administrative access use the `su` to switch to the root account
```
admin@localhost:~$ su  -
Password:
root@localhost:~# sl
``` 

- The `Sudo` Command  
syntax: `sudo [options] command`  
The `sudo` command allows a user to execute a command as another user without creating a new shell.  
Like the `su` command, the `sudo` command assumes by default the root user account should be used to execute commands.  

> NOTE: The `sudo` command can be used to switch to other user accounts as well. To specify a different user account use the `-u` option.   
 
`sudo` provides administrative access for the execution of the specified command. This is an advantage as it reduces the risk that a user accidentally executes a command as root.  

If You have read this far I really appreciate 🙏, Help me to grow my community:  
Check Out My Blogs [Here](https://larymak.hashnode.dev/) where we talk more on TECH

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)  
Do share your valuable opinion, I appreciate your honest feedback!
TIL how Tuesday JS packs Zip files
Tags: todayilearned, gamedev, tuesdayjs, html
Published: 2021-02-04 04:42:42

2021-02-03

A friend linked me to a JS visual novel engine called [Tuesday JS](https://kirilllive.github.io/tuesday-js/) and it's kinda blown me away, a little. So the actual engine itself is interesting as it contains many features you'd want in a visual novel such as dialog choices and localization. And it relies on no other libraries so I guess it's what you cool kids call *vanilla* JS. But what really got me curious was the visual editor.
![Tuesday JS visual editor with scene and dialog ui elements](https://dev-to-uploads.s3.amazonaws.com/i/rdeyrvp4kf28e4ryqira.png)
It's a single HTML file. Your story/game data is stored as JSON which the editor can create or load. This data is represented on screen with UI elements that you can use to further manipulate the game data. Once you're done, you can export it.
![Tuesday JS Visual Editor with export dialog](https://dev-to-uploads.s3.amazonaws.com/i/p2vtv4m11suv4yr5e12r.png)
Wait a second, a zip file? How's this possible, I asked myself. It's a FOSS project so I took a peek and within the editor code, [JSZip](https://stuk.github.io/jszip/) is embedded. Its API is super simple and is used in the function called `build_zip` to pack the project files into a zip file.
All this is fascinating to me because web-based game tools have a lot of potential. Games such as [CrossCode](http://cross-code.com/en/home) are built off web tech but when I played it on Xbox, I experienced a snappy action game which I won't have known was built off ImpactJS.
JSX in React – Explained with Examples
Tags: javascript, react, codenewbie
Published: 2021-02-04 04:36:29

JSX is one of the core concepts of React. So if you understand it well, you'll be able to write better React code.

In this article, you will learn:

* What is JSX in React and how to use it
* How JSX is transformed to React.createElement
* What is a JSX expression and what we can write inside it
* Common issues in JSX

And much more.

Check out my recently published article explaining JSX in React in detail below.

[<img src="https://gist.github.com/myogeshchavan97/aa75611665802aadfd3ba6bfeb0fe59b/raw/2aadbef8b50f208d0b5e5ba4f36d88fc9e2786d1/jsx.png">](https://www.freecodecamp.org/news/jsx-in-react-introduction/)

----

Also, check out my free [Introduction to React Router](https://yogeshchavan.podia.com/react-router-introduction) course.

**Subscribe to my [weekly newsletter](https://yogeshchavan.dev/) to join 1000+ other subscribers to get amazing tips, tricks, articles and discount deals directly in your inbox.**

[<img src="https://cdn.buymeacoffee.com/buttons/default-yellow.png" >](https://www.buymeacoffee.com/myogeshchavan97)
Rails to Laravel Cheet Sheet
Published: 2021-02-04 02:58:35

Hi Everyone!

I come from Ruby on Rails background, and now learning Laravel. I've been looking for a way to get familiar with Laravel asap, so I just start writing this wiki, https://github.com/PirunSeng/wiki/blob/master/rails-to-laravel-cheet-sheet.md, and would be appreciated if you could share your experiences with us, too.

I hope to input more contents as the way I learn forward.

Happy coding :)
Difference between display:none and visibility:hidden
Tags: 100daysofcode, css
Published: 2021-02-04 04:13:39

The display property helps us to specify the display behavior of an element.

###Difference between `display:none` and `visibility:hidden`

We can hide elements using both properties but there is  a difference between them.

Let's say we have three balls in red, green and blue color. 

{% codepen https://codepen.io/umameera/pen/YzpyOgx %}

### Css code
If I set display:none for the green ball.
```
#green {
  background-color:green;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: none;
}
```
{% codepen https://codepen.io/umameera/pen/bGBVmdO %}

Now, our green ball is removed, but it still exists on HTML structure and `display:none` property makes it look like deleted. The blue ball moved up and took the green ball place.

### Let's see what happen when we set `visibility:hidden` for the same green ball.

```
#green {
  background-color:green;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  visibility: hidden;
}
```

{% codepen https://codepen.io/umameera/pen/poNjxyz %}

`visbility:hidden` property does not remove the green ball, makes it <em>invisible</em>
The value of pair programming • solving problems, making fixes
Tags: github, opensource, codenewbie, unity3d
Published: 2021-02-04 04:02:20

I recently learned the value of pair programming on one of [my live streams](https://www.twitch.tv/videos/900068261). I'm very much one of those people who learns by doing, and learns with others around me. I did well in a classroom setting and I loved having "study parties" at uni.

When I heard about the concept of pair programming, it really interested me. It was at a conference a year or so ago; The idea of sitting down with someone and learning together. It's such a great idea and learning style I find valuable. Why I didn't do it sooner is probably due to COVID-19, and partly due to the fact I forgot! :facepalm: Until one of my recent live streams.

I've been streaming a pair bit and I love people dropping into my streams to help out. Pointing out spelling errors, syntax problems, and giving tips on how to make my code better.

{% link https://dev.to/mishmanners/this-is-real-excitement-this-is-why-we-are-developers-right-learning-ruby-programming-for-the-first-time-9kb %}

It wasn't until this week when I was really stuck that one of my regulars said "get me on Discord now". I was like "oh yeah, that's a thing, let's do it." In minutes we had everything figured out and fixed. It's so much easier chatting through an issue than over delayed live stream texting!

I learned by doing, and I learned by being randomly thrown into a tricky situation. If you haven't tried out pair programming do it today.

## Pair programming at it's finest

Pair programming is really fun, but what if you don't have someone to do it with? What if you don't even know what it's all about? Well, myself and one of my colleagues [Bdougie](https://github.com/bdougie) can show you show it's done. Join us this Friday (Thursday for everyone in PT zone), for our [Open Source Friday stream special](https://www.meetup.com/GitHub-Virtual-Meetup/events/276019546/). We'll be talking through how to create a chatbot to integrate with Twitch and GitHub.
How do I turn Windows 10 Reputation-Based Protection OFF?
Tags: windows, microsoft, help, watercooler
Published: 2021-02-04 03:59:43

I accidentally turned on RBP without realizing what it does fully, and while I'd usually like a feature like this, it's "negative-helpful" for me, especially if I'm using obscure programs, or ones that have no reputation.

But after enabling it, it doesn't give me the option to turn it off.
![Windows Security application not allowing the disabling of Reputation-Based Protection.](https://dev-to-uploads.s3.amazonaws.com/i/jn3krer258qbhpxxonu2.png)
Day31:100DaysOfCode
Tags: 100daysofcode, programming, productivity, java
Published: 2021-02-04 03:46:41

leetcode ques on trees(bst) and easy string..

studied synchronized volatile and threads(join) under multithreading in spring boot

also learnt how to connect mysqldb to spring boot ...

tried some past ques of contest at codechef.
EOD



You can Follow me->
https://github.com/singhtaran1005
https://www.linkedin.com/in/taranpreet-singh-chabbra-27517918a/