teleren/devto huggingface dataset:
The Shell
Tags: bash, linux, discuss, beginners
Published: 2020-09-09 14:02:49

Hi everyone, i am sharing some useful information of the Bash Terminal with important beginner friendly commands.

What is the shell?
Character User Interface: The Shell, is available on nearly all platforms, nearly all are roughly the same: they allow you to run programs, give them input, and inspect their output in a semi-structured way.

Here we focus on Bash Shell
Some useful commands -

```
side:~$ date
Wed 09 Sep 2020 with the current time will be displayed
```
```
side:~$ echo hello
hello
```
```
side:~$ echo $PATH
$PATH  is an environment variable that lists which directories the shell should search for programs when it is given a command
```
```
side:~$ which echo
Finds out which file is executed for a given program
```
```
side:~$ pwd
Gives the present working directory
```
```
side:~$ cd /home
Change directory to home
a path that starts with / is an absolute path.
Any other path is a relative path.
```
```
side:~$ cd ..
Changes 🔙 to the previous directory
```
```
side:~$ ls
Gives what is present inside the directory
```
```
side:~$ ls -l
This one gives us more information about each file or directory present
```
Most important to remember
```
side:~$ man ls
man command gives you the manual pages for a certain program in this case the ls command.
```
What commands would you like to add here?
Easiest way to loop the css :nth-child pseudo class by scss
Tags: css, scss, loop, stylesheet
Published: 2020-09-10 07:01:01

---
title: Easiest way to loop the css :nth-child pseudo class by scss
published: true
description: yes
tags: css,scss,loop,stylesheet
---
There are couple of way to loop the pseudo class by scss but the while loop make it more easy to understand and the process.
```
$count: 1;
@while $count < 10+1{
  .classname:nth-of-type(#{$count}){
    width: auto;
  }
    $count: $count+1
}

```
this output is:

```

.classname:nth-of-type(1) {
  width: auto;
}

.classname:nth-of-type(2) {
  width: auto;
}

.classname:nth-of-type(3) {
  width: auto;
}

.classname:nth-of-type(4) {
  width: auto;
}

.classname:nth-of-type(5) {
  width: auto;
}

.classname:nth-of-type(6) {
  width: auto;
}

.classname:nth-of-type(7) {
  width: auto;
}

.classname:nth-of-type(8) {
  width: auto;
}

.classname:nth-of-type(9) {
  width: auto;
}

.classname:nth-of-type(10) {
  width: auto;
}
```
Thanks.
Build your ML models automatically using GitHub actions
Tags: actionshackathon
Published: 2020-09-10 12:05:24

Machine Learning Model training made easy! I have made a GitHub action using the package [autofeat](https://pypi.org/project/autofeat/), that automates our classification model.
This action is an entry to the GitHub actions hackathon submission, under the ***DIY Deployment*** category.

# What does the GitHub action do? :loudspeaker:
It automates your Machine Learning model training, with the help of [autofeat](https://pypi.org/project/autofeat/) python package. This GitHub action makes use of `AutoFeatClassifier()` to build to the classification model. 

Disclaimer: For models with very low samples, they might overfit on noise in the dataset, i.e., find some new features that lead to a good prediction on the training set but result in poor performance on new test samples. 
# How to use? :information_desk_person:
You will find my "Automated ML Models using Autofeat package" action in the [marketplace](https://github.com/marketplace/actions/automated-ml-models-using-autofeat-package). 
Then follow these simple steps:
- Click on **Use latest version**, a prompt will be displayed. We need to copy the code and use it in our workflow as shown below. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/y6hks38kd4jgozaxu1w5.png)
- Make your workflow as shown below. (I have used the Iris dataset as an example)
```
name: Iris Dataset Classifier
on: [push]
jobs:
  build_model:
    runs-on: ubuntu-latest
    steps:
    - name: Train the model
      id: model
      uses: Haimantika/random@master
      with:
        myInput: "[5.1,3.5,1.4,2.1,1.8,0.2]"
    - name: Upload artifact
      uses: actions/upload-artifact@v2
      with:
        name: my-artifact
        path: model.pkl
```
- Create a repository and upload the dataset to train the model. 
  The name of the dataset file must be ***dataset.csv***
- Go to ***Actions*** on GitHub Console and click on ***Set up a workflow yourself***.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8qzxcjw354pmnkrufagg.png)
- Click on ***Start commit***, give a commit message (optional) and click on ***Commit new file***. The workflow begins soon after this.
- Click on the workflow and you’ll get the console output. You can click on ***Artifacts*** and download the model file keep it for later use.

Find the entire code **[here](https://github.com/Haimantika/random)**.

**Working demo:**  {% twitter 1304048017972969475 %}

***P.S- This is my first ever GitHub action! Let me know your views on it!*** :v:
Placeholder title
Tags: actionshackathon
Published: 2020-09-12 01:14:46

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon, please fill out all sections.)


### My Workflow
[Note]: # (Make sure to include the name of your GitHub Action and share where it's being used!)


### Submission Category: 

[Note]: # (Maintainer Must-Haves, DIY Deployments, Interesting IoT, Phone Friendly, or Wacky Wildcards)


### Yaml File or Link to Code

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository)


