I’m full

I recently noticed from my work computer that I had lots of disk space occupied by node_modules (React & Angular apps) and env (Python) folders. I had created these package spaces for the different projects I’ve been working on way before I started using Docker for developing and deploying application locally.

So the question was how could I remove them all at once in the folders that contained all the projects? This simple one line command helped for both folders:

find . -type d -name 'folder_name' -exec rm -r {} +

for node_modules folder:

find . -type d -name 'node_modules' -exec rm -rf {} +

for env folder:

find . -type d -name 'env' -exec rm -rf {} +

Or if you have several folders with similar names (or match a particular name) that need to be deleted, replace the name of folder after the -name flag.

And just like that I was able to recover 6 GB of space (more space for my tech E-books). Spinning up Docker containers is just sufficient for running projects since they can easily be deleted (pruned in Docker lingo) and created when required. And if you need to manage lo

Note: If you need to manage lots of Docker containers and images, make use of Portainer, an awesome web-based GUI tool for Docker management.

Template literals, where were you?

Ever since I started work at a new company 4 weeks ago, I’ve been challenged to learn the new paradigms of the Javascript programming language.

Think of me as an OG Javascript programmer who’s still stuck in pre-ES2015 era. I’ve been stuck with jQuery and vanilla JS pre ES6 as my front-end tools for the last 8 years and I’m learning of the awesome tricks that comes with ES6 and any versions beyond it. Part of the reasons I’ve not advanceD is my focus on developing backend solutions using Python and PHP.

One thing that has struck me today is template literals which can achieve the following:

  • Using variables as text placeholders e.g. `Hello ${name}. Are you ok?`
  • No need to concatenate using the plus operator (+)
  • No need to use the plus operator for multi-lined strings. You can write HTML code as is within the back ticks (` `)
  • Add Javascript expressions such as addition calculations etc

I’m definitely enjoying ES6/ ES2015 and looking forward to tackle ReactJS and VueJS soon.

Change Drupal 8 User Password

Changing the password of Drupal 8 user is easily done using drush. As of this post, the Drush version I’m using is version 9.5.2 and was installed in the project’s directory using composer (composer require drush/drush).

The syntax is:

drush upwd [user]  [password]


drush user:password [user]  [password]

For example, to change the admin user password:

drush upwd admin "another_password"

How to merge Excel Sheets Vertically?

This can be achieved in Pandas using the concat() function. The data frames generated from the read_excel() function are added as a list to the concat() function:

import pandas as pd

df = pd.read_excel('file-2.xlsx')
df1 = pd.read_excel('file-3.xlsx')
df2 = pd.read_excel('file-4.xlsx')
df3 = pd.read_excel('file-5.xlsx')

df_combined = pd.concat([df, df1, df2, df3])

Then finally use to_excel() function to generate the new combined Excel file.

Merge Dictionary in Python

There are two methods but I’ll focus on one that is a trick which merges two dictionaries and creates a new one using the ** character to pass multiple arguments using the dictionary:

x = {'a': 1, 'b': 2}
y = {'b': 3, 'c': 4}
z = {**x, **y}


{'a': 1, 'b': 3, 'c': 4}

Since both keys have the same b key, the last dictionary is considered and added to the resulting merge. In other words, if there are duplicates, the duplicate in the first dictionary is replaced by the duplicate in the second one.