teleren/devto huggingface dataset:
Daily.Dev - Bookmarks to Twitter Tool
Tags: javascript, showdev, productivity, opensource
Published: 2022-03-16 14:25:26

Hello guys, have been developing for my submission for **Daily.Dev 's Hackathon 2022** (more info [here](https://github.com/dailydotdev/hackathon-participants-March-2022))

## [UPDATE] Won Runners Up in Hackathon !🎉

My submission is a tool that you can visit [here](https://bit.ly/dailydevhackathonsubmission), which will allow a user to send **a scheduled tweet** every week on a particular time with the articles he has **bookmarked on daily.dev** over the past 7 days for your Twitter followers.

As simple as that. A video demonstrating the same is below:
{% embed https://www.youtube.com/watch?v=TywXBNVEKLg %}

This idea can be applied to many platforms, like sending **an email newsletter** with your **favourite bookmarked articles** to your subscribers.
There can be many enhancements that can be done to the above application such as **sending a tweet as soon as you bookmarked** it, **Integrating many social platforms** and scheduling the post on every platform at a scheduled time, etc.

This is a simple tool that can be great if you want to automate the task of sharing your favourite articles every week.

I have also made it open-source, you can find it here
{% embed https://github.com/mtwn105/dailydev-rss-to-twitter-weekly-bookmarks %}
You need to use Git worktree
Tags: git
Published: 2022-03-16 14:03:44

---
title: "You need to use Git worktree"
published: true
description: A basic guide on why and how to use Git worktree feature.
tags:
  - git
cover_image: https://strdr4605.com/you-need-to-use-git-worktree.jpg
canonical_url: https://strdr4605.com/you-need-to-use-git-worktree
---

Recently I found `git worktree` feature and I plan to use it in all my projects.
Here is why and how you can use it.

## Why

If you are working on a big project with a lot of issues and tasks, you constantly have to switch between branches to do some quick-fix changes or maybe review a PR from a teammate.
The problem is that often you have some work in progress and switching branches means that you need to commit or stash your WIP changes.
If it's only 1-2 files/changes the cost of commit/stash is not that high. But if you work on a big feature with over 9000 changes it's hard to constantly change branches.

## How

Basically `git worktree` command allows to create a new directory with desired git state.  
Actually, your current workspace is already in git worktree.  
You can type `git worktree list` and you will see one item, which is your current git workspace.

Let's say you work on a big feature in your work project.

```bash
git worktree list
~/Work/project  17d8aab [big-feature]
```

And a quick-fix needs to be done from the `origin/master`.
You can create a git worktree with the following command:

```bash
git worktree add -b quick-fix ../quickfix origin/master
```

This command will create a new directory named **quickfix** at the same level as your **project** directory.  
The branch will be `quick-fix` and it will be set at commit from `origin/master`.  
You can see your git worktree:

```bash
git worktree list
~/Work/project   17d8aab [big-feature]
~/Work/quickfix  25e6c4b [quick-fix]
```

Next, you can navigate to **quickfix** directory, do your changes, push to remote, merge.

After you are done with **quickfix** you can remove the workspace with `git worktree remove quickfix`.

## Conclusion

This approach of using git worktree is not the most elegant but it's doing the job.
I might change the workflow (using bare git repos instead of normal repos) and will update this post.
For now you may check [How to use git worktree and in a clean way](https://morgan.cugerone.com/blog/how-to-use-git-worktree-and-in-a-clean-way/).

But I suggest to play a bit with git worktree if you have problems from **Why** section. And adding this git feature to your toolkit will make you a more productive engineer.

> Let me know if you have a nice workflow for git worktree!
Nextjs theme managing with next-themes and Tailwind CSS
Tags: react, nextjs, beginners, webdev
Published: 2022-03-16 14:00:52

next-themes is a cool package that provide an easy solution to managing your website theme. Today we're going to learn how to set up next-themes to work with Tailwind CSS

## Prerequisite
- Already have some experience with Nextjs
- Already have some experience with Tailwind CSS
- Already have some experience with next-themes

## Let's Get Started!

We need to install a Next app, Tailwind CSS and next-themes.

Create a next app 
`npx create-next-app theme-example`

Install Tailwind CSS
`npm i tailwindcss postcss autoprefixer -D`

And finally next-themes
`npm i next-themes`

### Setting up next-themes

inside the `_app.js` file wrap `Component` with the `ThemeProvider` provided by next-themes.

Since we're using Tailwind CSS which uses class for styling, We need to pass `attribute="class"` for `ThemeProvider` to tell it we're using class to style the theme

```jsx
import { ThemeProvider } from "next-themes";

function App({ Component, pageProps }) {
  return (
    <ThemeProvider attribute="class">
      <Component {...pageProps} />
    </ThemeProvider>
  );
}

export default App;
```

Now we need to setup postcss and tailwind configuration for next-themes

### Setting up postcss and Tailwind CSS

- **postcss**
Create a `postcss.config.js file` file in the root directory with the following config: 
```javascript
// ./postcss.config.js
module.exports = {
  plugins:{
    tailwindcss: {},
    autoprefixer: {}
  }
};
```

-**Tailwind CSS**
Create a `tailwindcss.config.js` file in the root directory with the following config:

Note the `darkMode: class` property, This tells Tailwind CSS that we're changing the theme manually instead of relying on the system preference. 
```javascript
module.exports = {
  darkMode: "class",
  purge: ["./components/**/*.{js,ts,jsx,tsx}", "./pages/**/*.{js,ts,jsx,tsx}"],
  theme: {},
  variants: {},
  plugins:[]
};
```

We're almost done. We need a special Nextjs page called `_document.js`, This page is used to update the `<html>` and `<body>` tags. We will update the `<body>` tag.


Notice the body className styling, We can specify the styling for the body depending on the theme. 
```jsx
// ./pages/_document.js

import React from "react";
import Document, { Html, Head, Main, NextScript } from "next/document";

class SpecialDocument extends Document {
  render() {
    return (
      <Html>
        <Head />
        <body className="bg-white text-black dark:bg-black dark:text-white">
          <Main />
          <NextScript />
        </body>
      </Html>
    );
  }
}

export default SpecialDocument;
```

Aaaaand we're done! Go ahead and test it out, Pretty sure it's going to work :‑)


### Note about useTheme hook
One problem you may encounter is that `theme` returned from calling `useTheme` is undefined, If that's the case for you make sure that [the page is mounted on the client side!](https://github.com/pacocoursey/next-themes#avoid-hydration-mismatch) 


I hope this post was helpful for you, Happy Coding!
Pandas Skills Pt. 2 🐼📊📚📐
Tags: datascience, analytics, python, pandas
Published: 2022-03-16 13:40:10

Before all, [here](https://github.com/hugoestradas/Advanced-Pandas) is the link with the code of this lecture.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3f86ftjm6zudggrobo7y.jpg)


In this new installment, I will go over 2 very useful notebooks fully documented.

I specifically focused on two main, and very important topics: dealing with dates and missing values.

The two new notebooks are:

1. missing_values.ipynb
2. dealing_with_dates.ipynb

ENJOY!
4 Steps of Effective Delegation for Engineering Managers
Published: 2022-03-16 13:33:33

_The story was originally published on [Ace’s blog](https://blog.getace.io/)_. 

It cannot be overstated how critical it is for a manager to understand how to delegate. You can focus less on executing duties and more on managing and leading, when you delegate appropriately.

There are many benefits to delegating:

- First of all, it frees you up to manage and lead others, as well as take on extra projects.
- Secondly, you let the most involved and motivated employees show themselves, take additional responsibility and gain new skills.

> TIP FOR FIRST TIME MANAGERS: For super effective management of a tech team, use best tools & practices - GET them on [Ace’s site](https://www.getace.io/?utm_source=devto&utm_campaign=main_page).

To make it a win-win situation, use these [four steps of effective delegation](https://www.amazon.com/First-Time-Manager-Loren-B-Belker/dp/0814417833) for a manager:

- Analyze your current tasks. Find ones that you can delegate.
- Decide whom you could delegate it to. Select an employee with a sufficient level of competence.
- Discuss details with the employee. Explain what result you expect.
- Monitor progress.

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

During [1-on-1 meetings](https://www.getace.io/feature/meetings-1-on-1s?utm_source=devto&utm_campaign=templates_promo) with Ace, you can discuss the tasks with a ready-made agenda and make a to-do list with tasks for an employee just as you discuss them. So you don't forget anything and don't have to remember what you agreed on during the meeting.

> Get [FREE 1-on-1 MEETING TEMPLATES](https://www.getace.io/feature/meetings-1-on-1s?utm_source=devto&utm_campaign=templates_promo) from Ace. 

_The story was originally published on [Ace’s blog](https://blog.getace.io/)_.
First steps into async Python
Tags: python, todayilearned
Published: 2022-03-16 13:33:17

I'm writing this post to report my first few hours of experimentation with asynchronous Python code. I have been coding in Python for the last few years but I had no previous experience with asynchronous code besides toy problems and have been flirting with the idea of learning it for a few months.

This weekend I was looking into a few project ideas and thought it would be a good time to give it a try. I remembered a few months or years ago I watched a talk in PyCon about how Trio was the best thing since sliced bread so appeared to be a good fit.

The initial documentation was very decent. It was approachable even for a beginner which usually isn't the case. I spent 1-2 hours reading the core concepts and following the getting started. The API is very well designed. There are context managers everywhere, exception handlers considering multiple edge cases, callback entry points, robust logging. Every signal that it would be an easy experience.

Then I went back to the project that has a very simple objective: given a few sites I wanted to crawl some of their contents. I plan to use this data to explore more into other software concepts. It didn't look hard to create a small parser for each site. The first site uses incremental IDs, so I generated a list of URLs to be GET.

Then comes the first problem, Requests, the most used HTTP lib, does not support async work by default. So I was pushed into more corner case libraries... no biggie, any libraries should handle this simple use case. There even seems to exist ports of Requests to support asynchronous calls.

Asks is one of the recommended HTTP clients recommended on Trio documentation. The library has very succinct documentation. I was able to replicate the code examples provided but trying to apply a rate limiter wasn't that trivial. I was able to find an issue on Github discussing it that had some code snippet that almost worked, fiddling with it a little I was able to get it running.

Altogether I had a working solution within a few hours. But it still bothers me that fundamental things like rate limiting are not present in the documentation, only to be found partially in GitHub issues and requiring a decent amount of experimentation. The examples were too simple to be useful and since this ecosystem still has very low adoption it is harder to find runnable examples from the community.

While frameworks like Scrapy are very robust and seem to have support for asynchronous code I felt that it was too much of a dependency for such small use case. I will be looking into other libraries on the ecosystem in the next few days to see if there are better solutions. Overall, this division between async/non-async libraries is the worst point of the experience. Being unable to run the most adopted tools makes it hard to migrate code to asynchronous. It leaves a taste in the mouth that probably Python is far behind other languages that have better co-routines support like Go.
Padrão de commit (para iniciantes)
Tags: commit, git, github, programming
Published: 2022-03-16 13:18:07

![Padrão de commit (para inciantes)](https://user-images.githubusercontent.com/74930052/158368392-e8fb30c6-e476-410f-a8a1-4b6a1e1e2a13.png)

## 👀 O que é commit?

### Se você está começando agora na área pode se estranhar com algumas palavras que são usadas no mundo da programação. Mas vou tentar deixar o mais claro para ti, vamos lá? 

### Quando colocamos nosso projeto no Github, por exemplo, que é uma rede social que serve para isso, para você guardar seus códigos, você tirar da sua máquina e colocar na web, utiliza-se o GIT, que é um sistema de controle de versão - essas versões no caso, é seu projeto. Em cada versão precisamos salvar, certo? É aí que entra o commit, ela que vai guardar sua modificação e te ajudar caso você precise mais pra frente voltar no código e tentar entender o que você mesmo escreveu ahahah.

## ⚡ E porque raios tenho que padronizar isso?

### Hoje como iniciante, podemos não ver a importância disso mas, sempre é bom já comerçamos a praticar boas práticas o quanto antes. Quando você começar a trabalhar em uma equipe numa empresa, cada pessoa vai ficar responsável por alguma coisa num mesmo projeto, já pensou se alguém faz alguma modificação e você quer entender o que ela fez e não não sabe por onde começar? Com os commits padronizados você consegue navegar por essas modificações e faz o trabalho ser mais produtivo e, você já sabe que se tem uma coisa que dev não gosta de perder tempo!

## Outros pontos que são importantes ressaltar!

### - [X] Quando alguém for querer fazer uma contribuição no seu projeto, quanto mais claro ele for, melhor será para a pessoa que quer contribuir.

### - [X] A [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) recomenda realizar commits específicos para ajudar nas correções.

### - [X] Com o padrão, torna- se mais fácil a manutenção do código mais pra frente.

## 👣 Hora de pôr a mão na massa!

### Essas são os principais tipos que o [Angular Commit Message Guidelines](https://gist.github.com/brianclements/841ea7bffdb01346392c) recomenda:


### 1. `docs`: Se mudar algo na documentação.
### 2. `feat`: Adicionou alguma funcionalidade? Esse é o ideal! 
### 3. `fix`: Quando você finalmente consertar aquele bug;
### 4. `perf`: Deu aquela melhorada no desempenho? Use esse!;
### 5. `refactor`: Qualquer mudança que tenha sido feita no código que não alterou a funcionalidade;
### 6. `style`: Mudanças na formatação do próprio código, como por exemplo, um espaço em branco, formatação…

## 🧾 Exemplo:

![image](https://user-images.githubusercontent.com/74930052/158369526-550a42e6-afbf-4564-a541-ac90f2ec98f9.png)

## 🦾 Só pra não esquecer:

### Agora você já sabe o que é um commit, a importância de padronizá-los e como fazer isso. Use esse conhecimento da melhor forma, pequeno gafanhoto(a)! 

## Quer saber mais? Cola aqui na [documentação oficial](https://www.conventionalcommits.org/en/v1.0.0/) e bora codar!🏳

### Feito com ❤ por [Nycole](https://github.com/nycolexavier)
Code Smell | Shotgun surgery
Tags: codequality, refactorit
Published: 2022-03-16 13:10:40

Hello, today we are back with the code smells refactoring series and in this case we are going to talk about code smell called `Shotgun Surgery`, **this smell can be detected if making a change have to replicate this change in different parts of our code**

___

## Cause

**A single responsibility has been split up among a large number of sites**. This can happen after the overzealous application of [Divergent Change](https://refactoring.guru/es/smells/divergent-change)

___

## Example

We can see that the minimum balance check is being **duplicated in both methods**

```ts
class Account {
  private amount: number;

  constructor(amount: number) {
    this.amount = amount;
    
    //...
  }
  
 debit(debitAmount: number): void {
    if (this.amount <= 1000) {
      throw new Error('Minimum balance should be over 1000');
    }

    //...
  }

  transfer(from: Account, to: Account, transferAmount: number): void {
    if (from.amount <= 1000) {
      throw new Error('Minimum balance should be over 1000');
    }

    //...
  }
}

```

___

## Solution

**Extract minimum balance checks to method** to be able to reuse it in the different methods of the class

```ts
class Account {
  private amount: number;

  constructor(amount: number) {
    this.amount = amount;
    
    //...
  }

  assertMinimumBalance(amount: number): void {
    const MINIMUM_AMOUNT = 1000;

    if (amount <= MINIMUM_AMOUNT) {
      throw new Error(`Minimum balance should be over ${MINIMUM_AMOUNT}`);
    }
  }
  
  debit(debitAmount: number): void {
    this.assertMinimumBalance(this.amount);

    //...
  }

  transfer(from: Account, to: Account, transferAmount: number): void {
    this.assertMinimumBalance(from.amount);

    //...
  }
}
```
___

## Bonus track

### Shotgun surgery in CSS? 🤔

Yes, see the next example:

```css
.button-primary {
  background-color: #ec407a;
}

.button-secondary {
  background-color: #b4004e;
}

.navbar-primary {
  background-color: #ec407a;
}

.navbar-secondary {
  background-color: #b4004e;
}
```

If now they ask us to modify the primary color for another, what is the solution? Search globally in all our CSS and replace it? **NOOO!!** ⛔️

#### The solution is use CSS variables:

We can declare variables in CSS globally with the pseudo-class ``:root`` and thus use them in any part of our CSS, in this way we centralize the possible changes in only the variables, thus avoiding having to replace each color value

```css

:root {
  --primary-background: #ec407a;
  --secondary-background: #b4004e;
}

.button-primary {
  background-color: var(--primary-background);
}

.button-secondary {
  background-color: var(--secondary-background);
}

.navbar-primary {
  background-color: var(--primary-background);
}

.navbar-secondary {
  background-color: var(--secondary-background);
}
```

___

Thanks for reading me 😊

![thanks](https://media.giphy.com/media/6A5aeKoUiIH7DwbR3R/giphy.gif)
#Event – Introducción a GitHub con Visual Studio @Code online desde @msftreactor
Tags: englishpost, event, github, microsoftreactor
Published: 2022-03-16 19:30:51

---
title: #Event – Introducción a GitHub con Visual Studio @Code online desde @msftreactor
published: true
date: 2022-03-16 13:00:00 UTC
tags: EnglishPost,Event,GitHub,MicrosoftReactor
canonical_url: 
---

[![banner del evento](https://brunocapuano.files.wordpress.com/2022/03/image-12.png?w=600)](https://aka.ms/Mar17IntroAGithubConVSC)

Buenas !

Basado en los resultados de una encuesta, este próximo jueves tendremos esta sesion en vivo y online desde Microsoft Reactor:

## [Introducción a GitHub con Visual Studio Code 📝](https://www.meetup.com/Microsoft-Reactor-Toronto/events/284408139/)

En esta sesión aprenderemos a trabajar con Visual Studio Code y GitHub. Veremos diferentes temas, incluida la autenticación, la publicación de repositorios y la visualización en tiempo real de un repositorio.

¿Quién debe asistir?

- Desarrolladores, Arquitectos de soluciones y Gerentes de tecnología.
- Desarrolladores de software que buscan obtener más información sobre GitHub y Visual Studio Code.
- Estudiantes o profesionales del aprendizaje interesados en conocer GitHub y Visual Studio Code.

Al final de la sesión, cubriremos cómo:

- Iniciar sesión en GitHub mediante Visual Studio Code.
- Utilizar Visual Studio Code para buscar repositorios en GitHub.
- Clonar un repositorio de Visual Studio Code.
- Publicar un proyecto local en GitHub mediante Visual Studio Code.
- Ver una cronología de la actividad en un repositorio de GitHub.

Happy coding!

Greetings

El Bruno

More posts in my blog [ElBruno.com](https://www.elbruno.com).

* * *
Solved: Visual Studio Code Input not Working.
Tags: vscode, microsoft, productivity
Published: 2022-03-16 12:49:06

## Introduction
Every day, developers are usually exploring new solutions that software packages to make their programming experience more pleasant. Every day, we all confront different challenges, and it is these challenges that determine our progress as developers. But what if the tool you use on a daily basis starts acting up? This is a really significant problem that has left most of us in a state of despair, and we are left wondering what is going on.

Today, there are a lot of tools available to do so, but not all of them are going to have the same effect across different developers.

So, I had a problem at work for two days, which caused me to be less productive. I was trying to type into my VSCode editor, but the input does not appear in the editor when I type. In this article, I'll show you how I solved it in 3 simple ways.

- First of all, launch your VSCode 
![Shittu-Olumide-vim-solution1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1647432567305/4zz5HoEPo.png)

- Click on the **Extension icon** on the left side corner of your VSCode. 

![Shittu-Olumide-vim-solution2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1647432792580/8Rgmoy6Wn.png)


- When you click on the Extension icon, you will see a lot of
extensions. Type **vim** in the search bar and click on it. Make sure you **uninstall** it and click on **reload required** to commit changes.

![Shittu-Olumide-vim-solution3.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1647433175043/ZsPz7e7oS.png)

And that's it!

Your VSCode should work perfectly now.

With these 3 easy and simple steps you can solve Visual Studio Code input not working permanently.

Thanks for reading, you can follow me on [Twitter](https://twitter.com/Shittu_Olumide_) and [Hashnode](https://shittuolumide.hashnode.dev/) 

Stay Grinding 😎✌🏻
How to start contributing to open source projects??
Tags: opensource, webdev, programming, beginners
Published: 2022-03-16 12:46:30

Post on Google Summer of Code (Long Post)

how to start contributing to open source projects??

This world is full of open source projects they are everywhere from smartphones to satellites. It is very easy to get confused on which project to work on and which one to avoid.

- Pick any project based on your interest
Once you have picked the project, clone the repo to your local machine. Compile this code by reading the development docs mentioned in the READ. ME file. Once that is done go through the project change a few things and watch its reactions.

- Pick an issue
Every other project has ample issues to get started with. Look for "good first issues" which will have a special tag. Kindly ask the project maintainer to assign that issue to you.

If you couldn't find one then make an issue for yourself on the basis of your code understanding.

- Discuss it with the community
Once the issue is assigned to you try to discuss the solution of the problem in the community, they might give you a better solution or suggest any improvements.

- Make the PR
This is a straightforward thing. Make the PR for what changes you have made in the code. Remember to fill out the PR template and mention which issue have you fixed and what are going to be the changes that will require this code to work with.

- Remain active in Community
Whichever project have you picked just make sure to remain active in that project. You can do this by answering others' queries, reviewing someone's code, taking responsibility and suggesting improvements to the project.

- That's it start from step 1 once your PR is merged.

Don't forget to drop a like
byee :)

#opensource #community #github #googlesummerofcode #webdevelopment