teleren/devto huggingface dataset:
The Best Way To Learn on the Job
Tags: beginners, programming, productivity, codenewbie
Published: 2022-06-03 23:54:57

I've been in the industry now for 2 years after getting my first job as a Developer Support Engineer at Plaid. I never knew what to expect but I knew that I still had a lot to learn. As a self-taught developer, there are naturally some gaps in my knowledge that I need to fill. The question I asked myself so much is "how in the hell am I going to learn all this?".

Being brand new to the role and the industry, I came in already overthinking every aspect of the job and feeling like there was this high expectation to deliver that I needed to hit. But I found out very early on what I had to do in order to fill in the gaps and bring as much impact as possible to the team!

And that was to:

##Leverage Your Co-Workers! 

There was an invaluable resource readily available to me that I completely overlooked.. And that was my co-workers. These are individuals that have been in the trenches way longer than I have! They have seen and done the things I dreamt of doing so I started to leverage them and became a sponge, soaking up as much knowledge as I could.

I asked them questions whenever I could. Being an introvert myself, it was hard at first to get out of my comfort zone and actually talk to people. Yes.. weird I know but I do suffer from social anxiety. Over the years, I have learned to somewhat overcome this. I'd love to tackle this in another blog post if people are interested!

## Becoming a Sponge
Anytime I struggled on a certain bug/problem, I asked in related Slack channels so individuals from that respective team could give me an answer. If it still wasn't clear, I'd keep poking until I understood. Eventually I identified the people that explained certain concepts in a way I could understand and were willing to hop on calls to explain them further.

Those are the people I'd naturally gravitate towards and who I have learned from the most. Without them, it would've taken me even longer to learn something either from scratch or sifting through StackOverflow questions. 

## Conclusion

Moral of the story here is to use the resources that are right in front of you. It might seem intimidating at first (and trust me, I still get anxiety doing it now), but it will be the best thing you'll ever do. 

