teleren/devto huggingface dataset:
Twitter???
Published: 2020-11-01 21:39:20

Earlier this week(Thursday the 26th) I received a very important email. I was invited to complete a hiring test for twitter's Software Engineering Apprentice program. I remember applying and this was the first time the company got back to me. I was given until 3pm on Nov 2 to complete the assessment. I won't lie I am definitely very nervous going into this because I have taken many assessments like this in the past for many different tech companies and not heard back from them. I believe I did not do well on those previous assessments. I have doubled down on studying algorithms and data structures more in the last few weeks than before but I can still be caught completely off guard by a problem. I think the practice I've had using LeetCode and using HackkerRank have helped me a lot. But now, It's time to put my knowledge to the test once again. I understand that the outcome will not be the end of the road for me as this is just an internship. It would definitely lead me in the direction that I would like to go career wise. Wish me luck tomorrow, I'm going to make sure I get some good sleep and eat breakfast tomorrow to knock this test out of the park!!!!
The GitHub CLI (gh repo clone)
Tags: github
Published: 2023-04-23 11:17:12

---
title: The GitHub CLI (gh repo clone)
published: true
date: 2020-11-01 20:06:03 UTC
tags: GitHub
canonical_url: https://chrisdevcode.hashnode.dev/the-github-cli-gh-repo-clone
---