### Additional Resources / Info

[Note:] # (Be sure to link to any open source projects that are using your workflow!)

[Note]: # (Be sure to include the DEV usernames of your collaborators, if any. )

[Reminder]: # (Submissions are due on September 12th (11:59 PM PDT) and winners will be announced on September 23!)
Placeholder title
Tags: actionshackathon
Published: 2020-09-13 08:18:40

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon, please fill out all sections.)


### My Workflow
[Note]: # (Make sure to include the name of your GitHub Action and share where it's being used!)


### Submission Category: 

[Note]: # (Maintainer Must-Haves, DIY Deployments, Interesting IoT, Phone Friendly, or Wacky Wildcards)


### Yaml File or Link to Code

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository)


### Additional Resources / Info

[Note:] # (Be sure to link to any open source projects that are using your workflow!)

[Note]: # (Be sure to include the DEV usernames of your collaborators, if any. )

[Reminder]: # (Submissions are due on September 12th (11:59 PM PDT) and winners will be announced on September 23!)
مزیت های هاست دانلود ایران سرور
Published: 2020-09-13 09:37:58

### مزیت های هاست دانلود ایران سرور

[هاست دانلود](https://www.iranserver.com/web-hosting/download/) ایران سرور، مزیت هایی دارد که این سرویس را با دیگر سرویس ها متمایز می کند. اگر بخواهیم به مزیت های کلیدی این سرویس اشاره کنیم موارد زیر را می توانیم نام ببریم:

-   دسترسی ساده و آسان با FTP
    
-   گارانتی وجه تا ۱۴ روز
    
-   پشتیبانی حرفه ای ۲۴/۷
    
-   ترافیک ماهیانه نامحدود
    
-   پهنای باند اختصاصی برای دانلود به صورت مداوم
Simple way to set wallpaper on Linux
Tags: linux, wallpaper, hsetroot, customization
Published: 2020-09-13 22:51:33

---
title: Simple way to set wallpaper on Linux
date: 13-09-2020
canonical_url: https://glpzzz.dev/2020/09/13/hsetroot-wallpaper-linux.html
tags: linux, wallpaper, hsetroot, customization
published: true
---
I don't use any major desktop environment on Linux. Most of these takes care of managing the wallpaper of your session by some functionality in the specific file manager. So, the desktop is treated as  another directory by Nautius, Dolphin, Thunar, and others. 

This is not the way I do things. I'm more into [window managers](https://dev.to/glpzzz/about-tiling-window-managers-4ggb) that regularly don't know anything about wallpaper.

In my case, I use [hsetroot](https://github.com/himdel/hsetroot), a very small utility, that can be installed on my Ubuntu setup with:

```
sudo apt install hsetroot
```

And I just use `hsetroot` for two very specific actions

Setup a solid color as background
--------------------------------

```
hsetroot -solid "#000000"
```

Will set black as the solid color background. 

Setup an image as wallpaper covering all the screen
---------------------------------------------------

```
hsetroot -cover /path/to/image.jpg
```
Will expand and/or crop the image to fully cover the screen by respecting its aspect ratio.

Remember between sessions...
----------------------------

`hsetroot` doesn't store any settings. So, then session is restarted it will not remember the last color/image set. How to fix this? Call `hsetroot` on session start. I personally do it in my `~/.xsessionrc` and with an specific path. 

```
hsetroot -cover ~/.wallpaper.jpg
```

When I want to set a new wallpaper I replace this file, in the next session that will be the default. 

Conclusion
----------

There are more comfortable ways to change your wallpaper, specially for those who do it very frequent. But, for me, who changes it once in months (maybe), ``hsetroot`` is perfect:

* it does just one thing
* it doesn't have a GUI
* it's very simple to call in scripts.

And finally, yes, there are other utilities to do the same. `feh` and `xsetroot` for example. But, for some reason I have been using `hsetroot` for a couple of years. It just works!
Day 60: Generating a manifest file
Tags: 100daysofcode, javascript
Published: 2020-09-14 20:01:09

I made the first step to convert the webpage to a webapp. I used [favicon generator](https://realfavicongenerator.net/) to generate favicons and a manifest file.

Also created a logo with [Free logo generator](https://www.freelogodesign.org/)But it turns out that the image size was too small so I'll have to get another logo. Lastly i added both the manifest files and links to the favicon to my project.


Calling it a day
_Day 60_
Is AI Going to Replace Programmers?
Tags: machinelearning, productivity
Published: 2020-09-15 06:39:13

Any discussion about AI almost immediately becomes a discussion about machines taking away jobs from humans.
Does this mean AI will code instead of programmers? No, it won't.

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

Yes, AI is going to change software development in the next few years, but the idea is to automate common tasks that are part of the current software development workflow. This will allow developers to focus on the creative aspects of their work, instead of dealing with nitty-gritty syntactic details.
The future lies in artificial intelligence empowering software developers, not in trying to replace them.

Professor Eran Yahav, Codota's CTO
readme-md-generator
Tags: github
Published: 2020-09-15 07:07:22

I typically have a tough time coming up with good readme's. If you're in the same boat as me and haven't heard of this project, be sure to check it out (link below).


https://github.com/kefranabg/readme-md-generator#readme

***This tool is such a huge time saver***

Simply run `npx readme-me-generator` in your project's root directory, answer the questions, and the generator will handle the rest.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tjv3yrgkkq5y2x1p9ezy.png)
Custom Encoders in the Mongo Go Driver
Tags: go, mongodriver
Published: 2020-09-16 05:48:53

---
title: Custom Encoders in the Mongo Go Driver
published: true
date: 2019-12-03 00:00:00 UTC
tags: Go,Golang,MongoDriver
canonical_url: https://www.loginradius.com/engineering/blog/custom-encoders-in-the-mongo-go-driver/
---

The official supported drivers for Mongo for Go have been officially released for several months now and is slowly seeing more usage. Although many of the features of standard Mongo drivers have been implemented within the supported driver, the documentation for a majority of the…

   
[Read On](https://www.loginradius.com/engineering/blog/custom-encoders-in-the-mongo-go-driver/)
OAuth implementation with Node.js and Github
Tags: oauth, node
Published: 2020-09-16 05:46:52

---
title: OAuth implementation with Node.js and Github
published: true
date: 2020-03-22 00:00:00 UTC
tags: oAuth,NodeJS
canonical_url: https://www.loginradius.com/engineering/blog/oAuth-implemenation-using-node/
---

In this blog, we’ll be implementing OAuth by Github in a Node.js Application Before You Get Started This tutorial assumes you have: Basic knowledge of HTML/CSS Basic understanding of OAuth A good understanding of JavaScript and Node.js Latest Node.js version installed on your…

   
[Read On](https://www.loginradius.com/engineering/blog/oAuth-implemenation-using-node/)
Today. 1PM ET Live. Learn about Hermes and Making React Native fast with React Core Team Members
Tags: react, reactnative
Published: 2020-09-16 14:03:55

Today at 1PM ET on React Wednesday, we’ll chat with Ram (@nparashuram) and team from Facebook. Ram is an engineering manager on Oculus, where he works on the React Native companion app, and on the headset itself, using React VR.

As part of that work, Ram gets to play with Hermes, the JavaScript engine designed to help React Native apps start up fast. We plan on asking Ram and team important questions, like “Is working on VR as awesome as it sounds?”, and, “How can I be cool like you when I grow up?” We’ll probably ask questions about Hermes too.
The format is interview-style with show and tell.

Get a calendar invite or join the broadcast here:

https://www.telerik.com/react-wednesdays
In 2020 Start Web development with react.
Tags: react, javascript, beginners
Published: 2020-09-16 15:11:06

# Installation of react complete Guide.

If you want to Install before that you need to install node on your system. you can go to the node.js website and download the package note LTS(long term support) version for your system. after you download  node then Go to the official react website then you can create a react app using

```
npx create-react-app my-app
cd my-app
npm start
```
  
Now your project will run the desired port

#folder structure 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2h0q070zfnchw2k59k01.jpeg)

###node-Modules
It has in the topmost a node_module file which contains the node module which are installed in the app.

###public
It contains the favicon and index.html page through which app is rendering


###src
It is the main folder where we spend 90% of our time building the component and other services.

###App.js
 this is the main page of the react application. here we defined our other services

# what things you have to learn then after??
  1. react-router: which is going to make your Single page application (SPA) to many pages inside as your need.
  2. react-form: then you must need to learn the react form to implement to make any kind of form to take as input.
 
  these two are the basic library that you must learn then you go for your requirement.
If Tools Were People
Tags: ux, people, communication
Published: 2020-09-17 18:24:45

I often think about what the personalities of tools would be if they were people. For example, my air fryer gives a cheery little tune when the timer is done, like a friend inviting you to dinner. Compare this with the buzzing sound the alarm on a dryer makes. It feels harsh and repelling, like someone scolding me for not having done the laundry sooner.

So, what about our development tools? Well for many of us our communication is through text messages. Those could take the form of error messages, or completion messages when the tool is done running.

Take Rust's cargo. To me cargo feels like a nice coworker, the kind you want to pair on with challenging tasks. They might take awhile to look over all your code but when they find something that looks wrong they can point you directly to it and even give some suggestions for maybe how to fix it. Sometimes they digress into really complex topics, but they're still there to help you get the job done.

Javascript is the near exact opposite though. When working with my coworker Javascript I often would rather not be pairing. When I make a mistake in my code they often wait until I try to use it before they even bother to mention a mistake I made. Then when they finally do let me know about my mistake, it's like talking with a child. Sometimes they just blurt out **ERROR** but won't tell me why or where. If they do tell me where it's not where I made the mistake. They give me a line number in some maybe related file and say, "Good luck, I hope you can find it." before walking away.

My favorite person to work with by far is Elm. When I make mistakes around Elm, they politely tell me exactly where I went astray and off multiple suggestions for how to fix it. They just point to the actual code and say, "Pardon me, I see you wrote this but I think maybe you meant to write one of these other options." They even take into account that I might be new to all of this as well, and will give hints about how they do things a little differently and it's ok to be learning the different approach. One of my other favorite things about this coworker, they let me know right away when my code is off. They don't wait for me to try and use it and they don't have to sit and think for minutes about what I'm writing. They sit there with me through the whole process until my app is all done.

This isn't to say that everyone should be Elm. There are many tasks where I need my coworker Rust to help because Elm doesn't understand what needs to be done, and that's cool! Just like real people, we all have different skills that we excel at. I would like it though if all of our tools were a bit more kind. If they were a bit more like Rust and Elm, and a bit less like Javascript. The personalities of our tools should mirror the personalities of the real people we want to work with.
Liaison 1.0: Reuniting the Frontend and the Backend
Tags: fullstack, webdev, javascript, typescript
Published: 2020-09-18 13:00:37

Let's talk about web app development.

It used to be simple. We implemented everything in the backend with some PHP code or Ruby on Rails and then, with a bit of JavaScript running in the frontend, we were done.

But times have changed. Modern web apps require rich user interfaces that can no longer be rendered in the backend.

So, from a bit of JavaScript running in the frontend, we switched to a lot of JavaScript using a single-page application model and a bunch of libraries.

There's nothing wrong with this. It's actually quite an elegant architecture:

- The frontend is in charge of the user interface.
- The backend takes care of the data model and the business logic.

The problem, however, lies in the middle. Now that we have two rich execution environments, we need to make sure that they communicate effectively. So, we implement a web API (REST, GraphQL, etc.), and [everything gets complicated](https://dev.to/mvila/simplify-full-stack-development-with-a-unified-architecture-40kd).

Conceptually, it's like we're building two applications instead of one.

The data model gets duplicated, and the overall complexity is such that the developers become duplicated as well.

If you're a frontend or backend developer, you can only do half the job, and you waste a lot of time communicating with the person in charge of the other half.

If you're a full-stack developer, you can implement a feature from start to finish in a much more efficient and satisfying way. But, given the sophistication of the stack, there's a lot you have to deal with, and it doesn't scale very well.

Ideally, we should all be full-stack developers just like we were in the beginning. But we need to dramatically simplify the stack to make this possible.

So, how to simplify the stack?

Sure, the frontend and the backend need to be *physically* separated. But it doesn't mean that they have to be *logically* separated.

With the right abstractions in place, an application can run in two different execution environments, even as it remains a single thing from the developer's point of view.

This is precisely what Liaison offers — a reuniting of the frontend and the backend.

The data model can be shared across the stack, and there is [no need to build a web API](https://dev.to/mvila/do-we-really-need-a-web-api-5cg6) anymore.

Some might argue that mastering both the frontend and the backend is not that easy.

The frontend is not only UI rendering, but it's also state management, routing, etc.

The backend is not only data modeling and business logic, but it's also data storage, authorization, etc.

Fair enough, it's not that easy. But here, Liaison also has [a lot to offer](https://liaison.dev/docs).

So, hopefully, everyone can be a full-stack developer again.

Check out the [Liaison website](https://liaison.dev/), start building something, and [let me know](https://github.com/liaisonjs/liaison/issues) what you think.

Happy coding! 🧑‍💻
When to rewrite, when to refactor
Published: 2020-09-18 20:55:45

---
title: When to rewrite, when to refactor
published: true
description: A journal of experiences in software engineering choices that have stabbed me in the face
tags: 
//cover_image: https://direct_url_to_image.jpg
---
What I mean when I say:

Rewriting: Taking the requirements of a given system and coding them in a different language, architecture or paradigm.

Refactoring: Bending code by restructuring it to fit a new paradigm for the sake of maintainability, testability and extensability

Early in my career, every legacy system I came across seemed to be prime for rewriting. Surely all my new tools could produce a better barn than the barn we currently had. Surely it would make a barn that never needed to be refactored or rewritten. I was allowed to chase that road too many times and at too great a cost to consider the constant clamor for "Rewrite it" to be my default.

Here is why.

Lie #1: Rewriting makes integrating new features easier. You can build them in from the ground up.

Answer: If the software has not suffered organic growth, rewriting will end up in the same place as a refactor. Even if the code ends up following a different paradigm, it still has to meet the original requirements.

Lie #2: Refactoring is hard. It is hard enough to make it not worth it.

Answer: It can be, but it can also reveal if a rewrite is actually needed. It can expose systemic problems that you can't see otherwise.

Lie #3: Newer technology makes code cleaner and easier to maintain.

Answer: Javascript, C#, Java, Python, Ruby, and Go all suffer from the same problem; they are languages. They all have encumbrances that try and hide the hard parts of computers away from the poets and wizards writing code. Those encumbrances are prone to obsolescence. I wrote quite a bit of C# code for .Net 2 & 3. None of that code would run today. Windows has changed. I wrote a Javascript booking engine for a travel site in 2001. It would not even render today. I could easily take that same code, however, and update it to run in any of the latest stacks. The answer of rewriting versus refactoring can be driven home on this point. I already paid the price for those features once. Why would I pay it again?

The idea of software maintenance should expand beyond bug fixes or incremental feature adds. The roads we walk to a future state are shifting sands. We have to keep on top of that technology and build that price into our code. 

Lie #4: It is cheaper to rewrite it.

Answer: Maybe. If the stack is based on an ancient technology that cannot be modernized and the price per developer is more than the initial cost of the product, it might be cheaper. If it isn't boxed into a dead vendor or dead language, this argument becomes much more false.

In general, unless the product name is the only thing being reused, I evaluate this based on the number of functional features in the code base vs what is being asked for. If I already have the code, why would I pay for a rewrite?