-
Bitbucket pipelines git folder permission issue
I recently started having problems working with git repos inside bitbucket pipelines. After doing some tests with git fetch -vvv command I got the following error Apparently the $BUILD_DIR folder is not owned by the user running the pipeline by default – like it used to be until recently. As a workaround this problem you…
-
Email headers to improve spam assassin score
With spam check you can get tips on improving your spam assassin score and avoid having your emails filtered as spam. I was able to improve my score substantially by improving 3 headers Missing date In the screenshot you can see spam assassin gives 1.4 point if the date header is not included. Let’s add…
-
Improve docker container speed on Big Sur
I use docker containers when developing daily, and I found the performance on I/O operations inside the container was very poor. With a bit of investigation I found using an NFS volume to mount the host directory inside the container improved this by orders of magnitude. In a nutshell: Step 1: Run this script to…
-
Parse empty array in YAML file
If you need to define an empty list in a YAML file use this Refererence: https://stackoverflow.com/a/5110341/1731531
-
Tip to speed up Pylance Language server in VSCode
I recently experienced a significant slowness on the Pylance language server while using it inside a development container within VSCode. The output of the language server detects this and throws an error if the enumeration of files takes more than 10 seconds I tried excluding certain files of my workspace to reduce this time, by…
-
Richly-formatted slack messages
Slack provides an easy way to programmatically send messages to a channel. In this example I use the custom integration “Incoming webhooks” you can find in the Slack configuration. For instance, the payload Will render a nice slack message with a different spacing for each data point in “fields”. The name of the bot can…
-
Tips for testing React applications with Cypress
I noticed my React components get translated into DOM elements with their name in the class attribute. I have used this in Cypress to get the elements without using `data-` attributes. I have a Card component created using styled-components that gets translated into a div like this The beginning of the class attribute value is…
-
Deeply seek in highly nested dictionary
I had to find a dictionary by key-value pair inside a deeply-nested dictionary. This dictionary contains nested dictionaries and lists containing more dictionaries. I ended up using a recursive approach with generators in python Lets look at a test method that illustrates how nested_dict_lookup works As said before nested_obj_lookup returns a generator, and every time…
-
Using AWS IAM roles to access resources from Bitbucket Pipelines
Using AWS credentials (access key ID and secret access keys) directly in BB pipelines is a bad idea. These credentials give access to all AWS resources when in most cases your Bitbucket pipelines need a reduced set of permissions to carry out the intended work. A better approach is to use AWS IAM roles that…
-
Sort results by DateTime columns containing NULL values
In SQLAlchemy, you might want to sort rows by a column updated_at to keep records with some activity at the top of your list. The problem is updated_at can be NULL if your record has recently been created. To handle these cases cases you can use nullsfirst and nullslast for the ascending and descending cases…