teleren/devto huggingface dataset:
Intro to Git and GitHub
Tags: programming, github, codenewbie, datascience
Published: 2021-09-11 13:08:40

Git is  Version Control System(VCS) for tracking changes in computer files
It entails the following:
- Distributed Version Control
- Coordinates work between Multiple developers (Collaboration)
- Who made What changes and When
- Revert back at anytime (rollback)

GitHub is a for-profit company that offers a cloud-based Git repository hosting service.

## Concepts of GitHub
- Keep track of code history
- Take 'snapshots' of your files
- You can visit any snapshot at anytime
- Local & Remote repositories

Lets make our hands Dirty and get Started by installing and performing basic git commands

### Installation

Click on the below link it will take you to git download page then choose your OS and continue with the installation process follow the Instruction
https://git-scm.com/downloads

##  Getting started 
Love command-line let's Dive in.😎

Check Git version
```bash
$ git --version

git version 2.25.1

```
Configuring git on Your machine

```bash
$ git config --global user.name 'yourusername'
$ git config --global user.email 'youremail@abc.com'

$ git config --list
```
Need help?
`git help <verb>` or `git <verb> --help`
ie. `git git help branch` or `git branch --help`
Lets create a directory where we shall do git operation and navigate into the directory

```
$ mkdir Learning_git 
$ cd Learning_git

```
that's pretty easy,

Initializing a Git Repository

```bash 
$ git init 
```
expected output
`Initialized empty Git repository in /home/samkb420/MyHobby/Learning_git/.git/
`
Adding file(s) to index
let use the ls command to list file and folders.
```bash 
$ ls -la
```
output
`total 12
drwxrwxr-x  3 samkb420 samkb420 4096 Aug 19 02:14 ./
drwxrwxr-x 52 samkb420 samkb420 4096 Aug 18 19:11 ../
drwxrwxr-x  7 samkb420 samkb420 4096 Aug 19 02:14 .git/
`
lets create a file.
we shall build a simple calculator in python don't worry if you don't know python its not that complex.
let's open our text editor for me am using vscode.

```bash 
$ touch calc.py
$ code .
```

let do simple add method in python
```python3
def add(a,b):
    
    return a + b
print(add(5,5))
``` 
having done that let do the following
```
$ git add -A  
$ git commit -m "[First commit #0001 ]"
$ git status 
```
output 
```
On branch main
nothing to commit, working tree clean
```
Now lets push the code in a remote repo in this case I Will use github.
continue into github and create a repo.
lets add the github remote url 
i.e
`git remote add origin https://github.com/BitgritCampus/Learn_Git_Github.git`
```
$git remote add origin remote_github_url
```
let now push to GitHub
```
git push -u origin main
```
Now add you credentials username and PAT(personal access token)
Hurrryy !! Done 

Next on Merging.
Scale down specific multiple deployments in kubernetes
Tags: kubernetes, devops, linux, scripting
Published: 2021-09-11 12:28:12

---
title: Scale down specific multiple deployments in kubernetes
published: true
description: linux shell scripting to scale down the deployments to zero
tags: kubernetes, devops, linux, scripting
//cover_image: https://direct_url_to_image.jpg
---

In kubernetes, if there are multiple deployment like 5000 deployments deployed in kubernetes **v1.20.0**, and in that around 800 deployments where migrated from kubernetes **v1.20.0** to **v1.22.0**,
When it need to scale down to zero only for 800 deployment.


We can use below shell script to scale down to zero for specific deployment.

> First list 800 specific deployments details should be listed below in the **deploy.list** file

**vi /tmp/deploy.list**
```
abc-xyz-service
nyx-api-service
jkx-graphql-api-service
java-jws-service
dotnet-ams-service
xyz-python-service
...
```

> Execute below shell script to scale down the deployments to zero.
```
for pods in `cat /tmp/deploy.list`
do
    kubectl scale --replicas=0 $pods
done
```
This should scale down the replicas of specific multiple deployments.
Proxy Quick DOM
Tags: javascript, dom, proxy
Published: 2021-09-11 12:12:39

