teleren/devto huggingface dataset:
Git and GitHub Basics for Beginners
Tags: git, github, beginners
Published: 2021-11-27 20:06:20

Hello everyone!!

I am Jimmy Taravia and I am a learning web or precisely learning software developer and a writing enthusiast who notices things and points them out to people in my Blogs (Jimmy’s Blog: https://get-rid-of-bullshit.blogspot.com/ ). In this post, I will be explaining some basic Git terminologies and facts for software development learning beginners, which are useful if you entering into the development field or want to contribute to any open-source projects on Github.

The first and most basic question, that arises among all is why Git and Github even matters? What is the difference between those two? So let me explain Git first and would explain Github afterward. 

Git is a distributed version control system or also can be called a decentralized version control system. It means that many developers can work on a single project. So it keeps track of your code history and changes that you and others make in it. 

Basic Command to learn for starting Git and Github are:

**1. git init:** It initializes the git repository.
**2. git add:**  It adds file(s) to the index.
**3. git status:**  It helps us to know the status of our working tree in the pulling and pushing code changes in remote as well as a local repository.
**3. git commit:**  It means to commit the changes in the index.
**4. git push:**  It pushes the changes done from local files at the index to the remote repository.
**5. git pull:**  It pulls the latest files from the remote repository to local.

Now, moving to the Git installation process:
You can download it in windows and mac through the below given websites:

Windows: https://git-scm.com/downloads/win 
Mac:  https://git-scm.com/downloads/mac  

For Linux: 
You can use the given commands:
Linux (Debian): $ sudo apt-get install git
Linux (Fedora): $ sudo yum install git

Once you finish installing Git on your device, 
**1)** Go to your command line and write the command git –version and hit enter. 
**2)** If you get the version of the git, you have installed the git successfully. But if in case you get some error, there is nothing to worry about, try to uninstall the available git that you installed and do the step again.  

Now, coming to Github. It is the largest web-based git repository hosting service. You can relate git and Github as the cloud servers and web-service. For example, the servers stores the data available on the internet, and the web service connects us or act as a bridge between us and the information which we want from the servers which contains a huge amount of data.  

So, these are common terminologies and facts about Git and Github, which we use in making projects.

There are so many other commands which I will try to discuss and explain in an upcoming part of the series.
Auditing markdown file
Tags: opensource, osd600
Published: 2021-11-19 02:56:33

### IPC144 course notes

