teleren/devto huggingface dataset:
Enforcing single quotes in Python
Tags: python, discuss
Published: 2020-12-23 00:11:15

So, I have tried *black*, *yapf* and *autopep8* because those are the options that VS Code prompts me to use when I want to format on save. 

Out of the 3, I find *black* the most useful, because it is more similar to Prettier. However, I don't like that it enforces me to use double quotes instead of single quotes. I have read in lots of places that this is not possible. I really like *black* but I find this limitation a HUGE disadvantage. 

Do you know a way to enforce single quotes with *black* or do you prefer *yapf* or *autopep8*? Which one is more "flexible"? Do you use any of these formatters along with *pylint*?

Thanks for your answers!
My success list 2020
Tags: articles, careergrowth, career
Published: 2020-12-23 07:34:55

---
title: My success list 2020
published: true
date: 23/12/2020
tags: Articles,CareerGrowth, career
canonical_url: https://eisabainyo.net/weblog/2020/12/23/my-success-list-2020/
---

A few days ago, I wrote [my fail list of 2020](https://eisabainyo.net/weblog/2020/12/19/my-fail-list-of-2020/). But it’s not all doom & gloom over here. I am definitely grateful for everything I’ve achieved in 2020, amidst the global pandemic. I’d like to share with you top five things I’ve done that I considered most impactful.

Without any further ado, here is my success list of 2020.

1. 📕 I wrote and published two books to help professionals in the tech industry navigate top two challenges of the year – remote work & job search; [The Accidental Remote Manager](https://www.subscribepage.com/i8j0s2) and [Nail That Interview – Tips for interviewing for tech jobs remotely](https://www.subscribepage.com/k8u2e8). 
2. I am on track to finish my 5th book – 💡 The Engineering Manager’s How-To Guide in Jan next year (you can [pre-order](https://gumroad.com/l/emhowto) here). It is gonna be a great book as it is very targeted for engineering managers. In this ebook, you won’t find generic advice like having a regular 1:1’s, giving feedback, etc. Yes those things are are absolutely important, but they are not specific to an engineering manager’s role.
3. I coached and mentored 15 professionals in the tech industry and 90% of them were women in tech. ❤ 
4. I have been averaging 10k steps a day since April this year. It’s helping me keep fit & unblock my creativity, I wrote about it in my blog post: [4Ls Retrospective Of Working From Home and Homeschooling as an Engineering Manager and a Mom](https://eisabainyo.net/weblog/2020/09/05/a-week-of-working-from-home-and-homeschooling-as-an-engineering-manager-and-a-mom/)
5. Last but not least, I started trying a lot more things and putting myself out there more this year and I’m finally ok with not getting a 🏆 every single time for my efforts. (PS: Not a real trophy – figurative speech.) 

If this year had taught us anything, it’s that…

> We are stronger than we think, more resilient than we know and more talented than we give ourselves credit for.

See you in 2021.

![Happy Holidays!](https://dev-to-uploads.s3.amazonaws.com/i/xtru3ipurzip4o1pc5ui.png)

The post [My success list 2020](https://eisabainyo.net/weblog/2020/12/23/my-success-list-2020/) appeared first on [Career Resources For Professionals In Tech](https://eisabainyo.net/weblog).
How to rename a file asynchronously in Node.js?
Tags: node
Published: 2020-12-23 00:00:00

---
  title: How to rename a file asynchronously in Node.js?
  published: true
  tags: Nodejs
  date: Wed Dec 23 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/rename-file-asynchronously-nodejs
  cover_image: https://melvingeorge.me/_next/static/images/main-5261f578ed8920c785908c3398de04ef.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/rename-file-asynchronously-nodejs)
  
To rename a file asynchronously, you can use the `rename()` function from the `fs` (filesystem) module in Nodejs.

```js
// Rename file asynchronously
fs.rename("file.txt", "myFile.txt", () => {
  console.log("Successfully renamed!");
});
```

Let's say you want to rename a file called `file.txt` inside the `docs` directory, so the `path` now looks like this,

```js
// path to rename
const path = "./docs/file.txt";
```

Let's rename the `file.txt` to `myfile.txt`. So let's create another variable to hold the new filename path like this,

```js
// path to rename
const path = "./docs/file.txt";

// new file name
const newFileNamePath = "./docs/myFile.txt";
```

Now we can use the `rename()` asynchronous function and pass:

- the `path` as the first argument
- and the `newFileNamePath` as the second argument
- and finally, an error first callback that will execute after the file is renamed.

It can be done like this,

```js
// require fs module
const fs = require("fs");

// path to rename
const path = "./docs/file.txt";

// new file name
const newFileNamePath = "./docs/myFile.txt";

// rename file.txt to myFile.txt
// using the rename() asynchronous function
fs.rename(path, newFileNamePath, (error) => {
  if (error) {
    throw error;
  }
  console.log("Successfully Renamed File!");
});
```

And we have successfully renamed our file 🔥.

See this example live in [repl.it](https://repl.it/@melvin2016/rename-file-asynchronous-nodejs#index.js).

### Feel free to share if you found this useful 😃.

---
Micromanagement
Tags: management, micromanagement
Published: 2021-01-16 02:04:39

---
title: Micromanagement
published: true
date: 2020-12-23 00:00:00 UTC
tags: management, micromanagement
canonical_url: https://www.manuelobregozo.com/thoughts/micromanagement
---

What is the first thing that comes to your mind when reading _Micromanagement_? 

The way I understand this concept is when people (usually managers) are managing you from different perspectives and angles, as in there is constant communication about proving status reports of how things are in a work environment, which can be understood as lack of freedom.   
  
I am for sure not the first person to point this out, but every time that I get into a conversation at work, where it feels like micro-management, the first question that comes to my mind is: why does this person do not trust me?. 

So then, is this a consequence of bad leaders not able to delegate work and lack of trust? I would say: maybe!?.

However finding the reason behind the lack of trust is not always up to the managers. It can be that me (developer) I am not fully transparent about what I am doing, and how is this progressing.

Other questions that I can imagine are:

- Am I using the right words to communicate my daily status? 
- Am I sharing every concern I know about the new feature I am building? 
- Am I afraid to tell them that I am running out of time or that my first estimation was completely wrong? 

Moreover it may also mean that the process or methodology the company is using is causing this. And the reason why I have mentioned these points, is because I usually see developers complaining about _Micromanagement_, but they do not reflect on the past and ask themselves what can be done from their end to make this better.   
  
As I understand it, this can evolve into another famous concept in the IT field called _proactivity_, which IMHO can happen in two different ways. One is to jump up whenever someone next to you needs your help, and from the other side raise your hand whenever you feel stuck or realise that something unexpected has happened that can potentially have an impact on whatever task you are doing.  
  
Going back to the way I like to handle this, there are a few things that I try to keep in mind when working on something, specially in those times when I am working on my own, and completely asynchronous from the rest of the team:

- Keep all tooling I am using to track the progress up to date (Jira might be one of the most common tools I have used for this)
- Be transparent about the REAL status of what I am working on 
- Share concerns and blockers as soon as they happen, even when I feel I have a solution in mind, because the sooner we tackle this the better! 
- Be proactive when sharing dependencies of what I am doing
- DO NOT MAKE ASSUMPTIONS! I am never afraid to ask questions, even when I feel that I should have addressed that before

Of course there is no recipe for this, and just in case there is one unfortunately I do not have it! but in my experience so far the points I have mentioned before helped me to deal with _Micromanagement_ in a better way at the end of day.
Jump-start your node backend
Tags: typescript, node, testing
Published: 2020-12-22 23:52:53

## For the impatient readers

After setting up backends with JWT authentication middleware and basic structure too many times, I wanted something that is clean enough to be used as a boilerplate, and abstracted enough that I can develop rapidly. Here is the result:

[clone & start](https://github.com/sroehrl/node-express-typescript)

## What we are aiming for

The first step is looking at dependability and scalability and therefore looking at testing & CI is the basis.
Jest & supertest seem to be good candidates for writing tests while [travis-ci](https://travis-ci.com) and [codeclimate](https://codeclimate.com) have been my go-to for coverage reports and continuous integration. We also want type save development so typescript is the obvious choice. 
As most developers are familiar with express, we are not going to make any esoteric choices regarding the server. Other than that, we want to limit boxing us in as far as possible.

## The database

I decided on MySQL but wanted to make sure we can migrate easily in case we maintain active projects. Rather than choosing an orm, I decided to write my own SQL wrapper for common CRUD operations that can be easily abstracted in order to save myself (and others) from repeating business logic. The result is a model system that uses an abstracted resolver for creating, finding getting and updating model entities. 

## Authentication

JWT seems to be the most versatile way of authentication and providing middleware, a user model and signup & login routes seemed a logical step as I would else have to write this in every project. Instead, simple changes to the user model depending on my needs seems reasonable. 

## The result

I soon noticed that the result was more solid than originally anticipated and adding a license to throw it at the public seemed logical. However, you are the judge of that so I would be happy if you gave it a spin and provided some feedback. Have fun!

[repo](https://github.com/sroehrl/node-express-typescript)
Real-Time Partial Updates in Ruby on Rails using hotwire-rails
Tags: rails
Published: 2020-12-22 23:17:55

{% youtube MRv4XGu6QkY %}

The [hotwire-rails](https://rubygems.org/gems/hotwire-rails) was just released today by Basecamp. It's a collection of JavaScript & Ruby libaries which allows for making some pretty rich user experiences.

The big thing I like, was how easy it is to create real-time partials in Ruby on Rails. 

Now we just the need code:

```ruby
# app/models/post.rb
class Post < ApplicationRecord
  # We're going to publish to the stream :posts
  # It'll update the element with the ID of the dom_id for this object,
  # Or append our posts/_post partial, to the #posts <tbody>
  broadcasts_to ->(post) { :posts }
end
```

Then within the views, having:

```erb
<!-- app/views/posts/index.html.erb -->
<%= turbo_stream_from :posts %>

<table>
  <thead>
    <tr>
      <th>Title</th>
      <th>Body</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody id="posts">
    <%= render @posts %>
  </tbody>
</table>
```

```erb
<!-- app/views/posts/_post.html.erb -->
<tr id="<%= dom_id post %>">
  <td><%= post.title %></td>
  <td><%= post.body %></td>
  <td><%= link_to 'Show', post %></td>
  <td><%= link_to 'Edit', edit_post_path(post) %></td>
  <td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
```
useReducer final destination (Signing Off):
Tags: react, webdev, hooks, reducer
Published: 2020-12-22 18:39:39

**Welcome Back** devs!

We have talked about useReducer hook, its usage, and its implementation in the previous post of this series.

First of all, let us have a *recap*,

**Roles**:

**action**: Action is a plain JavaScript string or object that contains information. Actions tell the reducer what kind of action to perform and all other fields contain information or data.

**initialState**: defines the initial state of the component.

**currentState**: defines the current state of the component

**reducer**: reducer() function accepts the currentState and action and then returns a new state based on that action

*useReducer* hook returns the currentState and the dispatch method.

**dispatch**: dispatch method is capable of accepting an action to execute the code specified in the render function i.e. it accepts the action and transfers it to the reducer function.

Note: initialization of initialState and reducer() is always made outside the functional component.

Now, in this post, we are going to see another method that can be used to use the **useReducer** hook.

Let's have look at our reducer,

![reducer](https://dev-to-uploads.s3.amazonaws.com/i/7efmwin3gk67r8yjvki3.JPG)

*Reducer* function is the same as we have implemented in the first post of usReducer hook

Now, let's see our functional component,

![Functional component](https://dev-to-uploads.s3.amazonaws.com/i/srevtt0bhabkzwx43fvf.JPG)

Here, we have implemented *two* different *useReducer* hook using the same *reducer()* function. 
This is another way to make use of the *useReducer* hook.

Let's have a look at the complete code,

![cmpltcode](https://dev-to-uploads.s3.amazonaws.com/i/svv0ibh0b2aezit2n6st.JPG)


output:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0knsghfdsdt1ckwub7s0.JPG)

So with this, we come to the end of the *useReducer* hook.

We have seen *three* different methods to use and implement the *useReducer* hook.

*Feel free to leave a comment if you face any doubt!*

*Happy Coding!*

*Thank you,*

*- Jayant Khandelwal*
Using Font Icons in Xamarin.Forms
Tags: xamarinforms, mobile, design
Published: 2020-12-22 23:16:13

Font icons are a fast way to add artwork to your Xamarin.Forms app, and at a very low hit to filesize. This video takes you through grabbing a font, generating a static class with helpful named glyphs, and replacing a PNG with a FontImageSource.

{% youtube j-oFC2lOQwI %}

{% gist https://gist.github.com/davidortinau/566250bd2e82e4ba2d5adbb018f28f1e %}

#### Resources:
* [Typicons Font](https://github.com/stephenhutchings/typicons.font)
* [Icon Font 2 Code](https://andreinitescu.github.io/IconFont2Code/)
* [Docs](https://docs.microsoft.com/xamarin/xamarin-forms/user-interface/text/fonts#display-font-icons)

{% github davidortinau/BillDetailSample %}
Light and Dark Themes in Xamarin.Forms
Tags: xamarinforms, mobile, design
Published: 2020-12-22 23:04:20

By default Xamarin.Forms uses platform colors that respond to OS theme changes (light and dark), however you will very likely want to update your styles to use the specific colors you wish. The AppThemeBinding markup extension takes care of this for you.

{% youtube 1HHtgbtAfTQ %}

{% gist https://gist.github.com/davidortinau/83ceac7b98eab19606054aa149e84547 %}

#### Resources:
* [Docs](https://docs.microsoft.com/xamarin/xamarin-forms/user-interface/theming/system-theme-changes)

{% github davidortinau/Xappy %}
Format Current Time 🕰️
Tags: javascript
Published: 2020-12-22 23:00:59

```javascript
new Date(Date.now()).toLocaleTimeString("en-US", {
  timeZone: "America/Chicago",
    })
```

The above code outputs _something_ like: `4:30:05 PM`.

For me, this comes in handy when running a Node server that is being watched by something like `nodemon`. In this way, I can see 👀 the timings and know that things are updating properly as I save my code.

Note that if you want the entire date included, just use: `toLocaleString` instead of `toLocaleTimeString` 👆🏾.

Finally, you can [see 👀 the list here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to get the correct TZ _strings_ such as `"America/Chicago"`.
Gradients in Xamarin.Forms
Tags: xamarinforms, mobile, design
Published: 2020-12-22 22:54:08

Linear and radial gradient brushes, as well as solid brushes, can be used to paint backgrounds and other options in Xamarin.Forms. Here I use a linear brush to paint the background of a Frame container and a Button.

{% youtube 2wuCwIfdaVs %}

{% gist https://gist.github.com/davidortinau/c95dbe0351bce12984edf0cb4f994f59 %}

#### Resources:
* [Docs](https://docs.microsoft.com/xamarin/xamarin-forms/user-interface/brushes/lineargradient)

{% github davidortinau/PersonalFinanceSample %}
Clipping with Shapes in Xamarin.Forms
Tags: xamarinforms, mobile, design
Published: 2020-12-22 22:46:49

Shapes in Xamarin.Forms can now be applied to clip (or mask) and view. In this example I use an Ellipse to turn a square image into a circle image.

{% youtube HWJ1eADlHd0 %}

{% gist https://gist.github.com/davidortinau/333cd8915192ecade8b0b5a6cd266b91 %}

#### Resources:
* [Docs](https://docs.microsoft.com/xamarin/xamarin-forms/user-interface/shapes/geometries)

{% github davidortinau/PersonalFinanceSample %}
How do you do validations with ReactJs forms?
Tags: help, react, discuss
Published: 2020-12-22 22:45:14

I've been receiving spammy, real-user submitted form submissions on my site https://studio.icvn.tech/#contact. As a new dev who's been learning react, I find it hard to block free emails on my form.

Does anyone know a solution? 

Code is at https://github.com/icvntechstudio/rebrand/blob/master/src/components/Contact.js

Thanks!
Custom Fonts in Xamarin.Forms
Tags: xamarinforms, mobile, design
Published: 2020-12-22 22:42:01

The right fonts immediately help make any design better and more consistent across platforms. Quickly embed a font resource and enable it for cross-platform use in Xamarin.Forms, and be sure to set a default color for Labels so Android behaves.

The font I chose is similar to the default, so be sure to look at the numbers in the final comparison.

{% youtube vhl1ISTlFpA %}

#### Resources:
* [Blog](https://devblogs.microsoft.com/xamarin/embedded-fonts-xamarin-forms/)
* [Docs](https://docs.microsoft.com/xamarin/xamarin-forms/user-interface/text/fonts)

{% github davidortinau/Xappy %}
Front end frameworks which one to use?
Tags: webdev
Published: 2020-12-22 22:07:17

---
title: Front end frameworks which one to use?
published: True
description: How to decide which framework to use?
tags: webdevelopment 
//cover_image: https://direct_url_to_image.jpg
---

So lately I have been spending the better half of the past month learning how to use Vue js. Now my core reasoning behind this is that I heard the learning curve was a lot lower and would make it easier to understand other similar frameworks such as react.

Now in the past, I have used angular I swapped to vue and have been enjoying the structure of components, etc. Now my question is for you all that have used other frameworks such as angular react etc. How do you choose which tool is best for what. Or do you just use what you feel is easier to use for you? 

Personally, on my own projects, I try to go with the path of least resistance and not choose the shiniest thing in the toolbox. While something may not have 1k features to it if it gets the job done and works well why change it. 

So what are your thoughts I'm going to assume 99% of responses are going to react, but really curious as to the why?
A continuously growing set of unique SVG icons. 💁‍♀️ Brutalist design, vanilla CSS, 200ms page loads.
Tags: css, javascript, svg, html
Published: 2020-12-22 21:52:11

---
title: A continuously growing set of unique SVG icons. 💁‍♀️ Brutalist design, vanilla CSS, 200ms page loads.
published: true
description: Checkout this landing page I recently launched for an SVG icon library I’m giving away for free. The landing page loads in under 200ms, uses IBM Plex Mono, brutalist design, and It uses pure vanilla CSS with no JS used for the SVG editing.
tags: css, js, SVG, html
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/uhm4g5zv5pxqomy58es6.jpg
---
Checkout this landing page I recently launched for an SVG icon library I’m giving away for free. The landing page loads in under 200ms, uses IBM Plex Mono, brutalist design, and It uses pure vanilla CSS with no JS used for the SVG editing. The download buttons aren't live yet because I'm still finishing up the icon package but I wanted to get some feedback from the community.

I'd love to hear your thoughts on both the Icons and the landing page.

https://svgden.com/ 👈👈👈👈👈👈👈👈

I'll be adding and refining the library continuously in the coming months. I also plan on adding some more traditional sets for Business / Data / General UX needs.
Time to Clean My Machine with ncdu
Tags: linux, macos, cli
Published: 2020-12-22 21:33:55

2020 is almost over(To be honest, 2020 is one of the hardest years for me). Anyways, before 2021 cleaning my machine can be good.


https://dev.yorhel.nl/ncdu

{% github rofl0r/ncdu %}


## Install
```zsh
$ sudo apt-get install ncdu # Ubuntu(Debian)
$ brew install ncdu # with Homebrew
$ sudo port install ncdu # with MacPorts
```

## How to use
There are two easy ways to use `ncdu`.
One is to move to the directory that you want to know the details and the other is to pass the directory as a parameter.

```zsh
$ pwd
/Users/koji/Documents/github

# way 1 (/Users/koji/Documents/github/TypeScript)
$ cd TypeScript
$ ncdu

# way 2
$ pwd
/Users/koji/Documents/github
$ ncdu TypeScript
```

![way1](https://dev-to-uploads.s3.amazonaws.com/i/lw6ws1ypjkjz9aggpum8.png)

![way2](https://dev-to-uploads.s3.amazonaws.com/i/5js6fpads97n95g6206x.png)


Then we can move a directory to a directory with the arrow keys

#### up/down: Select a directory
#### left: Move out from a directory
#### right: Move in a directory


{% youtube V3ac36I7lIQ %}

We can understand which folders/files are taking space on our machine. The result is really simple and the performance is very good.

Happy Holidays!!!
Productivity Hack for Developers/Students
Tags: productivity, watercooler, discuss
Published: 2020-12-22 21:30:33

I was just learning something, and I realized that we spend more time searching and exploring things but not focus on the learning part. 
So, how can we improve that?

### Make Sticky Notes

Write down all the daily tasks that you need to do, and set them according to the priority order. 

But when to make Sticky Notes?
A good trick is that make them one day before because that will see your time to not think the next day what you have to do. 

### Time management

The best way I can suggest to you is that when you start doing a task then write the approx time you will invest in that particular task. And after doing that, note down the actual time it took you to complete that.

### How to handle social media distraction?

**Apply the 50/10 approach.**
What's that? 

Well, work on your tasks for 50 minutes, and give yourself a break for 10 minutes, in those 10 minutes you can use either social media, or give yourself some rest. 

These things aren't easy to apply, but if you try every day it will create a habit, and your productivity will increase.

**Let me know what you use!**

You can connect with me on:
🎥[YouTube](https://youtube.com/BashWoman)
⚒[LinkedIn](https://linkedin.com/in/seemasaharan)
🧵[Twitter](https://twitter.com/SeemaSaharan5)
✍[Hashnode](https://bashwoman.hashnode.dev)
📷[Instagram](https://instagram.com/bashwoman)