{% codepen https://codepen.io/ZevanRosser/pen/4d19e8610e21be07d7110e176cb4927b default-tab=js,result %}

In this snippet a proxy is used that makes all html node `tagNames` valid methods. Each method can take strings and `HTMLElements` as arguments in any order to create a DOM structure. This may look familiar to people who have looked a bit deeper into the inner workings of some of the popular UI libraries of the last decade.

_See more stuff like this over @ [Snippet Zone](https://snippet.zone/)_
Microsoft Certification Week | AZ-900
Published: 2021-09-11 12:01:55

Microsoft Certification Week | AZ-900
--

**Topic: Azure Core Services and Solutions**
https://www.youtube.com/watch?v=8tgDd3-1JcI&list=PLKzgdQXYRdY3CsSogNRj5Iu07JMenHZOF

**Topic: Azure Management Tools and Networking**
https://www.youtube.com/watch?v=8ZvXMwf0DJY&list=PLKzgdQXYRdY3CsSogNRj5Iu07JMenHZOF&index=2

**Topic: Azure identity, governance, privacy, compliance, and cost management**
https://www.youtube.com/watch?v=HNaonKh1Xu4&list=PLKzgdQXYRdY3CsSogNRj5Iu07JMenHZOF&index=3
A Quick 10-Second Programming Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2021-09-11 12:00:00

---
title: "A Quick 10-Second Programming Joke For Today"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259a922f36.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q___: What is a developer's favorite country song?

___A___: Hello World - by Lady Antebellum
 -->
Cronos Airdrop (testnet)
Published: 2021-09-11 11:28:08

🚀 Cronos airdrop
Might  Airdrop like Uniswap

Step 1: Add this new network to your Metamask

Network Name: Cronos
RPC URL: https://cronos-testnet.crypto.org:8545/
Chain ID: 338
Symbol: tCRO


Step 2: Paste your Metamask on this faucet and request for test tokens👇

 Faucet: https://cronos.crypto.org/faucet

Step 3: Swap on the site below and provide liquidity

- Claim test token
- Swap 
- Add liquidity (Pool) 
- Go to reward and stake LP of the liquidity added
-Wrap CRO to wCRO (Swap)
- Unwrap wCRO to CRO
- wait for a while and claim reward(
- You can then stake the LP again


Swap link: https://testnet.crodex.app/#/swap 


Try to do this👍
Create A Separate Plugin For Custom Post Type In WordPress
Tags: wordpress
Published: 2021-09-11 11:17:58

Creating Custom Post Type of WordPress is pretty easy. 

Register post type in your functions.php and you're ready to go.

```
function custom_post_type_question() {
    register_post_type('questions',
        array(
            'labels'      => array(
            	'name'          => __( 'Questions', 'textdomain' ),
                'singular_name' => __( 'Question', 'textdomain' ),
            ),
            'public'      => true,
			'show_in_graphql' => true,
      		'hierarchical' => true,
      		'graphql_single_name' => 'question',
      		'graphql_plural_name' => 'questions',
            'has_archive' => true,
            'rewrite'     => array( 'slug' => 'faq' ), // my custom slug
        )
    );

}
add_action('init', 'custom_post_type_question');
```

## Why you should create separate plugin for custom post type
Because when you change the theme, the Custom Post Type code which was in functions.php will be gone. 

So for creating a plugin write this declaration in your php file.

```
/*
Plugin Name: Frontendli Questions
Plugin URI: http://frontendli.com
Description: Plugin to registers Questions 
Version: 1.0
Author: Tiranga Sheetal Beck
Author URI: http://frontendli.com
Textdomain: Frontendli
License: GPLv2
*/
``` 

Here is the full code with registering categories & taxonomies.[https://frontendli.com/create-separate-plugin-for-custom-post-type-wordpress/ ]
Flutter Learning Roadmap 2021
Published: 2021-09-11 11:17:25

Flutter Learning Roadmap 2021. Learning will be beneficial only if you are doing it in effective way. If you are trying to learning a stuff and you are doing it in a very bad way then you will not be able to get the most out of it. Find this post we are going to discuss the best effective way of learning flutter.

**What is Flutter**
Flutter is a brand new Framework developed by Google team. It is developed in Dart language. Flutter is the one of the best way to quickly make apps for different platforms with one codebase.

**Learn Dart Basics**
The first thing that you have to do before starting learning flutter is that you have to learn Dart programming language. Because Flutter uses Dart as its programming language so that you should have intermediate understanding of Dart syntax. You do not need to be expert in that you just need to know its syntax.

To read complete post and access free Flutter Resources visit original post [here](https://crunchythings.xyz/flutter-learning-roadmap-2021/)
Task-Force Week2 Experience
Tags: devops, awesomitylab, programming, codeofafrica
Published: 2021-09-11 10:58:43

> Here comes the second week's experience in **task-force**.
The second week was more technical but it also included soft skills.

**Part I: Technical Skills**

- **DevOps**.

**DevOps** is a set of practices that combines software development (Dev) and IT operations (Ops). It aims to shorten the **S**oftware **D**evelopment **L**ife **C**ycle (**SLDC**).

![devops image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0kpxart7fpmea1fo7hse.png)

I have found that having DevOps skills as a software developer is a good thing.

**Why DevOps?**
*DevOps is important because it enables **faster development** of new products and **easier maintenance** of existing deployments.*

- **Git Workflow**

A Git workflow is a recommendation for how to use Git to accomplish work consistently and productively.

A better git workflow is something software developers and DevOps teams are required to use because it is an essential tool to support good code quality and hence a good product.
 
> You can learn more about git workflow [here](https://www.freecodecamp.org/news/practical-git-and-git-workflows/)

**Part II: Soft Skills**

As a software developer, you don't need technical skills only. It's not all about writing codes and sort of.

This second week equipped me with :

- **Intercultural communication skills**

Intercultural communication skills are an essential part of a healthy work environment and effective workflow.

Intercultural communication skills give you a better understanding of your workplace and co-workers and also help you to adapt to new work environments and prevent [culture shock](https://www.investopedia.com/terms/c/culture-shock.asp).


Concluding, I can say that I learned a lot of new things during the second week in the task-force that is not only needed by a software developer but also any person. 

![lightbulb](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n8jmnhx1cl0532u0xpx2.png)

{% link https://dev.to/ericus123/task-force-week1-experience-5c1h %}
Angular Material Delete Popup Using Bottom Sheet
Tags: angular, css, html, webdev
Published: 2021-09-11 10:58:06

In this user interface, we used bottom-sheet angular material components. Also, we used buttons on click to show the bottom popup.

To make responsive we used media queries and also we modify the bottom-sheet used classes. These are fully responsive and mobile-friendly elements.

Make it yours now by using it, downloading it, and please share it. we will design more elements for you.

[Source code](https://w3hubs.com/angular-material-delete-popup-using-bottom-sheet/)
10 VS Code keyboard shortcuts for Mac
Tags: vscode, macos, shortcuts, productivity
Published: 2021-09-11 10:46:29

Speed up your development flow by utilising common keyboards shortcuts in VS Code. Once you get a hang of a few shortcuts, you can deepdive into the complete list of all [macos keyboard shortcuts](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf) for VS Code.

## Find selected text
- all instances: `⇧⌘L`
- the next instance: `⌘D`
![Find selected text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bo173kyr3frg2hglelob.gif)

---

## Multi-cursor selection

- above the current line: `⌥⌘↑`
- below the current line: `⌥⌘↓`

![Multi-cursor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mikurso957fmh83qvhjq.gif)
 

---

### Select text around cursor
- Up: `⇧↑`
- Down: `⇧↓`
- Left: `⇧←`
- Right: `⇧→`

![Select-around](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vjzhws56bfkrocdk4i5h.gif)

---

## Code folding

- Fold current selection: `⌥⌘[`
- Unfold current selection: `⌥⌘]`
- Unfold all code in file: `⌘K⌘J`

![Code folding](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qrg3hl65xngcq6zvq1lg.gif)

---

## Split screen display
- vertical: `⌘\`
- horizontal: `⌥⌘0` (split vertical first)

![Split screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lxo4a97fpfboytfm0qwe.gif)
Array sorting callbacks
Tags: javascript, sorting
Published: 2021-09-11 10:39:15

Photo by <a href="https://unsplash.com/@edgr?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Edu Grande</a> on <a href="https://unsplash.com/s/photos/filing?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>

A short Q&A on `Array#sort()` and passing a basic callback.

Before starting, let's just shorten `console.log`:

```js
const { log } = console
```

Similar to [before](https://dev.to/shuckster/foreach-break-continue-4lpl), the question is: 

> "At the end of each run, can you guess what will be logged?" 🤔

### 1. `array` vs. `[...array]`

```js
const chars = ['a', '🪴', 'n', 'Z']
const sort = arr => [...arr].sort()
const sortInPlace = arr => arr.sort()

// 1a)
const output1 = sort()
log('output1 === ', output1)
log('chars === ', chars)

// 1b)
const output2 = sortInPlace()
log('output2 === ', output2)
log('chars === ', chars)
```

### 2. numbers vs. strings

```js
const numbers = [2, 3, 1, 10]
const strings = ['2', '3', '1', '10']
const sort = arr => [...arr].sort()

// 2a)
const output1 = sort(numbers)
log('output1 === ', output1)

// 2b)
const output2 = sort(strings)
log('output2 === ', output2)
```

### 3. using a callback

If `callback` looks like this...

```js
function compare(a, b) {
  if (a < b) return -1
  if (a === b) return 0
  if (a > b) return 1
}
```

...then:

```js
const numbers = [2, 3, 1, 10]

const sort = () =>
  [...numbers].sort()

const sortCompare = () =>
  [...numbers].sort(compare)

// 3a)
const output1 = sort()
log('output1 === ', output1)

// 3b)
const output2 = sortCompare()
log('output2 === ', output2)
```

If you need a little help, I made a corresponding [interactive version](https://zansh.in/array-sorting.html) of the article that offers some very basic visuals (with a few extras toward the bottom!)

I'm not sure if they help intuit what's going on, but they give the answers at least! Did they meet your expectations?
Changing (dark/light) Image on Ionic 5 react ios app
Tags: react, ionic, ios
Published: 2021-09-11 10:31:11

---
title: Changing (dark/light) Image on Ionic 5 react ios app
published: true
description: change image in react component when switching between dark mode and light mode
tags: react, ionic, ios
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96goxg91uyonr53v47mq.jpg
---

## Teh struggle is real...

> After million times googling for this, I realized the solution was actually alot simpler then i was making it.

__My Stack:__
Ionic
react
capacitor
xcode simulator


#### Component:

```javascript
...
<IonRow>
   <IonCol>
     <div id="main-block-farm-round-logo"  />
   </IonCol>
</IonRow>
...

```
#### Css Stylesheet (for Component)

```css
@media (prefers-color-scheme: dark) {
  body {
    #main-block-farm-round-logo {
      background-image: url("textlogo-dark.png");
      background-repeat: no-repeat, repeat;
      background-position: center; 
      background-repeat: no-repeat; 
      background-size: cover;

    }
}

@media (prefers-color-scheme: light) {
  body {
    #main-block-farm-round-logo {
      background-image: url("textlogo-light.png");
      background-repeat: no-repeat, repeat;
      background-position: center; 
      background-repeat: no-repeat; 
      background-size: cover;

    }
}

```

### Another way...

I guess I already did this programattically in a react component and forgot i did it hahaha:

```javascript
let systemDark = window.matchMedia("(prefers-color-scheme: dark)");

  if (systemDark.matches) {
    particlesConfig = particlesConfigDark
  } else {
    particlesConfig = particlesConfigLight
  }
```
Some handy HTML tags can do to make things easier
Tags: html, beginners, webdev, codenewbie
Published: 2021-09-11 10:29:56

HTML (Hypertext Markup Language) is a standard markup language used to create web pages. Tags are like blocks to give special semantics meaning to the content and help browser rendering. Thus, they play a very important role in SEO(search engine optimization).

Although HTML tags is widely known and widely used, some of them have been long forgotten. In this article I’ll share some HTML tags that have helped me a lot when developing websites over the years 🎉

&nbsp;
##`<summary>` & `<details>`
The `<summary>` tag defines a visible heading for the `<details>` element. The heading can be clicked to view/hide the details.

The `<details>` tag is often used to create an accordion that the user can open and close.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y3elahvlp8tihyd5ssu1.png)

##`<dialog>`
The `<dialog>` tag defines a dialog box or other interactive components like alert, inspector, or subwindow.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qubq4xc5kdl87ejfowu8.png)

##`<time>`
The `<time>` tag defines a specific time/date. It does not render anything special on webpage but it's extremely helpful for better search engine results or custom features such as reminders.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nihifg6rff1slsgq7ijk.png)

##`<datalist>`
The `<datalist>` tag is used to define the list of valid dropdown list for your various <input> element and provide an "autocomplete" feature.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dpdq6uv5q6v9vveh2ehk.png)

##`<progress>`
The `<progress>` tag represents the completion progress of a task on a bar indicator.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7y4mk2qcqejgt8vjpgy.png)

##`<small>`
The `<small>` tag defines smaller text like copyright or legal text. Although it may be perceived to violate the principle of separation between structure and presentation, but it's valid in HTML5. Therefore, please determining whether to use `<small>` or CSS your content accordingly.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wd3j2yrkw1rqg8tdxy7k.png)
 
&nbsp;

I hope you find this helpful and don't forget to check on the cross-browser compatibility before adding more semantics to your HTML. Your webpages will become more user friendly and more machine-readable. Thank you 😊
Basic Understanding of Cost Function + Formula
Tags: machinelearning, python, jupyter, algorithms
Published: 2021-09-11 10:02:31

The Linear Regression algorithm can get the best fit line for our data set. We mostly use it to predict future values. But, when we use linear regression, We can see little errors on predicted values rather than on the actual data points. Sometimes, the actual value and predicted value can be change. In this post, see what is the Cost Function is.
There are many Cost Functions in machine learning. Each has its occasion depending on whether it's a regression or classification problem.

- Regression Cost Function
- Binary Classification Cost Functions
- Multi-class Classification Cost Functions 

## What is an Error?
Always I try to give a simple answer for better understanding. Look at the linear regression graph below. In that graph, we can see the difference between the actual value and the predicted value. Basically, that difference is an *"error"*. If you don't understand what is linear regression is, I would recommend reading my previous article about linear regression.

{% link thirashapraween/math-behind-simple-linear-regression-scikit-learn-5gc2 %}

![cost function error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8xvp5hnpmg375il4p1x.png)


## Cost Function
So Cost Function helps to understand the difference between the actual value and predicted value. The definition of the Cost Function is *"It's a function that determines how well a Machine Learning model performs for a given set of data."*

### What is the formula of Cost Function?
The Cost Function has many different formulations. Let's see the Cost Function for linear regression with a single variable.

![cost formula](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/soaa6siq25yem317asfc.png)

- **m**: Is the number of our training examples.
- **i**: The number of Examples and the Output.
- **Σ**: The Summatory.
- **h**: The Hypothesis of our Linear Regression Model

In addition, we can find the Cost Function with this simple formula below.

![cost func 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/icwera0kyn8yh9mq1af8.png)

So, how can we make the Cost Function as little as possible? the gradient descent is the best method rather than linear regression for minimizing the Cost Function. We'll talk about that later.
Getting started with programming, kind of
Tags: beginners, programming
Published: 2021-09-11 05:06:48

---
title: Getting started with programming, kind of
published: true
description: A collection of links for my beginner friends
tags: ["beginner", "programming"]
---

- https://leetcode.com/problemset/all/ for coding interviews
    - https://youtu.be/xAxgzrj8zgU this guy shows how to meta-study for coding interviews
- https://refactoring.guru/ for refactoring & reviewing design patterns
    - https://www.martinfowler.com/architecture/ if you want more
- https://github.com/donnemartin/system-design-primer for system design
- https://dev.to/ explained stuff to me like I'm 4 years old
    - https://dev.to/mjyc I used to post some too!
- https://homes.cs.washington.edu/~jstn/#/teaching my grad school buddy who has amazing Git & C++ beginner’s tutorials
    - https://girliemac.com/blog/2017/12/26/git-purr/ git purr
- https://github.com/alebcay/awesome-shell shell is awesome
- https://github.com/Mayccoll/Gogh I like dracula, nord, github, night owl, dissonance/brogrammer, and broadcast
    - https://www.reddit.com/r/terminal_porn/ oh yeah
- https://carbon.now.sh/ if you need to share your amazing command line script
- https://roadmap.sh/ cause developers need a roadmap too