teleren/devto huggingface dataset:
I've been using vim in total a year, and I'll stick to it. 
Tags: vim, dx, devrel
Published: 2021-06-05 00:06:19

---
title: I've been using vim in total a year, and I'll stick to it. 
published: true
description: level up vim with these tips. 
tags: vim, dx, developerexperience 
cover_image: https://source.unsplash.com/wvJuYrM5iuw
---

And heres why:
* after you learn vim, you will be less pressing <kbd>ALT</kbd>, <kbd>CMD</kbd>, <kbd>CTRL</kbd>, <kbd>HOME</kbd>.
* you can achieve so many things with less keystrokes
* vim also can record your commands with macros, so be sure to check it out below.




{% youtube IiwGbcd8S7I %}

{% youtube d8XtNXutVto %}


* I'll be sharing few highlights from both of the video above that I feel its very handy. Hence, if you just started to
learn how to use vim, please watch both of the video first as my examples below is suitable to someone already familiar
with basics(Visual, Editing, Deleting, and Navigating). 
* However, I'll try to make this interactive as much as possible,
so that anyone could get start easily. Since both of the video is quite long, I have 1 little tip on how to learn faster
on my previous [article](https://dev.to/azrizhaziq/unpopular-opinion-on-learning-approach-119i).

## Few notes before we start:

- First, I've been editing this article for quite long with nested bullet points, and it doesn't really work. The
  numbering, indentation and some other stuff not properly align. Hence, I'll be using gist since it works fine. Also average reading will be around ~10min instead of 2min.
- All the char is case-sensitive, and please excuse me if I'm using incorrect term/syntax 😅.
- Please note that on below example I'll be using a lot of `<cursor here>` to indicate you need to move your cursor
  somewhere around there.
- If you see `<enter>` it means you have to press enter. Same goes to `<esc>`.
- Plus, if you see a formatting like this <kbd>q</kbd>, it means press the 'q' key in keyboard.
- Lastly, I'm using this awesome [repo](https://github.com/amix/vimrc) for my vim config. 

If you prefer to read in github gist, you can click this link. https://gist.github.com/AzrizHaziq/adcfdbf12c3b30b6523495e19f282b58#file-vim-md

## Let's get started then:


{% gist https://gist.github.com/AzrizHaziq/adcfdbf12c3b30b6523495e19f282b58 file=vim.md %}



- Now that you have learn few things here, why not give it a try first? You might have same hobbies like mine (search
above 🤣).
- Please, don't try to remember all the keys, since vim already have a good mnemonics. 
- However, there is a lot of things that I didn't mention in both of the videos. Hence, I strongly suggest you to watch it. - I hope my example is easy to understand. Let me know if the example is not clear enough for you/typos or anything in comment. Thank you for reading.
Granting Access to Cloud Build - Impersonating a Service Account
Tags: googlecloud, cloudbuild, googlecloudiam
Published: 2021-06-05 00:05:23


<hr>

Another option to allow your team members to interact with the Cloud Build in your project is to [impersonate](https://cloud.google.com/iam/docs/understanding-service-accounts) a service account.

---

## How it Works:

1. Create a Service account giving it the Predefined roles or a Custom one (preferred) to grant it the required permissions.
2. Your users will (only) need to have the following roles: 
  - `roles/iam.serviceAccountTokenCreator`
  - `roles/serviceusage.serviceUsageConsumer`
3. This will allow your team members to submit builds using the impersonation flag:

    ```
    gcloud builds submit \
      --config cloudbuild.yaml \
      --impersonate-service-account=<SERVICE_ACCOUNT>
      --gcs-log-dir=gs://<BUCKET_NAME>/<SUBDIRECTORY>
    ```

---

## The **Flaws** of this Option

Allowing the users to impersonate service accounts like that will provide them with a lot of possibilities within the project as they will technically be able to list the service accounts within the project and impersonate any of them, thus having access not only to Cloud Build but other project resources as well.

Therefore, you should never grant the **Service Account Token Creator** role to a user this way.

---

## **Solution** for the Service Account Token Creator role

Instead of giving users the project-wide Service Account Token Creator role for the account impersonation, you should make that role **service account-specific**. 

Here is how you can do that via Cloud Console or CLI:

#### Cloud Console solution

1. Navigate to IAM & Admin -> Service Accounts.
2. Click 'SHOW INFO PANEL'.
3. Select the relevant Service Account.
4. Click 'ADD MEMBER'.
5. Specify the user account granting it Service Account Token Creator role.
6. Click 'SAVE'.

#### CLI solution

1. Using the `gcloud` tool, add an [IAM policy binding](https://cloud.google.com/sdk/gcloud/reference/iam/service-accounts/add-iam-policy-binding) for the service account:

    ```
    gcloud iam service-accounts add-iam-policy-binding <SERVICE_ACCOUNT> \
      --member="user:<USER_ACCOUNT>" \
      --role="roles/iam.serviceAccountTokenCreator"
    ```

2. To see the current IAM policy bindings run the following `gcloud` command:

    ```
    gcloud iam service-accounts get-iam-policy <SERVICE_ACCOUNT>
    ```

In this case, your team members (group) will only need to have the Service Usage Consumer role, while the Service Account Token Creator role will be bound only to the specified service account.

<hr>
Granting Access to Cloud Build - Custom Roles
Tags: googlecloud, cloudbuild, googlecloudiam
Published: 2021-06-05 00:05:04


<hr>

In this article, I will describe how to take advantage of the **Custom roles** to allow your team to use the Cloud Build in your project.

This is a better solution than using the Predefined roles as it gives you more control over the permissions you give to your team members.

---

## Create a Custom Role

[Create a Custom role](https://cloud.google.com/cloud-build/docs/securing-builds/configure-access-control#creating_iam_custom_roles) that contains all the required permissions. Later, you can assign it to the group with the relevant team members.

Here are the minimum permissions that your Custom role will need to have:

- `cloudbuild.builds.create`
- `cloudbuild.builds.get`
- `cloudbuild.builds.list`
- `cloudbuild.builds.update`
- `storage.buckets.get` *- Grants permission to read bucket metadata*
- `storage.buckets.list` *- Grants permission to list buckets in the project*
- `storage.objects.get` *- Grants permission to view objects*
- `storage.objects.create` *- Grants permission to create objects*
- `serviceusage.services.use` *- Required to use the project for quota and billing purposes*

---

**Note** that the `storage.objects.get` permission is needed for accessing the build logs, if you are storing the logs in a non-default bucket (see the "The Access Denied Error" section in my previous article).

---

**Sample** command for submitting a build:

```
gcloud builds submit \
  --config cloudbuild.yaml \
  --gcs-log-dir=gs://<BUCKET_NAME>/<SUBDIRECTORY>
```

<hr>
Granting Access to Cloud Build - Predefined Roles
Tags: googlecloud, cloudbuild, googlecloudiam
Published: 2021-06-05 00:04:58


<hr>

In this article, I will go through the permissions required for your team members to use the Cloud Build in your project, and which **Predefined roles** you could use for that.

---

## Required Permissions

First of all, let’s review which permissions your team members will need.

The users who access the Cloud Build API will need to have the following permissions:

- `storage.buckets.get`
- `storage.buckets.list`
- `storage.objects.create`
- `serviceusage.services.use`

The storage permissions are required as Cloud Build pushes its logs into the Google Cloud Storage, while serviceusage.services.use is needed since it enables you to consume quota and billing for the project.

Besides the permissions mentioned above, your team will also need the [obvious ones](https://cloud.google.com/cloud-build/docs/securing-builds/configure-access-control) like:

- `cloudbuild.builds.create`
- `cloudbuild.builds.update`
- `cloudbuild.builds.get`
- `cloudbuild.builds.list`

---

## <span style="color:red;">Predefined Roles</span>

The following roles can grant your team the permissions mentioned above:

(**storage.buckets.get** and **storage.buckets.list**)
- `roles/storage.admin`
- `roles/viewer`

(**storage.objects.create**)
- `roles/storage.objectCreator`

(**serviceusage.services.use**)
- `roles/serviceusage.serviceUsageConsumer`

And, of course, `roles/cloudbuild.builds.editor` to **create** and **cancel** builds.

---

## The Access Denied Error

Due to the [known issue](https://issuetracker.google.com/134928412) with the Cloud Build logs, your team members will still be experiencing the Access Denied error unless they have one of the **Basic** roles (Viewer/Editor/Owner).

This error is driven by not having access to the Cloud Build logs stored in GCS - they are stored in a Google-managed bucket that is available for Basic roles only.

This doesn't affect the builds themselves but their logs - your team will still be able to use the Cloud Build without having a Viewer/Editor/Owner role. 

---

## The Access Denied Error: **Solution**

Let's see how to avoid the Access Denied error without giving the users a Basic role.

As mentioned previously, the root cause of that error is that Cloud Build stores logs in a Google-managed bucket by default. 

However, we are not obliged to use that particular
bucket and can specify one of our own with the following flag:

```
--gcs-log-dir=gs://<BUCKET_NAME>/<SUBDIRECTORY>
```

**Note** that you will need to specify the subdirectory for the bucket of your choice. Otherwise you will run into the following error:

> ERROR: (gcloud.builds.submit) wrong collection: expected [storage.buckets], got [storage.objects]

<hr>
Granting Access to Cloud Build - Intro
Tags: googlecloud, cloudbuild, googlecloudiam
Published: 2021-06-05 00:04:39

<hr>

In this series, I will review a situation when you own a GCP project and your development team needs to use the Cloud Build in it. Your team members will need certain permissions for that but there are a few details which you will need to consider when making a decision.

---

## Available Options

There are three options that I will cover. Not to make it a long read, I have divided them into the separate articles:

1. [Using Predefined roles](https://dev.to/dtsokarev/granting-access-to-cloud-build-predefined-roles-176e)
2. [Using Custom roles](https://dev.to/dtsokarev/granting-access-to-cloud-build-custom-roles-a2n)
3. [Impersonating a Service Account](https://dev.to/dtsokarev/granting-access-to-cloud-build-impersonating-a-service-account-5hm)

<hr>
Optimize for recovery time, not defect count
Tags: cicd, continuousdeployment, devops, mttr
Published: 2021-06-08 17:49:35

---
title: Optimize for recovery time, not defect count
published: true
date: 2021-06-05 00:00:00 UTC
tags: cicd,continuousdeployment,devops,mttr
canonical_url: https://jhall.io/archive/2021/06/05/optimize-for-recovery-time-not-defect-count/
---

Regular readers of mine know that I’m a strong advocate for [continuous deployment](https://jhall.io/lean-cd-bootcamp/). But many teams are afraid of implementing CD for fear that more bugs might slip through than with a more manual process.

The problem with this concern is that it’s focused on the wrong thing.

The focus is on trying to _reduce the number of defects_ that get released (formally known as [Mean Time Between Failure (MTBF)](https://en.wikipedia.org/wiki/Mean_time_between_failures)).

A much more useful goal is to try to reduce the time it takes to fix defects when they do occur (formally known as [Mean Time to Repair](https://en.wikipedia.org/wiki/Mean_time_to_repair)).

Why?

Even if we can reduce our defect count to, say, one per year, if reparing that one defect takes days or weeks, the impact will be severe.

On the other hand, if we can improve our ability to detect and repair defects to, say minutes, then the impact of even hundreds or thousands of defects may be minimal.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Setting up virtual environments for Python repos
Tags: python
Published: 2021-06-05 09:16:59

---
title: Setting up virtual environments for Python repos
published: true
date: 2021-06-05 00:00:00 UTC
tags: python
description: What is pyenv, venv and virtualenv?
canonical_url: https://bionicjulia.com/blog/setting-up-virtual-environments-for-python-repos
---

I have to say that when I first came across the concept of setting up virtual environments for running Python, I found it extremely confusing. Despite installing the necessary Python versions I needed for a particular code, running `pip install` never seemed to work the way I felt it should intuitively, and I found the whole thing a bit hit and miss at the best of times.

After starting with a new team and Django code base this week, I finally got some help from another senior engineer about this and feel like I now understand where I've been going wrong. I thought I'd do a quick blog post on how to set up virtual environments for Python properly, mostly as a reference to myself as I'm sure I'm going to have to keep coming back to this in the future. 🙂

### pyenv

First things first, `pyenv`. This basically allows you to install isolated versions of Python on your machine. You might need say Python v3.3 for one project, but Python v3.6 for another. `pyenv` allows you to have multiple Python version installs in your computer, allowing you to easily switch between them. Here are some useful commands:

- `python --version` - checks current version of Python.
- `pyenv install 3.8.2` - installs Python version 3.8.2.
- `pyenv global 3.8.2` - sets the global version of Python to 3.8.2.

The various versions are saved in this directory (assuming you're on MacOS): `~/.pyenv/versions/`

Some helpful resources that goes deeper into `pyenv`:

- [https://anil.io/blog/python/pyenv/using-pyenv-to-install-multiple-python-versions-tox/](https://anil.io/blog/python/pyenv/using-pyenv-to-install-multiple-python-versions-tox/) → this has installation instructions for MacOS so start here.
- [https://realpython.com/intro-to-pyenv/](https://realypython.com/intro-to-pyenv/)

### Creating virtual environments

I came across 2 ways of creating virtual environments in Python (which led to a lot of confusion). I'd really recommend reading [this SO thread](https://stackoverflow.com/questions/41573587/what-is-the-difference-between-venv-pyvenv-pyenv-virtualenv-virtualenvwrappe) to understand the differences between `venv` and `virtualenv`.

I hope I got this right... but let me know on [Twitter](https://twitter.com/bionicjulia) or Instagram [@bionicjulia](https://instagram.com/bionicjulia) if not!
My Journey To Full Stack Web Development From My Side Of The World Teaching Myself.
Tags: webdev, career, beginners, productivity
Published: 2021-06-04 23:29:42

It's been a heck of a journey getting into the Web development Industry.
I'm Martins Ngene from Nigeria. I have come a long way on my journey to become a Full Stack Web Developer. I am going to share with you all what my journey have been like and hopefully we all learn something.

I have been unstable in my learning of Web Development. I started in 2018 but I took off seriously early this year. I have had a bunch of challenges but what some people call luck and I call Divine assistance has been present. From the issue of power supply shortage down to the unavailability of data this has all been a hinderance. My country is still a developing country and its Ecosystem isn't conducive for newbies in Tech or programming. Majority of the people trying to get into the tech industry In Nigeria are either hindered by the high cost of computers and other gadgets, Data unavailability or Power supply shortage. 

Sometimes we do pray for help to come from distant lands. But I was Graced to have reached the point where I am now though I just started an Introductory course to computer science as at when I wrote this post but I am sure that against all odds I will achieve my goals someday. 

I have acquired some skills such as HTML, CSS, Bootstrap, Git, Netlify, SASS and I still look forward to get my hands dirty with a programming language soon while I practice what I have already learnt.

I am currently looking for any available way for me to get industrial experience and really get to learn more about coding and programming in general.

I lost My Dad in 2014 and My Mum in 2020. I really lost the chance of my parents sending me to college but I believe and I know I'll get a job from Web development and I will finally go to my school of choice and study computer science, even getting a better knowledge of programming. 

I see a very bright future in the programming Ecosystem and I believe that someday I will learn enough to fulfill my dreams and also to reduce the stress for people who are interested in Programming by helping them in any possible way.

Since I started this journey, I have learnt to persist and not to give up. I have also learnt how important it is for you to be diligent and consistent in whatever I do. 

Finally I say a 'Big Thanks' to the Piper behind the flute, to those who has supported me in any way, to Dev community for a Platform like this to share my story with all you wonderful readers and also to everyone reading this post.  

I hope to update you all when I get to my destination.
[SUGGESTION] Installer plusieurs extensions Joomla! différentes en une seule fois
Tags: blog
Published: 2021-07-19 00:12:26

---
title: [SUGGESTION] Installer plusieurs extensions Joomla! différentes en une seule fois
published: true
date: 2021-06-04 23:06:48 UTC
tags: Blog
canonical_url: https://alexandre-elise.fr/blog-developpeur-joomla/installer-plusieurs-extensions-en-une-fois
---

![](https://alexandre-elise.fr/images/andrew-wulf-59yg_LpcvzQ-unsplash-optimized.jpg)

Salut Super Joomlers!

Juste une tite question: Pour vous, serait-ce utile d'avoir la possibilité de pour installer plusieurs extensions de développeurs différents en une seule fois par simple glisser- déposé?

Pour l'instant Joomla ne permet que d'installer une seule extension par glisser-deposer.

Je sais qu'il y a les packages mais c'est pour le et la même développeur-euse. J'attends vos retours et suggestions.
SUGGESTION - Installer plusieurs extensions Joomla! différentes en une seule fois
Tags: blog
Published: 2022-11-12 17:58:05

---
title: SUGGESTION - Installer plusieurs extensions Joomla! différentes en une seule fois
published: true
date: 2021-06-04 23:06:48 UTC
tags: Blog
canonical_url: https://alexapi.cloud/blog-developpeur-joomla/installer-plusieurs-extensions-en-une-fois
---

![](https://alexapi.cloud/images/andrew-wulf-59yg_LpcvzQ-unsplash-optimized.jpg)

Salut Super Joomlers!

Juste une tite question: Pour vous, serait-ce utile d'avoir la possibilité de pour installer plusieurs extensions de développeurs différents en une seule fois par simple glisser- déposé?

Pour l'instant Joomla ne permet que d'installer une seule extension par glisser-deposer.

Je sais qu'il y a les packages mais c'est pour le et la même développeur-euse. J'attends vos retours et suggestions.
[SUGGESTION] Glissez-déposer vos liens de menus quelque soit leur profondeur
Tags: blog
Published: 2021-07-19 00:11:56

---
title: [SUGGESTION] Glissez-déposer vos liens de menus quelque soit leur profondeur
published: true
date: 2021-06-04 22:29:52 UTC
tags: Blog
canonical_url: https://alexandre-elise.fr/blog-developpeur-joomla/glisser-deposer-lien-menu-profondeur
---

![](https://alexandre-elise.fr/images/francesco-ungaro-UOJoO383Ezo-unsplash-optimized.jpg)

Salut Super Joomlers!

Encore une idée qui m'est venue car confronté à une expérience utilisateur dans l'admin de Joomla! 3 (je n'ai pas essayé dans J4 pour l'instant). Voici le problème : Pouvoir utiliser le drag-n-drop pour modifier l'ordre des liens de menus Joomla! quelque soit la profondeur du menu. Actuellement on ne peut modifier l'ordre en drag-n-drop que pour les liens de niveau 0. Avez-vous rencontré cette problématique? Si oui une solution à ce problème précis vous intéressait t-elle? J'attends vos avis et retours amis joomleur-euses
SUGGESTION - Glissez-déposer vos liens de menus quelque soit leur profondeur
Tags: blog
Published: 2022-11-12 17:49:52

---
title: SUGGESTION - Glissez-déposer vos liens de menus quelque soit leur profondeur
published: true
date: 2021-06-04 22:29:52 UTC
tags: Blog
canonical_url: https://alexapi.cloud/blog-developpeur-joomla/glisser-deposer-lien-menu-profondeur
---

![](https://alexapi.cloud/images/francesco-ungaro-UOJoO383Ezo-unsplash-optimized.jpg)

Salut Super Joomlers!

Encore une idée qui m'est venue car confronté à une expérience utilisateur dans l'admin de Joomla! 3 (je n'ai pas essayé dans J4 pour l'instant). Voici le problème : Pouvoir utiliser le drag-n-drop pour modifier l'ordre des liens de menus Joomla! quelque soit la profondeur du menu. Actuellement on ne peut modifier l'ordre en drag-n-drop que pour les liens de niveau 0. Avez-vous rencontré cette problématique? Si oui une solution à ce problème précis vous intéressait t-elle? J'attends vos avis et retours amis joomleur-euses
What is MongoDB Atlas?
Tags: mongodb, database, serverless
Published: 2021-06-04 22:09:50

The Atlas cloud database is a fully managed database built for a wide range of applications with MongoDB at its core. In this post we look at how Atlas helps you visualize, analyze, export, and build applications with your data. It has many different services and tools available within it, all of which use MongoDB database for data storage and retrieval. In this post, we will use Atlas to set up your database in the cloud.

![mongoDB Atlas chart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ts2a4okfbuxssornps4g.png)

Atlas users can deploy clusters, which are groups of servers that store your data. These servers are configured in a replica set, which is a set of a few connected MongoDB instances that store the same data. An instance is a single machine, locally or in the cloud, running a certain software. In this case the MongoDB database being run in the cloud. The setup ensures that if something happens to one of the machines in the replica set, the data will remain intact and available for use by the application by the other remaining working members of the replica set.

![replica set](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yx79cyotm3ll5xa189rz.png)

###Services
So, every time that you make changes to a document or a collection, redundant copies of that data are stored within the replica set. When you deploy your cluster for your application, it will automatically be configured as a replica set. While you don’t need expert knowledge of clusters and replica sets to get started with MongoDB, I wanted to give you a brief overview of them. So that you can navigate Atlas, Mongo’s documentation, and other posts with ease. Atlas manages the details of creating clusters for you, which simplifies the operational overhead of running and maintaining a database deployment. This includes deployment across cloud providers and regions of your choosing. Atlas is also a great way to experiment with new MongoDB tools and features, which is why we chose it for this course.

###Pricing
Atlas has different pricing levels, depending on the size and usage of your database. In this series we will be using the Atlas free tier, which allows you to deploy a free cluster. A free tier cluster is a three-server replica set with 512 megabytes of storage. Free tier clusters never expire. Under the free tier you’ll have access to a subset of Atlas features, like Charts and Realm, which will be discussed later in this series. If you are learning how to use MongoDB or creating small-scale applications, a free tier is a great option for storing your data.

TLDR:
###MongoDB Atlas
* Clusters are groups of servers that store your data
* Replica Sets are a set of a few connected mongodb instances that 
  store the same data