# The GitHub CLI (gh repo clone)
 ![Image for post](https://miro.medium.com/max/1436/1*_t6Uv_WHkdAqBj7GO0a8_g.png)

[GitHub CLI](https://cli.github.com/) beta version was released a while ago, and it comes with really cool features. I have been using and interacting with GitHub without necessarily visiting the website, that’s fun right.

An alternative to using GitHub CLI is [HUB](https://hub.github.com/), which was there before GitHub cli was introduced.

GitHub CLI is an open-source project, here on [GitHub](https://github.com/cli/cli/).

I had an article before on [using GitHub CLI and its commands](https://dev.to/chrisachinga/using-github-s-cli-on-ubuntu-commands-3a89), so this is kind of like an update because the cli is up on version 1.x.x right now, better to stay on the know/updated. To get the latest releases of the cli [https://github.com/cli/cli/releases](https://github.com/cli/cli/releases)

![Image for post](https://miro.medium.com/max/60/1*pn3P9h9Yv3dNcO5ZkgXBSg.png?q=20)

 ![Image for post](https://miro.medium.com/max/2732/1*pn3P9h9Yv3dNcO5ZkgXBSg.png)

Everything you need to know about the cli is on their site, [https://cli.github.com/](https://cli.github.com/)

# Installation

[GitHub CLI](https://cli.github.com/) has to be installed on your device for you to use it.

View installation procedures based on your operating system:

[Installing GitHub CLI](https://github.com/cli/cli#installation)

# Usage

With the cli, you can create repositories, pull requests, issues, clone repos, and much more.

If I were to write on every usage gh cli has to offer, this would have been one of the longest and probably most boring technical articles, so I’ll break them down and make a mini-article-series if that makes sense.

# `gh repo clone`

This is one of the commands GitHub cli comes with. The gh clone works in a similar way as the popular git command, git clone.

Note that git and GitHub cli are two different things, but the gh clone and git clone perform a similar function altogether and have a similar syntax.

to use the command, browse into your favorite GitHub project, and clone it using GitHub cli, easy and fun.

For me, I’ll go to one of my repos, [https://github.com/ChrisAchinga/javascript.](https://github.com/ChrisAchinga/javascript.) Click on the green button code, a dropdown appears, click on the Github CLI tab and copy the command; `gh repo clone ChrisAchinga/javascript`

![Image for post](https://miro.medium.com/max/60/1*U0WvFiMOwWgYcTzAegxiFA.png?q=20)

 ![Image for post](https://miro.medium.com/max/2732/1*U0WvFiMOwWgYcTzAegxiFA.png)

Simple as that and you are done.

A simple start to becoming a GitHub cli master!
Flexbox Blog
Published: 2020-11-01 21:14:47

A Flexbox Module is an easier alternative for designing a flexible and responsive layout. 

**Terms:**

- A **flex-direction** property is a property that defines what direction the container wants to stack the other flex items. I used it to stack the cars of my car dealership website.

```css
.flex-container {
   display: flex;
  flex-direction: column;
  background-color: white;
}
```
- A **flex-wrap** is a property that specifies whether the flex items should wrap or not. For me, Flex Wrap helped me keep all the cars together and evenly spaced.

```css
.flex-container {
  display: flex;
  flex-wrap: wrap;
  background-color: white;
}
```

- A **flex-flow** property is a type of property called a shorthand property which sets both the flex-direction and flex-wrap properties. I used flex flow to align the cars on my website.
```css
.flex-container {
  display: flex;
  flex-flow: row wrap;
  background-color: white;
}
```

- A **justify-content** property is a property that is used to align flex items.

```css
.flex-container {
  display: flex;
  justify-content: center;
}
```
- An **align-items** property is a property that is used to align the other flex items.

```css
.flex-container {
  display: flex;
  height: 400px;
  align-items: left;
}
```

- An **align-content** property is a property that is used to align flex lines.

```css
.flex-container {
  display: flex;
  height: 400px;
  flex-wrap: wrap;
  align-content: space-between;
}
```
Here is a website I made on Figma.

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

And Here is the one I made on Replit.

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

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

**Conclusion**

In conclusion, using flexbox can help organize your website, catch the eye of a visitor, and to generally make you website look more professional. Flexbox is a a great tool for creating a nice looking website for beginners. 

**Sources:** https://www.w3schools.com/css/css3_flexbox.asp
             https://www.figma.com/file/iJc1INHrB2RcWITIqZnuKi/Flexbox-Website?node-id=0%3A1
1st time completing hacktoberfest as an undergraduate chemist 
Tags: hacktoberfest
Published: 2020-11-01 21:10:07


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

### Who am I?
Well i'm a chemistry student from Mexico, I love doing science and being in the lab, also love to create things and meet new friends   
### Background

Even thouhg I love my career, still there was something missing and it was programing, I've never think about programing as something that would interest me but I got interested in Highschool by some guy that was a mathematician and the way he talked about programing really made a change in my way to see things,  I'm still new to this but i'm learning and I want to find a way to combine my two passions and that's the only thing that matters.
.

### Progress

Last year I had the oportunity to participate, but i was really new to programing so it felt scary for me to participate, but this year I was totally into it, I searched pull request for newbies like me, but i did not get something that made me comfortable, so it was hard for me, but searching viciously a pull request that fit to my knowledge was easier than i've thought, everyone was so nice and ask changes in the most digestable way  

### Contributions



1."Queer-of-the-day-bot" My first commit was a research task and i got interested because the bot was somewhat new.
https://github.com/VickiLanger/LGBTQ-of-the-day-bot

2.Machine-Learning-with-Python This was a education task where I contributed by making an abstract of Machine learning
https://github.com/Andres8ezau/Machine-Learning-with-Python

3.Refranator this was another bot that twets "refranes" 
https://github.com/Andres8ezau/Refranator

4.FunnyAlgorithms this last one was a program that i made on Matlab that was a way to solve Bolzano's Theorem
https://github.com/Andres8ezau/FunnyAlgorithms



### Reflections
I want to be able to make more contributions next year and get out of my comfortable zone and be more adventurous, I learnt a lot and to be able to make a contribution to the open source community it feels great  
See you in 2021...
Why I Chose Software Engineering
Published: 2020-11-01 21:07:58

I have chosen to become a software engineer for a multitude of reasons. The main reason is simply because being a software engineer opens up so many doors to many different occupations so you can have a variety of options. Another main reason why I chose to pursue software engineering is because of job security. The tech field is ever expanding and because of this, coders will always be needed. This is not necessarily a reason for me pursuing software engineering, but I do have a tremendous passion for computers and technology, so to get the opportunity to work on or with computers would be a dream come true.

Earlier this year I was furloughed from my job due to COVID-19, so instead of sitting around waiting to get a call back, I decided to go back to school. I chose Flatiron because a friend of my who is a software engineer recommended them. After doing my own research on the school I decided that Flatiron was best for me. So far I am loving the curriculum, the people, and the knowledge I am gaining to pursue my dream of becoming a software engineer. The positivity and assistance the cohort leads, other cohort members, and educational coaches provide make me even more comfortable with my decision of pursuing my dream.

In closing, I look forward to meeting more of my cohort members and to continue chasing my dream of becoming a software engineer. I cannot wait to see where this journey takes me. Again, I would like to thank my cohort leads, other cohort members, and my educational coaches for all their support. I hope to see you guys out in the job force soon. Good Luck everyone!
JavaScript Currying
Tags: javascript, programming, functional, es6
Published: 2020-11-01 21:04:39

This week, as I was learning about functional programming with JavaScript, I came across the concept of currying. As per usual I got to learn a cool new programming term that I had never heard before. This weeks' fun new word was "arity." If you hear someone refer to the "arity" of a function, they are talking about the number of arguments that the function requires. With this in mind, currying a function means to convert a function of X "arity" into X functions of "arity" 1. Let's look at an example to get a better understanding of what this means. 
```
const normalFunction = (a, b) => {
    return a + b;
}
```
Here we have an example of an un-curried function with an "arity" of 2, since it takes in two arguments a, and b. 
```
const curriedFunction = a => b => a + b;

curriedFunction(2)(4)

// returns 6
```
If, for some reason, you are unable to supply all of the arguments for a function at one time, this could come in handy. You could save each function call into a variable, which would hold the value of the returned function which could then take the next argument when it becomes available.
```
let funcB = curriedFunction(1);

console.log(funcB(2));

// Returns 3
```

And there you have it, a short and sweet introduction to JavaScript currying. I encourage you all to explore this topic in more depth, since I have heard it is a fairly common question to encounter during technical interviews.
Custom React hook useWindowSize()
Tags: react, hooks, javascript
Published: 2020-11-01 20:56:22

---
title: Custom React hook useWindowSize()
published: true
description: 
tags: React, Hooks, Javascript
cover_image: https://blog.theodo.com/static/726bca67a2c328a64b12d14e79f36e88/50383/react-hook-1024x512.png
---

Sooner, I needed to get the viewport width on a React app and I wanted it real time updated so I decided to make a hook to deal with it.

Here comes the whole code:

```jsx
import React, { useEffect, useState } from "react"

const useWindowSize = () => {
  const [windowWidth, setWidth] = useState(undefined)
  const [windowHeight, setHeight] = useState(undefined)

  useEffect(() => {  
    const getSize = () => {
      setWidth(window.innerWidth)
      setHeight(window.innerHeight)
    }
    window.addEventListener('resize', getSize)
    getSize()

    return () => {
      window.removeEventListener('resize', getSize)
    }
  }, [])

  return { windowWidth, windowHeight }
}

export default useWindowSize
```

## Some explanations

```js
  const [windowWidth, setWidth] = useState(undefined)
  const [windowHeight, setHeight] = useState(undefined)
```

I initialize the states with `undefined` that avoid some build errors and allow you to get rid of 👇️

```js
if (typeof window !== 'undefined'){
  // make stuff with window object
}
```

As the component did mount, the `getSize()` function set the states with `window.innerWidth` and `window.innerHeight`

We also handle the event _'resize'_ on the `window` object with `getSize()` to keep track of the sizes anytime it could be changed.

## Usage

This can be used in component as follow :

```jsx
import React from 'react'
import useWindowSize from "path/to/useWindowSize"

const Header = () => {

  const {windowWidth} = useWindowSize()

  return (
    <header>
      {windowWidth < 700 ? (
        <MobileMenu/>
      ) : (
        <DesktopMenu/>
      )}      
    </header>
  )
}
```

I would be pleased to read your comments, _seeya_ 👋️
Limit battery charging on Asus & Ubuntu
Tags: linux, ubuntu, asus, battery
Published: 2020-11-01 20:55:17

I'm a fan of old-school desktop computers, and for my normal work, I use two of them. However, to be able to work on the go, I also need a decent laptop. 

I've got myself **Asus ExpertBook B9450**, a powerful yet small and light one. What I love about it the most is that **it can run, according to ASUS, for 24-hours** on a battery. It was even tested to play full HD videos for 30 hours without charging. 

For me, it's like a miracle, and even with my workflow (several Dockers, several IntelliJ instances, etc.), it survives on the battery for about 14 hours under high load. That makes it really a mobile device.

I'm running the latest LTS Kubuntu distro, and while it runs great on it, there are several known issues:

- **The fingerprint reader doesn't work.** I don't care. And it seems that there is some work in progress. 
- **Numpad integrated inside the touchpad doesn't work.** Well, I was a bit sad about it initially, but after testing it on Windows, I've not got used to it. I'm not missing it. 
- This laptop and some Asus ZenBook laptops come with a **limiting battery charging to 80% to protect it**. 

The last point was something I missed the most as since it's mobile and only mobile device for me, I want it to have the battery in perfect shape.

Fortunately, this one is really easy to fix. Just run `sudo crontab -e` and add this line to the end of the file: 

`@reboot echo 80 > /sys/class/power_supply/BAT0/charge_control_end_threshold`

You can either reboot the laptop or run the same command with `sudo` to set it for the current session. 

And that's it. This single line is executed when the computer is booted up and set the charge control to limit the battery charging to 80% of its capacity (which is better for Lithium-ion batteries than charging it to 100%).
PuTTY Basics
Published: 2022-08-16 21:11:20

---
title: PuTTY Basics
published: true
date: 2020-11-01 20:45:54 UTC
tags: 
canonical_url: https://blog.livialima.net/putty-basics
---

**[PuTTY](https://www.putty.org/)** is a free and open-source terminal emulator, very popular as a SSH client; used primarily by Windows users.

## SSH Connection

- Open PuTTY
- Select **Session**
- Enter the `username@hostname` or just the remote _hostname_ or IP address at **Host Name**. Example:
```
admin@192.168.1.2

```
- Connection: **SSH**
- Port: **22**
- (Optional) Name your session in **Saved Session** field and click **Save**
- Click **Open**

**DISCLAIMER: You may need to generate/add a private key for authentication.**

![putty-session.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1657054042822/786kWvPwg.png)

## Add a private key for authentication

- **Connections**
  - **SSH**
    - **Auth**
- Browse and select the **private key** for authentication. It should be a `.ppk` file.

![putty-auth.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1657054015584/-RK1HJBsb.png)

## Create a private key with PuTTYGen

On Windows:

- Go to Windows **Start** menu
  - **All Programs**
    - **PuTTY**
      - **PuTTYgen**
- Parameters:
  - Type of key: **RSA**
  - Number of bits in a generated key: **2048**
- **Generate**
- Specify a **passphrase** for the key
- **Save private key**

On Linux:

```
puttygen -t rsa -b 2048 -C "user@host" -o keyfile.ppk

```

Check the [PuTTYGen manual](https://www.ssh.com/ssh/putty/windows/puttygen) for more details.

## Convert an Amazon .pem key to PuTTY .ppk key

On Windows:

- Go to Windows **Start** menu
  - **All Programs**
    - **PuTTY**
      - **PuTTYgen**
- Parameters:
  - Type of key: **RSA**
  - Number of bits in a generated key: **2048**
- **Load**
- Select your `.pem` file for the key pair
- **Open**
- **Save private key**

On Linux:

```
puttygen keyfile.pem -O private -o keyfile.ppk

```

Check the [Amazon Docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html#putty-private-key) for more details.

More about PuTTY and PuTTYGen can be found at the [manual page](https://www.ssh.com/ssh/putty/putty-manuals/0.68/index.html).
Find Numbers with Even Number of Digits from leetcode
Tags: javascript, node, leetcode, algorithms
Published: 2020-11-01 20:34:13

 Code flow as follows: 
        -> I have converted numbers into a string.
        -> then find the length of the string
        -> If any length is divisible by 2 then push the value to 
           a new array.
        -> return the length of the array.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gxauam1lsxh15eopx1u7.png)
How can I make money by creating online edu-platform?
Tags: laravel, php, javascript
Published: 2020-11-01 20:13:31

Hi, We are creating online education platform which is compatible for Central Asia. We have own auditory(aboug 5K on social networks and 100+ visits/day on website). The first version is free and open for all. But now we are creating a platform based on monthly/annual subscription. But how can we make money with that subscription? Consider that user paid for the subscription and he/she has access to all courses. But we should pay all instructors for their courses. But how can we distribute and be on profit? Can you suggest some thoughts? 

Thanks!
.NET Learning Challenge!
Tags: dotnet, beginners, codenewbie, webdev
Published: 2020-11-01 20:00:26

## Compete, Learn, and Develop Skills
https://aka.ms/dotnetskills

November 1, 2020 - November 30, 2020

Compete against friends and coworkers by completing interactive modules on how to build apps across multiple platforms with .NET and earn your rank on the leaderboard.

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

Over 40 hours of **FREE** Learning inside of this awesome collection of 8 Paths and 5 additional bonus modules.

Topics include Basic C# skills, Web API development, Blazor Apps, Static Web Apps, Xamarin and Visual Studio or VS Code

Get started by going to https://aka.ms/dotnetskills

Learning Paths include:

* Build .NET applications with C#
* Add logic to your C# applications with C#
* Work with data in C#
* many more

Modules include:
* Create a web API with ASP.NET Core
* Improve the developer experience of an API with Swagger
* Build a web app with Blazor Web Assembly

By the end of the challenge, you'll have marketable skills to better yourself and your career.

Tweet about your progress with the hastag **#dotnetskills**. Let me know @spboyer how you're doing. Challenge your friends and colleagues. How many modules and paths can you complete this month?

Have fun and learn.
My Hacktoberfest Story
Tags: hacktoberfest, opensource
Published: 2020-11-01 19:47:01

### Introduction🚀
Hey, there! 👋🏻
I am Vibhor Krishna

Currently I am pursuing B. Tech in Computer Science from Thapar University.
I am a Chess Player, Competitive Programmer and now I am also a Open Source contributor.

### Background🚀
I am an enthusiastic Programmer and actively involved in Competitive Programming.
I started my Open Source journey from Hacktoberfest 2020.

### Progress🚀
My current progress in Hacktoberfest is that my 4 pull request has been accepted for Hacktoberfest 2020.

### Contributions🚀
In this Hacktoberfest I contributed as a Participant.
As a participant, I was able to make 4 quality pull requests and all of them are accepted for Hacktoberfest 2020.

### Reflections🚀
Overall, it was a very amazing experience for Hacktoberfest 2020.
This is my first Hacktoberfest and I learn a lot of new things and also make some new connections.
Looking for more such events.
First steps in Dev world
Tags: beginners, codenewbie, firstpost
Published: 2020-11-01 19:43:18

Hello everybody :wave: ! 

This is my first post and I would like to share some tips & tricks from my newbie experience and maybe help other beginners.

One year ago I have decided to change my career and start learning programming.

So here are some tips & tricks:

- Find your *path* 
    - I am not good at self learning, so I've decided to join a school, for me it was Codecool
    - If you are not like me, I strongly recommend [freecodecamp](https://www.freecodecamp.org)
    - Or just have a look [here (the hard and long way)](https://github.com/ossu/computer-science#advanced-systems) or [get inspired here](https://roadmap.sh/)

- You do not need technical background, you do not need to know math (some basics are still recommended:))

- Do not try to learn everything :exclamation: (there are a lot of programming languages and tools)

- Start from the basics and then add more and more (don't jump into OOP or some fancy frameworks)

- Be consistent (try to code and learn something new everyday)
    - You can practice on [codewars](https://www.codewars.com/) or get more advices [here](https://www.freecodecamp.org/news/the-10-most-popular-coding-challenge-websites-of-2016-fb8a5672d22f/)
    - Start your dream project
    - Look for some applications ideas [here on dev](https://dev.to/octocodeio/15-app-ideas-for-beginners-3bef)


- Don't give up and be optimistic

Thank you!:pray: