Month summary - July 2021

Posted by Tobiasz Kedzierski on 31.07.2021

July 2021

I am aggregating here some more or less interesting stuff of various IT related materials which I came across this month. Some of them are strictly related to the things I did or am currently doing.

Some thoughts

During my work in the office I found out that many times the use of Git is discussed during quick chats or coffee breaks. There is nothing wrong with this, however short discussions do not give space for deeper explanation or analysis. I decided that a presentation about Git will fill this gap which resulted in Brival Tech Talk: GIT - tips & tricks. I've expanded topics from my post on Git: Changing history in Git.

I talked about:

  • git config
  • pre-commit
  • fast-forward or not
  • git add --patch
  • git commit -a, -m
  • git adog
  • git log master..@
  • git reflog
  • git revert
  • git commit --amend
  • git rebase
  • git rebase --interactive
  • git rebase --interactive --autosquash --autostash
  • git rebase --exec

I hope it is helpful and shows some less obvious ways of using Git. I spent some significant time reading related articles and documentation. I tested commands and concepts in the field as well because the presentation was conducted hand in hand with a live demo. I found it helpful.

Brival Tech Talk - GIT tips & tricks

Articles

How to Study for Data-Structures and Algorithms Interviews at FAANG

I went from 0 → 100 in just a few months and I didn’t do anything special aside from studying consistently. That’s why I strongly believe any engineer can get good at these DS & Algo questions and get into F.A.A.N.G. or similar high paying roles.

How I Made a Giant Mistake with Terraform (and How Azure Made It Worse)

I made a huge mistake a while back, resulting in all preproduction environments being deleted from a client’s Azure subscription. That’s actually not so bad – we use terraform to create the environments, so we could just run the terraform again to put them back. And better preproduction than production, right? But Azure quirks and client rules made this considerably worse.

The 17 Ways to Run Containers on AWS

As I mentioned on Twitter last week, there are 17 ways to run containers on AWS. While I pulled the number “17” out of the air, I have it on good faith that this caused something of a “meme explosion” inside of AWS.

Keeping your GitHub Actions and workflows secure: Preventing pwn requests

TL;DR: Combining pull_request_target workflow trigger with an explicit checkout of an untrusted PR is a dangerous practice that may lead to repository compromise.

What I learned from Software Engineering at Google

When I first picked up Software Engineering at Google I thought it was another one of those FAANG books full of lessons that make no sense at human scale. I was surprised, the lessons apply to teams as small as 5.

Python

Python Type Hints - How to Avoid “The Boolean Trap”

“The Boolean Trap” is a programming anti-pattern where a boolean argument switches behaviour, leading to confusion. In this post we’ll look at the trap in more detail, and several ways to avoid it in Python, with added safety from type hints.

Django

One Database Transaction Too Many

How I told hundreds of users they got paid when they didn't!

PAGNIs: Probably Are Gonna Need Its

Any of the ideas I’ve shown here could take an engineering team weeks (if not months) to add to an existing project—but with the right tooling they can represent just an hour (or less) work at the start of a project. And they’ll pay themselves off many, many times over in the future.

Efficient Pagination in Django and Postgres

Django is an excellent framework for building web applications, but its default pagination method falls into this trap at scale. In this article, I’ll help you understand Django’s pagination limitations and offer three alternative methods that will improve your application’s performance. Along the way, you’ll see the tradeoffs and use cases for each method so you can decide which is the best fit for your application.

Tools

calibre

calibre is an e-book manager. It can view, convert, edit and catalog e-books in all of the major e-book formats. It can also talk to e-book reader devices. It can go out to the internet and fetch metadata for your books. It can download newspapers and convert them into e-books for convenient reading. It is cross platform, running on Linux, Windows and macOS.

Other stuff

MacOS setup

Scripts for setting up a brand new MacOS, and getting it ready to work in no time.

Survivorship bias

Survivorship bias or survival bias is the logical error of concentrating on the people or things that made it past some selection process and overlooking those that did not, typically because of their lack of visibility. This can lead to some false conclusions in several different ways. It is a form of selection bias.