For a long time, students at Seneca College have been using the class notes for course IPC144 at [this website](https://ict.senecacollege.ca/~ipc144/pages/content/index.html). For better maintenance, we are moving the notes into a new platform using Docusaurus. Docusaurus will convert the notes into markdown files to be hosted. The auto-conversion, however, has some limitations and we also want to have some customizations. Therefore, the students are joining hands to audit all the markdown files generated by Docusaurus.

### The process of auditing 
The page I decided to work on is [A Simple Calculation](https://cghub.ca/B-Computations/a-simple-calculation). To start the work, I followed the basic workflow: fork and clone the repo, run the page locally, go through the checklist mentioned in the [meta issue](https://github.com/Seneca-ICTOER/IPC144/issues/18) and was able to resolve some issues:
- fixed typo mistakes
- removed unnecessary markdown syntaxes: removing **bold** when the text is already wrapped in `inline code`
- added backticks for anything related to code
- added alt tags for photos to improve accessibility
```c
![numeric-constants](/img/image22.png)
```
- used admonitions for notes and additional information
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yijbxm20u3ms411zrzct.jpg)
- updated Frontmatter to include more tags:
```
id: a-simple-calculation
title: A Simple Calculation
sidebar_position: 2
slug: /B-Computations/a-simple-calculation
description:  Create a computer program to solve a basic programming task
```

### Receiving reviews
The great thing of working with open source is that we can get reviews from other developers. After sending the pull request, I got some suggestions from other students, mainly for some minor parts that need backticks but I didn't notice. I was also suggested to update the slug in Frontmatter to match with the standardized format.

Fixing a problem by one self is never enough. It is very helpful to have other people also looking at the same issue so we can get suggestions from multiple perspectives, which can give us an even better solution.

To know the detailed solution, read more in the [issue](https://github.com/Seneca-ICTOER/IPC144/issues/38) and [pull request](https://github.com/Seneca-ICTOER/IPC144/pull/74).
SOLID Principles
Tags: design, oop, javascript
Published: 2021-11-27 19:42:04

SOLID is one of the most popular sets of design principles in object-oriented software development. The goal of the SOLID principles is to reduce dependencies so that engineers change one area of software without impacting others. These principles outline best practices for designing software while keeping in mind the project's long-term maintenance and expansion. Adopting these techniques can also help avoid code smells, restructure your code, and design Agile or adaptive software.

SOLID stands for:
• S - Single-Responsibility Principle
• O - Open-Closed Principle
• L - Liskov Substitution Principle
• I - Interface Segregation Principle
• D - Dependency Inversion Principle

**Single-Responsibility Principle:** A class should have only one cause to change, which means it should only have one task.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8dp5gil1u2cl8p5yzgz5.PNG)*Here I have created different classes(Addition, Subtraction, Multiplication, Division) which have one job to do.*

**Open-Closed Principle:** Objects or entities should be open for extension but closed for modification.

**Liskov Substitution Principle:** Let q(x) be a property provable about objects of x of type T. Then q(y) should be provable for objects y of type S where S is a subtype of T. 
*This means that every subclass or derived class should be substitutable for their base or parent class.*

**Interface Segregation Principle:** A client should never be forced to implement an interface that it doesn’t use, or clients shouldn’t be forced to depend on methods they do not use.

**Dependency Inversion Principle:** Entities must depend on abstractions, not on concretions. It states that the high-level module must not depend on the low-level module, but they should depend on abstractions.
Start With React.js
Published: 2021-11-27 19:17:22

- 1.Install Node.js
- 2.Type in terminal
```terminal
$ npm install -g create-react-app
```
And boom it's installed
# To create a new React app
Type in terminal
```
$ npx create-react-app (app name)
```
go to [React.js](https://reactjs.org) to find more tutorial
node js event loop
Tags: help
Published: 2021-11-27 18:43:42

I am on nodejs event loop article and section is es6 job queue, I am facing difficulty to understand this section please help me understanding these lines ECMAScript 2015 introduced the concept of the Job Queue, which is used by Promises (also introduced in ES6/ES2015). It's a way to execute the result of an async function as soon as possible, rather than being put at the end of the call stack. I don't understand these lines particularly the last line rather than being put at the end of the call stack, I am confused why they used word call stack instead of message queue.
Article link is: https://nodejs.dev/learn/the-nodejs-event-loop
English to Malayalam Typing
Tags: typescript
Published: 2021-11-27 18:13:50

Hello Folks! I bet you're here to convert your English to Malayalam typing that's why we have created an amazing tool just for you. Here, you don't have to learn any other language but you can translate your English text into more than 20 languages with just a single click.

On this page, I'm going to lead you to convert your English text to the Malayalam language in an exact fluent way you'd use while talking to someone in person.

How to use this English to Malayalam text Converter

It's an easy process to convert your text, all you have to do is follow some really easy steps and your work will be done in an instant.

Go to the below available typing area and start writing your paragraphs.
Make sure that you've added a space bar after every word you write. Example - I'm [Space] here [Space] for [Space] fun. [Space] (I'm here for fun.)
You don't have to do anything other than this. Mobdro
The tool will automatically detect the sentence and covert it for you.
You can also add symbols to your text from the additional text formatting options available above to the text area.

Type in the Malayalam Language

With this tool you don't have to type in Malayalam anymore, you can translate your native English to the Malayalam language and copy it to your clipboard. This will help you in communicating with locals or understanding their expressions.
Once you're done converting your text from the tool, you can simply click on the Copy to Clipboard option to copy the text.

Later, you can paste it anywhere you want.

If you stuck don't know how to erase the board, look forward to the below buttons in the text area. There will be a push button to Reset all the written texts to serve you a fresh text area for new lines.

Also Read: <a href="https://typing.one/english-to-malayalam-typing/">English to Malayalam typing</a>
<a href="https://tutubox-vip.com/">Tutubox</a>
<a href="https://cinemahd.uno/">Cinema HD</a>
Conclusions

So, this was all about how you can convert your English to Malayalam typing without spending any extra minute on learning or rushing for paid tools. If you still have any query or question in your mind, drop down it into the comments section and we will surely assist you as soon as we can. Till then, peace out, and keep enjoying the tool. And, don't forget to share it with your friends who are in need of this sort of tool.
🚰 Docker connection reset during builds
Tags: docker, networking
Published: 2021-11-27 17:31:16

---
title:🚰 Docker connection reset during builds
published: true
description: Ever run into connection problems during docker builds? Here is how to fix them.
tags: docker, networking
cover_image: https://images.unsplash.com/photo-1586363044134-999daa59bfb7?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=752&q=80
---

Recently while trying to deploy a test docker container on my homelab's docker instance, I kept running into an error similar to this one

```
Caused by: java.net.SocketException: Connection reset
 at java.net.SocketInputStream.read(SocketInputStream.java:210)
 at java.net.SocketInputStream.read(SocketInputStream.java:141)
 at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
```

After a bunch of digging, I ran into this medium article; https://medium.com/swlh/fix-a-random-network-connection-reset-issue-in-docker-kubernetes-5c57a11de170

It summarized it's findings pretty well and walked through the whole discovery process. Something I appreciate.

Ultimately for it, it boiled down to running these commands to backup, flush, and reset iptables
```
# Keep a backup of the current rules incase we have to go back
iptables-save > /root/firewall.rules

# Flush all the current rules
iptables -F
iptables -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

# Confirm the rules are now empty
iptables -L
```

Then I had to restart docker with `service docker restart` for docker to reset it's own iptable rules. But from then on, no more connection reset issues.

In the event you need to roll back, you can use 
```
iptables-resoter < /root/firewall.rules
```

Now get back to building something awesome!
What was your win this week?
Tags: discuss, weeklyretro
Published: 2021-11-27 17:24:37

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

Hey there! 


Looking back on this past week, what was something you were proud of accomplishing?

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Enjoying time with family or friends... or whatever else might spark joy ❤️ 

---

Congrats on your accomplishments this week! 

![Dancing flower](https://media.giphy.com/media/3oz8xAFtqoOUUrsh7W/giphy.gif)
Setup Lua/LuaJIT/LuaRocks in GitHub Actions workflow without any hassle 🌛
Tags: actionshackathon21, lua, luajit, luarocks
Published: 2021-11-27 17:17:43

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon 2021, please fill out all sections.)


### My Workflow
[Note]: # (Please make sure the project links to the appropriate GitHub Actions repository, and includes [an open source license](https://choosealicense.com/) and README.)

Recently I've been dabbling with [Lua](https://www.lua.org), mostly tinkering with my [Neovim](https://github.com/neovim/neovim) configuration and building some plugins for it. But I've been thinking about doing some other projects using Lua too. So I built this tool called _**Luver**_ for removing the some obstacles I faced going that way.

And it occured to me that it would be a pretty handly tool to use with GitHub Actions workflow.

**GitHub Action**: [Setup Lua with Luver](https://github.com/marketplace/actions/setup-lua-with-luver)

**How would it help you?**

- 🌜 You can easily install specific versions of Lua/LuaJIT/LuaRocks for your CI workflow.

- 🚀 You have install multiple versions of Lua side-by-side and switch between them in your CI workflow. So you can run tests for your Lua library against multiple version of Lua!

### Submission Category: 

[Note]: # (Maintainer Must-Haves, DIY Deployments, Interesting IoT, Phone Friendly, or Wacky Wildcards)

Maintainer Must-Haves

### 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)

{% github MunifTanjim/luver-action %}

### Additional Resources / Info

If you work on Lua projects often, you can also use _**Luver**_ on your development machine, it is comparable to `nvm`, `pyenv`, `rbenv` etc. If you think a tool like that would help you, check out: [MunifTanjim/luver](https://github.com/MunifTanjim/luver)

[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 December 8th, 2021 (11:59 PM PT or 2 AM ET/6 AM UTC on December 9th.)
Introduction to React ⚛️
Published: 2021-11-27 16:42:46

What is React.js?

React… let’s say you are browsing the internet and the content on a page requires some changes according to your inputs, time, or any other factor.. JavaScript seems to be inefficient and complex for handling those changes, hence a library to “react” to those factors and update the content of a page is called React.js ⚛️.

React is component based, meaning it can be used to build simple reusable components of the UI (example: a button) and use it everywhere in your app.
React is state based, implying the app’s state is handled and accordingly the render takes place, this helps to write better and predictable code.
To phrase it properly, React is a free and open-source front-end JavaScript library for building user interfaces or UI components.


History (A small flashback) 📜:-

In 2013, Facebook struggled while handling Facebook Ads and was looking for a way to make small components that build up to make bigger and multifunctional apps. Hence, some basic prototype versions of react were made such as Xhp, and FaxJS. Soon after acquiring Instagram, Facebook built the first stable version of React and deployed it in 2014 as a small part of its User Interface while also open-sourcing it. Many had hopes but were skeptical with thoughts that were along the lines of “HTML in JavaScript? Why?”

But what is App? App is just a function. A JavaScript Function. Yes, React has brought a component based UI system to its bare minimum. I may sound weird, but trust me, it took decades to get here. and React is the finest in history. At least according to most of the web developers.

How to code the “hello world” react App?
Once you have Node.js and NPM installed go ahead and run the following command in your terminal:

npx create-react-app my-app // Sets up a basic react project

Open the folder “my-app” in any of your code editor. This is how the files should look like:

src —Folder where the main core react files will be coded and stored.

public —Folder where you can place your assets and the index.html file.

Please feel free to ignore the following files as we won’t be testing our app or report vitals for time being :)

In every react based project, there will be an index.html containing a div or a section tag with an id of “root”. This div is where we would render or paint our complete react app.
Reduce code complexity: Guard clauses
Tags: softwareengineering
Published: 2021-11-27 16:47:29

---
title: Reduce code complexity: Guard clauses
published: true
date: 2021-11-27 16:39:20 UTC
tags: Softwareengineering
canonical_url: https://www.rockandnull.com/guard-clauses-vs-nested-conditionals/
---

 ![Reduce code complexity: Guard clauses](https://images.unsplash.com/photo-1554279652-51eee9372f32?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDIxfHxndWFyZHxlbnwwfHx8fDE2MzgwMzA5Njc&ixlib=rb-1.2.1&q=80&w=2000)

Almost every software engineer fights a never-ending fight: we strive to make our codebase simpler and thus more readable every day.

Complexity is added almost every time we interact with the codebase. A simple feature addition would probably result in added complexity and there's nothing we can do about it.

But there are patterns we can follow to keep complexity to the minimum. The simplest pattern you can start applying today and has an impressive impact on complexity is the [guard clause](https://en.wikipedia.org/wiki/Guard_(computer_science)).

Take a look at the following 2 snippets that have the same result.

```
fun nested() {
    if (condition1) {
        doThings1()
        if (condition2) {
            doThings2()
            if (condition3) {
                doThings3()
            } else {
                throw Exception3()
            }
        } else {
            throw Exception2()
        }
    } else {
        throw Exception1()
    }
}

fun guard() {
    if (!condition1) {
        throw Exception1()
    }
    doThings1()

    if (!condition2) {
        throw Exception2()
    }
    doThings2()

    if (!condition3) {
        throw Exception3()
    }
    doThings3()
}
```

You can see that the same code using guard clauses is easier to read and easier to reason.

In a nutshell, nesting adds complexity. Our code base, full of if statements are full of nesting. Avoid unnecessary nesting and you will reduce complexity.

When there's deep nesting you need more "mental" processing to keep everything in your head.

In addition, things are now more "local". The appropriate exception is thrown as soon as the error happens. No need to chase curly braces to figure out when something is thrown.

Hopefully, this simple trick can make your code a bit more readable with minimum effort.

Happy coding!
【Unity】How to use Git LFS.
Tags: git, unity3d
Published: 2021-11-27 16:31:19


## Intro
If your a file is larger than 100MB, you will need to manage it with Git LFS.

I write the way down on this article about how to use Git LFS.
Since I have many opportunities to use Unity, I will write based this on a simple Unity sample.

## Environments
| name | version |
|:-:|:-:|
|  Unity | 2020.3.4f1  |
|  Fork | 1.69.3.0  |

## What is Git LFS?
>Git is a distributed version control system, meaning the entire history of the repository is transferred to the client during the cloning process. For projects containing large files, particularly large files that are modified regularly, this initial clone can take a huge amount of time, as every version of every file has to be downloaded by the client. Git LFS (Large File Storage) is a Git extension developed by Atlassian, GitHub, and a few other open source contributors, that reduces the impact of large files in your repository by downloading the relevant versions of them lazily. Specifically, large files are downloaded during the checkout process rather than during cloning or fetching.

【reference source】：[Git LFS](https://www.atlassian.com/git/tutorials/git-lfs)

In a nutshell, it makes it easier and more convenient to work with large files on git.

And we can not manage a large file without Git LFS.
【reference source】：[About large files on GitHub](https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github)

## Experiment without Git LFS
We tested using Fork, a client tool for using git, to push a file larger than 100MB.

It failed as expected.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3lms0yg0v1w1kdmxstg.PNG)

## How to use
I use Git for Windows, which includes Git LFS, so I'll skip the installation steps.

First, copy the path to the large file.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/81butwtrpog7vbvea0ln.PNG)

Next, open the console and enter the following command.

```
$ git lfs track [path]
```

If successful, ".gitattributes" will be added and the lfs message will be written.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jw9z9suxldfg6wqng5e0.PNG)

If you have already created commit that contains a large file, you have to enter the following command.

```
$ git rm --cached [path]
```

## Other Resources
[Git Large File Storage](https://uraway.hatenablog.com/entry/2016/10/12/120041)