In March of 2022, I started a new role as a Developer Advocate at [Airbyte](https://airbyte.com/), making the transition from more of a Frontend focus to a Data Engineering focus. This in itself is one of the biggest challenges I am currently going through. But being surrounded by Data Engineers and Data Analysts, I know I will get through this 😉

I hope you enjoyed this blog post! Hit me up on [Twitter](https://twitter.com/Chau_codes) if ya have any questions and to see when a new blog post comes out! See ya in the next one 🙏🏽
PowerShell like Linux
Tags: powershell
Published: 2022-06-03 23:52:44

---
title: PowerShell like Linux 
published: true
description: Your PowerShell like Linux 
tags: powershell 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m5ekcuztpo8nj8z03juk.jpg---

## Install posh-git
 - Repository: https://github.com/dahlbyk/posh-git

```
Install-Module posh-git -Scope CurrentUser -Force
```

## Install oh-my-posh
 - Repository: https://ohmyposh.dev/docs/

```
Install-Module oh-my-posh -Scope CurrentUser -Force
```

## Open Profile PowerShell

```
code $PROFILE
```

## Save PowerShell Profile with this

```
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme slimfat
```
Day 56: It's official, I'm in love with GraphQL😚.
Published: 2022-06-03 23:48:26

Hi!
So today was about GraphQL and I'm loving it. I have been working with REST APIs since when I started learning about backend development and I always noticed some of it's issues that GraphQL was created to address but I didn't know there were solutions.   surprisingly I'm finding great resources to use and today I discovered How to GraphQL which is a really grate resource for learning not only the basics of GraphQL but also how to use it in real contexts like React projects, TypeScript projects...

I would like to say more but I'm too tired to type anythingg It's already weekend I will be back later tomorrow hahah Byeee...
Signing off...
Intersection of Two Arrays
Tags: leetcode, dsa, theabbie
Published: 2022-06-03 23:30:35

Given two integer arrays `nums1` and `nums2`, return _an array of their intersection_. Each element in the result must be **unique** and you may return the result in **any order**.

**Example 1:**

**Input:** nums1 = \[1,2,2,1\], nums2 = \[2,2\]
**Output:** \[2\]

**Example 2:**

**Input:** nums1 = \[4,9,5\], nums2 = \[9,4,9,8,4\]
**Output:** \[9,4\]
**Explanation:** \[4,9\] is also accepted.

**Constraints:**

*   `1 <= nums1.length, nums2.length <= 1000`
*   `0 <= nums1[i], nums2[i] <= 1000`

**SOLUTION:**

    class Solution:
        def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
            return list(set.intersection(set(nums1), set(nums2)))
Daily.dev, an article feed service developers need
Tags: webdev, javascript, programming, tutorial
Published: 2022-06-03 23:30:00

I've been using [daily.dev](https://daily.dev/) for quite a while now, it is an amazing news/article feed service for software developers or every tech worker to keep up what's happening in the tech world and recommending cool apps.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6w2qcqdw86iujdzye61b.png)

The UI of daily.dev is straight forward with a nav bar on the left side. Here you can choose to only show your feed, or filter categories including the most popular articles, most upvoted and best discussions. There's also bookmarks and reading history.

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ix9b7xgt7kremzpdt0q.png" alt="DevCard" width="200px"/>

My personal favorite feature on daily.dev is the **_#DevCard_**. It's a cool graphic card shows multiply status of your activities and achivement during the time you spend on daily.dev. The system will generate a embed `<a href>` link for you to added to your portfolio or github readme page, which is pretty neat.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2r7dkbrux1vvvfhshsws.png)
Another cool feature from daily.dev is that you can added it to your chrome homepage through an extension. It has a 5 star rating on chrome app store and it's been used by 100,000+ users. I had it on my browser for the last few month, although I enjoy been able to always have stuff to checkout but did feel bombarded with full screens of information, it's rather distracting.

Overall, daily.dev is an awesome tool for but personally I recommend using as a dialy news feed but not to use the extension and been slaped with news every single time you open a new tab. Happy coding! 🐱 😎
Find the Highest Altitude
Tags: leetcode, dsa, theabbie
Published: 2022-06-03 23:00:46

There is a biker going on a road trip. The road trip consists of `n + 1` points at different altitudes. The biker starts his trip on point `0` with altitude equal `0`.

You are given an integer array `gain` of length `n` where `gain[i]` is the **net gain in altitude** between points `i`​​​​​​ and `i + 1` for all (`0 <= i < n)`. Return _the **highest altitude** of a point._

**Example 1:**

**Input:** gain = \[-5,1,5,0,-7\]
**Output:** 1
**Explanation:** The altitudes are \[0,-5,-4,1,1,-6\]. The highest is 1.

**Example 2:**

**Input:** gain = \[-4,-3,-2,-1,4,3,2\]
**Output:** 0
**Explanation:** The altitudes are \[0,-4,-7,-9,-10,-6,-3,-1\]. The highest is 0.

**Constraints:**

*   `n == gain.length`
*   `1 <= n <= 100`
*   `-100 <= gain[i] <= 100`

**SOLUTION:**

    class Solution:
        def largestAltitude(self, gain: List[int]) -> int:
            maxval = 0
            curr = 0
            for g in gain:
                curr += g
                maxval = max(maxval, curr)
            return maxval
Simplify Path
Tags: leetcode, dsa, theabbie
Published: 2022-06-03 21:00:45

Given a string `path`, which is an **absolute path** (starting with a slash `'/'`) to a file or directory in a Unix-style file system, convert it to the simplified **canonical path**.

In a Unix-style file system, a period `'.'` refers to the current directory, a double period `'..'` refers to the directory up a level, and any multiple consecutive slashes (i.e. `'//'`) are treated as a single slash `'/'`. For this problem, any other format of periods such as `'...'` are treated as file/directory names.

The **canonical path** should have the following format:

*   The path starts with a single slash `'/'`.
*   Any two directories are separated by a single slash `'/'`.
*   The path does not end with a trailing `'/'`.
*   The path only contains the directories on the path from the root directory to the target file or directory (i.e., no period `'.'` or double period `'..'`)

Return _the simplified **canonical path**_.

**Example 1:**

**Input:** path = "/home/"
**Output:** "/home"
**Explanation:** Note that there is no trailing slash after the last directory name.

**Example 2:**

**Input:** path = "/../"
**Output:** "/"
**Explanation:** Going one level up from the root directory is a no-op, as the root level is the highest level you can go.

**Example 3:**

**Input:** path = "/home//foo/"
**Output:** "/home/foo"
**Explanation:** In the canonical path, multiple consecutive slashes are replaced by a single one.

**Constraints:**

*   `1 <= path.length <= 3000`
*   `path` consists of English letters, digits, period `'.'`, slash `'/'` or `'_'`.
*   `path` is a valid absolute Unix path.

**SOLUTION:**

    class Solution:
        def simplifyPath(self, path: str) -> str:
            path += "/"
            chunk = ""
            chunks = []
            for c in path:
                if c == "/":
                    if len(chunk) > 0:
                        chunks.append(chunk)
                    chunk = ""
                else:
                    chunk += c
            curr = []
            for folder in chunks:
                if folder == "..":
                    if len(curr) > 0:
                        curr.pop()
                elif folder != ".":
                    curr.append(folder)
            return "/" + "/".join(curr)
Maximum Population Year
Tags: leetcode, dsa, theabbie
Published: 2022-06-03 22:30:36

You are given a 2D integer array `logs` where each `logs[i] = [birthi, deathi]` indicates the birth and death years of the `ith` person.

The **population** of some year `x` is the number of people alive during that year. The `ith` person is counted in year `x`'s population if `x` is in the **inclusive** range `[birthi, deathi - 1]`. Note that the person is **not** counted in the year that they die.

Return _the **earliest** year with the **maximum population**_.

**Example 1:**

**Input:** logs = \[\[1993,1999\],\[2000,2010\]\]
**Output:** 1993
**Explanation:** The maximum population is 1, and 1993 is the earliest year with this population.

**Example 2:**

**Input:** logs = \[\[1950,1961\],\[1960,1971\],\[1970,1981\]\]
**Output:** 1960
**Explanation:** 
The maximum population is 2, and it had happened in years 1960 and 1970.
The earlier year between them is 1960.

**Constraints:**

*   `1 <= logs.length <= 100`
*   `1950 <= birthi < deathi <= 2050`

**SOLUTION:**

    import bisect
    
    class Solution:
        def maximumPopulation(self, logs: List[List[int]]) -> int:
            pops = []
            for b, d in logs:
                bisect.insort(pops, (b, 1))
                bisect.insort(pops, (d, -1))
            mpop = 0
            mpopyear = None
            curr = 0
            for year, p in pops:
                curr += p
                if curr > mpop:
                    mpop = curr
                    mpopyear = year
            return mpopyear
Number of Steps to Reduce a Number to Zero
Tags: leetcode, dsa, theabbie
Published: 2022-06-03 22:00:49

Given an integer `num`, return _the number of steps to reduce it to zero_.

In one step, if the current number is even, you have to divide it by `2`, otherwise, you have to subtract `1` from it.

**Example 1:**

**Input:** num = 14
**Output:** 6
**Explanation:** 
Step 1) 14 is even; divide by 2 and obtain 7. 
Step 2) 7 is odd; subtract 1 and obtain 6.
Step 3) 6 is even; divide by 2 and obtain 3. 
Step 4) 3 is odd; subtract 1 and obtain 2. 
Step 5) 2 is even; divide by 2 and obtain 1. 
Step 6) 1 is odd; subtract 1 and obtain 0.

