teleren/devto huggingface dataset:
Techpro.club GitHub issues(hacktoberfest)
Tags: programming, hacktoberfest, opensource
Published: 2022-10-01 08:10:13

Prior to listing techpro.club to hacktoberfest, here is a list of issues you can work on, feel free to make some pull requests.

1.https://github.com/ClubTechPro/techpro.club/issues/89
-1 like counts on a post in feeds

2.https://github.com/ClubTechPro/techpro.club/issues/92
Accounts without a profile avatar and name in GitHub breaks 

3.https://github.com/ClubTechPro/techpro.club/issues/93
LinkedIn profile integration

4.https://github.com/ClubTechPro/techpro.club/issues/94
Order of feeds

5..https://github.com/ClubTechPro/techpro.club/issues/96
Projects link broken from notifications 

6..https://github.com/ClubTechPro/techpro.club/issues/109
Golang installation documentation

7..https://github.com/ClubTechPro/techpro.club/issues/111
Contact us form

8..https://github.com/ClubTechPro/techpro.club/issues/112
Add social links on the footer and contact us page

9.https://github.com/ClubTechPro/techpro.club/issues/113
Replace "About us" images in Html

10.https://github.com/ClubTechPro/techpro.club/issues/114
Remove .DS_store file from all folders

Here are issues available for the hacktoberfest event, we'll love to see what you come up with, Feel free to hit a star, and join our projects on our GitHub page, happy hacking.
Today's Fun Joke For Developers - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes
Published: 2022-10-01 08:00:16

---
title: "Today's Fun Joke For Developers - Daily Developer Jokes"
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/5e1258c78158d.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:
I never tell the same joke twice

I have a DRY sense of humor.
 -->
Creating custom entities in medusa
Tags: javascript, webdev, beginners
Published: 2022-10-01 07:48:51

In the previous article, we first looked at [creating a custom entity with medusa-extender](https://daily-dev-tips.com/posts/medusa-extender-custom-entity/).
This is a super quick way to do it, but something else we can do is create this custom entity directly with medusa.

In this article, I'll show you how to achieve the same effect in medusa itself.

## Creating an entity in medusa

First, we have to create a new folder called `models` in our `src` directory.

There, create the `post.ts` file, which will become our new entity.
The file itself will look like this:

```js
import { BeforeInsert, Column, Entity, PrimaryColumn } from "typeorm";
import { BaseEntity} from "@medusajs/medusa";
import { generateEntityId } from "@medusajs/medusa/dist/utils"

@Entity()
export class Post extends BaseEntity {
    @Column({type: 'varchar'})
    name: string | null;

    @BeforeInsert()
    private beforeInsert(): void {
        this.id = generateEntityId(this.id, "post")
    }
}
```

Here we say it should extend the medusa base entity. (You can also pick `SoftDeletableEntity`)
And always generate a random ID on creation.

Now we can generate a new migration by running the following command in your terminal.

```bash
npx typeorm migration:create -n Post --dir src/migrations
```

Add the following format for the `up` and `down` functions inside the migration file.

```js
public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
        `CREATE TABLE IF NOT EXISTS "post" (
            "id" character varying NOT NULL,
            "name" character varying NOT NULL,
            "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
            "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
        )`
    )
    await queryRunner.createPrimaryKey("post", ["id"])
}

public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.dropTable("post", true)
}
```

This is a default TypeORM migration, and you can find a lot of information about these commands on [their website](https://typeorm.io/migrations#generating-migrations).

Next up, we'll have to run the migration.
Before we do that, ensure you build the latest version with: `npm run build` and then execute the migrations.

```bash
medusa migrations run
```

It should say that the new migration has been executed, and you should be able to see it in your database now.

![Post table in medusa](https://cdn.hashnode.com/res/hashnode/image/upload/v1663738023901/rEFTkF-4U.png)

As you can see, it's super similar to how it works with medusa-extender.
And it all comes down to preference.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Today I learned - Problem Solving Skills
Tags: programming, problemsolving, angular, frontend
Published: 2022-10-01 07:37:08

### 효율적인 문제해결 과정이란 무엇일까?

흔히 말하는 "삽질"을 줄이고 눈 앞에 닥친 문제를 어떻게 하면 빨리 해결할 수 있는지 현업에서 겪은 일을 통해 깨달은 3가지 방법을 소개하려고 한다.

 최근 dropdown typeahead 기능을 구현하는 작업을 했다. 부모 component로 부터 option값들을 전달받아야 했는데, object로 부터 빈 array만 받아오는 것이었다.

 빈 값만 전달받기 때문에 dropdown에 뿌려줄 목록은 안나오는 상황이었고, 그 부분에서 막혀 계속 헤매고 있었다. 답답해서 시니어 개발자 분께 여쭤보니 일단 모든 곳에 로그를 찍어보라고 하셨다.

 문제 원인은 생각보다 너무 단순했다. **value change 이벤트를 받을 때 값이 변경**되기 때문에 그 때 option 값들을 할당해주면 되는데, **component가 init 될 때만 값을 받아와서** 당연히 빈 값만 셋팅 되었던 거였다.

 첫번째 depth에서 선택한 값에 따라 2depth, 3depth의 dropdown 옵션들이 달라지는 로직이기 때문에 이벤트가 어디서 오는지 파악하고, **로그만 찍어봤어도 바로 해결**되었을 문제...!!

이 사건으로 깨달은 나의 개선해야할 점을 정리해 봤다.

> 1. 막연한 가정하지 않기
> 2. 일단 모르겠으면, console log 찍어보기
> 3. 다른 사람이 작성한 코드를 참고할 땐, 제대로 분석하고 그 흐름을 이해해서 필요에 맞게 쓰기

#### 1. 막연한 가정하지 않기
 이 상황에선 이렇게 데이터가 출력되겠지, 여기선 아직 데이터 set 안됐겠지 등 암묵적으로 가정하고 문제를 해결하려고 했기 때문에 삽질한 시간이 더 길어졌다.


#### 2. 일단 모르겠으면, console log 찍어보기
 옆자리 시니어 개발자 분께서 제일 강조하신 말씀이다..ㅎㅎㅎ "막연한 가정하지 않기" 와 이어지는 부분으로, 일단 log를 찍어보고 데이터의 흐름을 파악하는게 중요하다고 말씀하셨다.

#### 3. 다른 사람이 작성한 코드를 참고할 땐, 제대로 분석하고 그 흐름을 이해해서 필요에 맞게 쓰기

 이번에 작업한 부분은 [formly](https://formly.dev/)라는 라이브러리로, JSON 데이터를 인식해 form UI 형태로 만들어주는 걸 사용중이었다. formly에서 typeahead가 가능한 dropdown을 구현하기 위해 [해당 코드](https://stackblitz.com/edit/angular-ngx-formly?file=app%2Fapp.component.ts)를 참고해서 적용했다. 

 RxJs의 Subject와 Observable을 변수로 이용해서 사용하는데, 사실 동작하는데만 초점을 맞추고 그냥 아무 생각없이 가져와서 어떻게든 우리 코드에 우겨넣으려고(?)했던 것 같다.
 참고한 코드를 분석해서 왜 이건 이런식으로 썼을지 고민은 하지 않고 기능을 구현하는데 급급했다. 

 이런 부분에서 약간 꾸지람을 들었다.😅😅 (동작 원리를 제대로 파악하고 있지 않는데 어떻게 활용해서 그 코드를 쓸 수 있겠냐고...)



 주니어 개발자로서, 매 순간 과정에서 배워야 할 점이 생긴다. 이번에 깨달은 문제 해결 방법 3가지를 새기면서, 앞으로는 같은 문제가 생겨도 더 쉽게 접근하고 해결할 수 있기를 바래본다.
Hacktoberfest: let's contribute to my project offline-docs
Tags: hacktoberfest, documentation, beginners, webdev
Published: 2022-10-01 07:07:50

## What is it?

[Offline-docs](https://github.com/naveennamani/offline-docs) is a repository with a collection of scripts to generate offline documentation for many open-source projects. It's been a while I introduced this project in my [earlier post](https://dev.to/naveennamani/introducing-offline-docs-collection-of-scripts-to-generate-offline-documentation-of-open-source-projects-1l7h). Since then, I kept adding more and more projects to the repo and now it contains more than 50 scripts.

This hacktoberfest let us make this project even more useful by contributing your valuable time and efforts. This post describes many ways in which you can make code and non-code contributions. But first, let me explain quickly how the project is organized.

## Show me the code

{% embed https://github.com/naveennamani/offline-docs %}

### Setup

This project uses yaml files for storing data related to each project. The projects are grouped into project groups based on the common theme. This project uses node.js to handle these yaml files and to automatically and consistently generate README.md file.

So, before contributing anything, first install all dependencies by running `npm run install`.

## Contributing to the project

### Adding a new project

For adding a new project or project group a script `cli.js` is provided. When you run the script, it asks for the required information and stores them in yaml files and updates the README. The `git clone ... & cd dir` commands will be added by the script. So, only enter the required commands to be run after cloning the repository.

> When in doubt, run the script and look at the generated readme file.

### Modifying/updating an existing project

For modifying details of any existing project, modify appropriate yaml file in `projects` folder and then run `index.js` script to format the yaml files and to update the README.md file with the changes.

## Non-code contributions

### Testing the scripts

As the source code of the project changes, sometimes we may need to update the scripts. That is why last tested details are given for each project. If you happen to be testing the script and it worked, you can update the last tested date.

> To limit the possibility of simply updating the date without actually testing, you are required to post a screenshot in the PR request comments showing that you are able to access it offline.

### Request more projects

If you require scripts for any project that you want to generate offline documentation for, you can add them in the TODO.md file with following details

* Website URL
* Source code repo for the project
* Any commands that you've already tried (optional)

The source code repo URL is required and it shows that you've done your own research.

## Other contributions

You can follow the issues and can work on them if interested. But please let me know before you start working on it, so another person may not waste their time.

Looking forward for your contributions :)
Listing techproclub to hacktoberfest
Tags: hacktoberfest, opensource, programming, go
Published: 2022-10-01 06:16:26

**Introduction**.
It's that season again when open source projects and communities are at their peak. Yes, that's right, it's hacktoberfest season, and this year techpro.club will be listed among the projects to be worked on.

**What is hacktoberfest?**
Hacktoberfest is a yearly event organized by digital ocean that happens every October to give all range of programmers, beginners to professionals the opportunity to join open source communities and contribute to open source projects, this will help start-ups and those that create projects progress faster as well as a good opportunity to learn for beginners. This is a good opportunity for freshers since they will get more experience and be able to add it to their portfolios.

**What is techproclub?**
Techpro.club is a platform that encourages contribution to open source projects for freshers and beginners which guides them on a programming path and helps them gain experience along the way. They get to collaborate with people early in their careers and improve their programming skills. This platform also helps beginners integrate useful links(GitHub, LinkedIn, StackOverflow, and so on) all into one place and help build a better portfolio.

**How to get ready for this event?**
The event will begin on October first and end on October 31st.

**Link to hacktoberfest**
https://hacktoberfest.com/

**How to register**
Registration will begin on the 26th of September, here's a link on how to do so.
https://hacktoberfest.com/participation/

**How to contribute.**
After registering on Octoberfest, here's how to begin contributing to techpro.club.
https://github.com/ClubTechPro/techpro.club/blob/master/Readme.md

**What languages are going to be used?**
We use the following languages to code our platform:
Golang
Bootstrap
MongoDB 
Aws ses

**What issues are available?**
We will give a list of issues on GitHub that you can fix. These will be available soon so everyone has a fair chance at working on them.

**What will you get in return?**
-Listing your name in Github contributors: Your name will be listed among the contributors who helped make and develop the site and you'll be able to add it to your portfolio. 

-Special mention in Techpro.club website: Your name will be mentioned on the website as a contributor. 

-Gain knowledge and experience: You'll get first-hand experience in collaboration and working on open source communities which will further your knowledge and understanding of the programming language.

**Conclusion.**
We are excited to partake in this event and can't wait to see what all will come up with, see you there this October, you can read more on techpro.club and its aims and vision at their GitHub page on the Read.me files. Happy hacking.
Link to GitHub page:https://github.com/ClubTechPro/techpro.club.
This week’s newsletter is out! (01-10-2022) - Hopeless in HCMC
Tags: javascript, tech, webdev
Published: 2022-10-01 05:55:52

---
title: This week’s newsletter is out! (01-10-2022) - Hopeless in HCMC
published: true
description: Another week of great javascript, tech and web development links.
tags: javascript, tech, webdev, discuss
---

Hopeless in HCMC

https://markjgsmith.substack.com/p/mark-smiths-newsletter-01-10-2022

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
Gotchas when building GitHub self-hosted runners with AWS official AMIs/container images for Python apps
Tags: github, selfhostedrunner, aws, python
Published: 2022-10-01 05:54:45

The following are some gotchas when setting up specific Python versions on GitHub self-hosted runners which are based on AWS official AMIs and container images.

1. Official Amazon Linux 2 AMI and official Amazon Linux 2 container image do not have the same Python runtimes setup.
    - Amazon Linux 2 AMI ([ECS-optimized AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) `/aws/service/ecs/optimized-ami/amazon-linux-2/recommended`) has `python2.7` and `python3.7` by default. 
    - Amazon Linux 2 container image [amazonlinux/amazonlinux](https://gallery.ecr.aws/amazonlinux/amazonlinux) (`public.ecr.aws/amazonlinux/amazonlinux`) has only `python2.7`; it does not have `python3`/`pip` installed by default.

2. Amazon Linux 2 AMI has `python3` pointed to `python3.7` by default. When changing `python3` to point to other Python3 version (e.g. setting `update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1`), it may break `cfn-signal` so no signal will be sent to ASG at EC2 launch (i.e. no healthy instances will be registered).
Note that this will be an issue if you use ASG for the runners (not ECS Fargate).

3. Keep `python` to point to `python2.7`, as `yum` does not support Python3. You will see this error if setting `python` to point to Python3:
    ```
> yum
  File "/usr/bin/yum", line 30
   except KeyboardInterrupt, e:
                           ^
SyntaxError: invalid syntax
    ```
    See also https://stackoverflow.com/questions/11213520/yum-crashed-with-keyboard-interrupt-error.

4. `actions/setup-python@v4` does not support `arm64` (https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json).
See related Open issue https://github.com/actions/setup-python/issues/108.


Note: (3) and (4) are not Amazon Linux specific. Just issues experienced when building the Amazon official image based self-hosted runners.
First project
Published: 2022-10-01 04:41:34

#project1
From today, I will post my work here. I will be glade if you rate them)

It is my first adaptive website.
It is the link of the website 👇 (https://myfirstaw.netlify.app)

Do you have any feedback? If you have, I am ready to read them. 

Support me with ⭐️ in GitHub if you can.
Link to my GitHub account 👇
https://github.com/Abdulvohid0107

#najottalim #js #javascript #programming #github
91. Leetcode solution in Javascript
Tags: javascript
Published: 2022-10-01 03:36:30

```javascript

/**
 * @param {string} s
 * @return {number}
 */
var numDecodings = function(s) {
    if (s.length === 0) return 0;
    var dp = [1];
    s[0] === '0' ? dp[1] = 0 : dp[1] = 1;

    for (var i = 2; i <= s.length; i++) {
        var prevTwo = parseInt(s.substring(i - 2, i));
        dp[i] = 0;
        if (s[i - 1] !== '0') dp[i] = dp[i - 1];
        if (prevTwo >= 10 && prevTwo <= 26 ) dp[i] += dp[i - 2];
    }

    return dp[s.length];
};

```

#Leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/decode-ways/
Vim
Published: 2022-10-01 03:33:30

A.Understanding 

 Vim is a computer program that is used to write text (text editor) the same as the program above. 
 Vim stands for Vi iMproved which was first released in 1991.Vim is an existing ediotor called vi that adds a variety of new features (note again that it stands for vim). Vi itself been around since 1972.

B.How to install vim

1.Go to terminal then run the command 
- _yum -y install vim_
- _vim_

2.Here in the terminal will appear about vim. 

3.If it is out. Please type **:q** and **enter**.Done, vim is installed. 

C.Navigasi

 Navigatung through text is a necessary function. With vim, there are two ways you can navigate the text you are editing:by using the arrow keys, or by using the **HLKJ** key. 
- **H** - left
 _To move the cursor to left_
- **L** - right 
_To move the cursor to right_
- **K** - up
_To move the cursor to up_
- **J** - back
_To move the cursor to up_

D.Command vim

1.create a new file 
**Vim test.txt**

2.Doing editing
press **i** key on keyboard then the insert description will appear automatically then press the **Esc** key to exit Insert mode

3.Remove text block in vim
press the **V** key (automatically insert visual description) then press the **shift key + down arrow,** to delete press the **x** or **d** key

4.Save and exit editing
**:w**
To save
**:q**
Exit vim text editor
**:wq**
Save and exit at the same time. 
Note: if you get a Readonly message when exiting, you can save it or force it out with the command to add a **!**
**:w!**
**:q!**
**:wq!**
Merging parallel branches without PRs in GitHub
Published: 2022-10-01 03:27:19

For week 4 of my course in open-source development, I was tasked with adding two more features to my ssg project [rost_gen](https://github.com/Eakam1007/rost_gen). However, I was supposed to work on both at the same time on different branches and merge those branches into the main branch once both implementations were complete. Normally, I would use pull requests and not merge directly into the main branch.

I created two issues to [add an option flag to specify the language of the generated html document](https://github.com/Eakam1007/rost_gen/issues/30), and to [parse '---' markdown as a thematic break (horizontal rule or `<hr>` tag)](https://github.com/Eakam1007/rost_gen/issues/31). After creating the branches for these issues through the UI on the issues page, I started working on implementing the new features. 

Prior to this, I was parsing command line arguments manually using if statements. So, this also allowed me to address another [issue](https://github.com/Eakam1007/rost_gen/issues/23) to use [clap](https://crates.io/crates/clap) for argument parsing. I was surprised by how much I was able to simplify my program by using clap to define the same logic. And once that was done, adding support for another flag was rather easy.

Further, adding support for parsing thematic breaks/horizontal rule markdown was even simpler. Since there was existing support for Heading 1 markdown (`<h1>` tags), all I had to do was add an else statement to check for the new markdown rule.

However, I discovered some unrelated bugs while testing my changes. Apparently I had previously forgotten to check if the specified output directory already contains a file with the same name as an input file. As a result, the generated html gets appended to the end of the existing file instead of overwriting existing content. I also found that the title parsing logic causes a blank line to be added to the title. Since these were unrelated to my changes, I created two more [issues](https://github.com/Eakam1007/rost_gen/issues?q=is%3Aopen+is%3Aissue) to fix them later.

Finally, it was time to merge my changes into the main branch. As expected, the first branch was merged smoothly (fast-forward merge). I was expecting to run into some conflicts when merging the second branch but it turns out there was no code overlap between the two and git automatically merged them (ort strategy) with the [default merge message](https://github.com/Eakam1007/rost_gen/commit/f701e109cd3ecf7d34f8f05c78290cb5f266fa55).

Even though this process went smoothly, I found it difficult to go through the commit history. Since I tend to commit small changes, I end up with multiple commits for adding a single feature. Usually, I would use pull requests so I can squash and merge before merging. Then, I can look for the PR merge commits and read the description to quickly see what was changed. Also, I do not need to manually close the issues if I link them in the PRs.
WSL. A Linux killer?
Tags: linux, wsl, windows, devjournal
Published: 2022-10-01 02:39:46

## BackGround
My first laptop at college was a pretty low spec (I had no other option). It had an intel i3 4th gen processor and 4 Gb RAM (Ouch!) with Windows. In the beginning, it was smooth (sort of), but had no trouble. Then as the days passed the machine became very sluggish, like booting it up took a millennium. Then I got into programming and found Linux. I dual-booted my laptop with Ubuntu and it was a breath of fresh air. It was not lagging and it was pretty snappy. As days went on I learned more about Linux and the various distros, then I erased the drive and installed PopOs. Everything was going well. 

## Renaissance
Then I decided to go for my master's. Finally, I decided to get a new laptop, with better specs. I went for Ryzen 7 5800H, RTX 3050Ti, 16 GB DDR4 RAM, and 512 GB NVMe SSD. As a Linux lover, I wanted to install a new distro on my new machine. I tried distro after distro with the bootable USB drive, and there were always some critical issues. The most crucial issue was I can not find WiFi drivers. I know that somewhere on the internet I can find it, but it takes a lot of time.

## Found It!
While I was into researching Linux, I came across WSL (Windows Subsystem for Linux). In a nutshell, WSL allows you to run Linux in Windows! It is in version 2 now. As we all know the heart of Linux is the command line. If you ask me the command line makes Linux, Linux. It took some time to install it, but Microsoft has good installation documentation, and Voila you got Linux in Windows.

## Nice
Still, I hate some of the annoyance of Windows, but I don’t miss anything big from Linux. It has good support from a lot of dev tools. VS Code runs well, Docker runs well, and more than that Nvidia drivers work well. People who try to install Nvidia drivers on a Linux machine know the pain of installing Nvidia drivers. After using it for over a year I don’t feel like missing Linux.

## Linux In Windows kills Linux?
As we all know developers are the ones who use Linux most of the time. I know devs who dual boot their machine with Windows and Linux because they need some apps like PhotoShop to edit images for their websites. Shut it down and boot Linux to get the dev work done and then find out that the image has the wrong dimension. Again shut it down boot Windows and repeat the process an infinite number of times. WSL completely solves this issue. Yes, there might be some performance issue, but I never noticed it.

Also in the latest major update, you can even run some of the Linux GUI applications as well. What more do you need?

## Thoughts
In terms of use, I don’t think there are any significant drawbacks to using WSL. What do you guys think?