**Example 2:**

**Input:** num = 8
**Output:** 4
**Explanation:** 
Step 1) 8 is even; divide by 2 and obtain 4. 
Step 2) 4 is even; divide by 2 and obtain 2. 
Step 3) 2 is even; divide by 2 and obtain 1. 
Step 4) 1 is odd; subtract 1 and obtain 0.

**Example 3:**

**Input:** num = 123
**Output:** 12

**Constraints:**

*   `0 <= num <= 106`

**SOLUTION:**

    class Solution:
        def numberOfSteps(self, num: int) -> int:
            steps = 0
            while num > 0:
                if num & 1:
                    num = (num - 1) // 2
                    steps += 1 if num == 0 else 2
                else:
                    num = num // 2
                    steps += 1
            return steps
"Connect Card" Semi-Casual, Semi-Professional
Tags: ux, frontend, design, ui
Published: 2022-06-03 21:57:05

<center>

Nothing new or exciting here.
</center>


Hi again!

I shared this in my last post (my first post), but I wanted to highlight it here.

I was creating a User Persona for a UX Class as part of my BS, Software Development program at Western Governors University (WGU).

In the process of this, I tinkered with the idea of creating an actual 'Persona' profile for myself.

I'm pretty pleased with how it turned out.
What do you all think? Is it ambiguous, or kinda weird?
Or do you think more people should be doing this?

I'm interested to hear what Devs think!

<center>
{% embed https://drive.google.com/file/d/1LhBeF6n5yGbXqhwIh53Uf93CRuY74BWo/view?usp=sharing %}

<a href="https://github.com/JackTNeely/ConnectCard/blob/main/JackTNeelyConnectCard.pdf" target="_blank">On GitHub</a>



</center>




psst... I stole this from a template. You, too, can easily make one of these with minimal effort with a little bit of Google-fu! (along with a smidge of self-grandeur)


Rate 1 - 5 out of 10
VIDEO: How to modularize your monolith frontend
Tags: webdev, javascript, microservices, beginners
Published: 2022-06-03 21:55:56

In early June, we wrapped up our second Discord Live session. And we should report it was a success.  

As we continue to show the world how useful micro frontends are, we decided to begin from the usual starting point: Going from a monolith to a more modular approach. In our livestream, we demonstrated exactly how to do so.  

Here’s our visual representation of how fully modular micro frontends look to Fathym:  


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

When you modularize your monolith with Fathym, to the end user, all of the routes (pricing, docs etc.) seem as if everything is written in the same framework. But, the end user doesn’t know if it’s React, Angular etc. That opens up possibilities for the developer to use new technologies and better fits depending on what is needed for each page/app. 

If you're still using a monolith and you host with Fathym, you can start by breaking out one, single page at a time. That allows you to start small and continue down the path to modularization at your own pace. And this video shows just how to do it: 

<iframe width="560" height="315" src="https://www.youtube.com/embed/xqifvcZTXec" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> 

For more reading on the topic, check out our [Modularize your monolith frontend blog here.](https://www.fathym.com/blog/articles/2022/may/2022-05-31-modularize-your-monolith-one-page) And be sure to [sign up for a free account](https://www.fathym.com/dashboard) to start using our micro frontends today.
Get out of web bubble and learn this to increase your level as developer!!!⬇️
Tags: webdev, networking, systems
Published: 2022-06-03 21:40:24

Web development has become very popular last years. And it becomes more complex every year. And you only don't have to learn web technologies like frameworks, libraries, runtime environments, etc.

In this post, I would like to share what knowledge that is not related to web technologies I think could be important to learn.

## Computer Engineering Basics
I'm not talking about deep knowledge of how computers works. But, it is a good idea to learn even superficially understand how computers process and share information.
- What is a **bit**, **byte**, etc.
- Von Neumann architecture.
- Computer hardware, specially types of storage: HDD, SSD, NVMe, etc.

## Networking
Web development is based on network services, and if you don't have a minimum knowledge about networking and distributed services, it could be difficult for you to understand how backend and frontend communicate between them.
- **TCP/IP** model.
- Types of networks: **LAN**, **MAN**, **WAN**.
- How data is sent across devices and networks.
- **HTTP** protocol.

## Operating system administration
When you have your web pages created, you need a hosting. Normally hostings have UNIX based OS, Linux is the most popular. So you have to understand how OS works to set up your hosting. And when you make more complex apps, you probably want to set more specific tools and configurations.
- **Folder structure**.
- User administration.
- Software management.
- **Remote connection**.

## Other things to learn
Also, if you want to be a web developer, you have to have some skills that are not technical skills.
- UI design.
- Communication.
- Writing.
- Basic cybersecurity.

I hope that it was interesting and helpful. If you want to know more about me, you can find me as @4strodev in all social networks.
Balanced Binary Tree
Tags: leetcode, dsa, theabbie
Published: 2022-06-03 21:30:40

Given a binary tree, determine if it is height-balanced.

For this problem, a height-balanced binary tree is defined as:

> a binary tree in which the left and right subtrees of _every_ node differ in height by no more than 1.

**Example 1:**

![](https://assets.leetcode.com/uploads/2020/10/06/balance_1.jpg)

**Input:** root = \[3,9,20,null,null,15,7\]
**Output:** true

**Example 2:**

![](https://assets.leetcode.com/uploads/2020/10/06/balance_2.jpg)

**Input:** root = \[1,2,2,3,3,null,null,4,4\]
**Output:** false

**Example 3:**

**Input:** root = \[\]
**Output:** true

**Constraints:**

*   The number of nodes in the tree is in the range `[0, 5000]`.
*   `-104 <= Node.val <= 104`

**SOLUTION:**

    # Definition for a binary tree node.
    # class TreeNode:
    #     def __init__(self, val=0, left=None, right=None):
    #         self.val = val
    #         self.left = left
    #         self.right = right
    class Solution:
        def getHeight(self, root):
            if root:
                a = self.getHeight(root.left)
                b = self.getHeight(root.right)
                return 1 + max(a, b)
            return -1
        
        def isBalanced(self, root: Optional[TreeNode]) -> bool:
            if root:
                a = self.getHeight(root.left)
                b = self.getHeight(root.right)
                if abs(a - b) <= 1 and self.isBalanced(root.left) and self.isBalanced(root.right):
                    return True
                return False
            else:
                return True
Write an API patch route in Sinatra
Published: 2022-06-03 20:49:28

While learning to write Sinatra API routes, the PATCH route was the most confusing for me. If you're in the same boat, the following 5 steps should help. 

Before we start, you need to make a ruby file called "application_controller.rb" in app/controllers.

First: In the new file declare the class ApplicationController.

```
class ApplicationController < Sinatra::Base

end
```
Second: Write the method "patch" 
Add the model where the instance you're changing lives.
Add "/:id" to the end.

```
class ApplicationController < Sinatra::Base

patch "/table/:id" do

end

end
```
Third: Use find() and the params id to locate the instance in the model, and declare a variable with it.

```
class ApplicationController < Sinatra::Base

patch "/desiredtable/:id" do
desiredRecord = DesiredModel.find(params[:id])
end

end
```

Fourth: Now, we'll update this variable's attribute. 
Update it with the value we pull from the params. 

```
class ApplicationController < Sinatra::Base

patch "/desiredtable/:id" do
desiredRecord = DesiredModel.find(params[:id])
desiredRecord.update(attribute: params[:attribute])
end

end
```
Fifth: (last but certainly not least) Convert the variable to JSON.

```
class ApplicationController < Sinatra::Base

patch "/desiredtable/:id" do
desiredRecord = DesiredModel.find(params[:id])
desiredRecord.update(attribute: params[:attribute])
desiredRecord.to_json
end

end
``` 
Done!
Best way for argument parsing in bash
Published: 2022-06-03 20:14:31

What is the better solution for input parsing and script management?

Both of the features are accomplished by modern languages. Just think about it, in node, .net, or PHP, you have a repository of packages and you can download executables that the package manager installs in your local. This way, content can be used to share the programs you have created with others using the public or private repository.

All those languages offer (directly or using easy-to-integrate libraries) a way to freely build the information about the console commands and the options listing. Moreover, that solution also resolves the argument parsing issue. But what about bash?

In this article, we will discover Bashy, a tool written in Go that aims to solve all these issues by empowering BASH scripts to parse arguments using declarative manifest and script sharing.
[Read the article](https://betterprogramming.pub/effective-bash-scripts-108d976026bc?sk=d37b5cfb7891549245375b8964c8fdc6)