5 things I learned from "How to train your BASH" by Marcin Stożek "Perk"

Today I've watched a presentation by Marcin Stożek called How to train your BASH and wanted to remember the most interesting points for later.

1. It's best if you follow a style guide There seems to be only one though Google Shell Style Guide.

2. You can set Bash to "strict mode" It sets more human-friendly defaults and makes sure you won't miss any errors in your scripts.


set -euo pipefail


3. Shellcheck Turns out there is a tool called shellcheck that can help you write scripts that you intended to write. Best thing is that it explains what's wrong and gives you suggestions on how you can fix it.

4. You can enable 'debug mode' when running your script Just pass "-x" to the script eg.
 > bash -x ./

5. Use Pure Bash
No one wants to see weird errors when running the script on a new server so it's best if you avoid using external programs in your scripts. 

There is much more in the presentation so …

You want to stay relevant as a software developer for the next 10 years?

This tweet made me remember my own pondering of the exact same question and how hard it is to guess what is going to be relevant in the future.

A lot of people answer that by saying that you have to always learn but the question is not "Should I learn?" but "What I should learn?".

Unfortunately, no one can predict the future. I would even say that the question itself is flawed.

I'm reading Farnam Street blog for some time already and one of the last posts goes deeper into this problem:What’s Staying the Same?

If you start looking for things that are likely to stay the same you will find a lot of things that are worth learning and they should be relevant a lot longer than the newest fad.

More to read:
Lindy effectAlgorithms to Live By

Book Review: Algorithms to Live By: The Computer Science of Human Decisions by Brian Christian and Tom Griffiths

I liked the idea of the book form the first time I've seen the title and fortunately, it lives up to my expectations. It's not perfect, but it rekindled my curiosity towards math and algorithms. Bringing them to everyday problems makes them much more interesting.

The only thing that I'm missing in the book is the application of algorithms in business settings. For example, when I mentioned this book Mateusz K he has sent me a blog post of  Pieter Hintjens: Amdahl to Zipf: Ten Laws of the Physics of People. For example, Amdahl's Law mathematically proves the argument from The Mythical Man-Month that you can't just add new people to the project to deliver it faster because of the cost of synchronization.

I want this post to be a reminder for myself of the most interesting ideas in the book so if you want to savor it yourself just remember that it's worth buying.

Rating: 9/10
Contents: 1. Optimal Stopping Probably the most interesting from this chapter was the ru…

Book Review: Masters of Doom by David Kushner

The book that I wanted to read for a long time. How was it?

I have to say that it's really good. I learned a lot about Id and both John Carmack and John Romero - how their lives looked up before and during the creation of the most know Id Games like Doom or Quake. What was depressing but also making it so much more real is how much politics and infighting happened between all those people working in the industry at that time.

The only downside for me is that there's not much about the technology side of things. There is a paragraph here and there but most of the book is about two John's allowing you to take a look inside their heads. Maybe another downside as not native speaker would be the font - that made it harder than necessary to read.

All in all, I highly recommend it. 8/10

I've spent an hour debugging XSRF error because of ... fetch

Yesterday we were working on a new subpage with a form. Let's use the new `fetch` API to make POST requests seemed like a good idea but we started getting errors from the server:

`HTTP 403: Forbidden (XSRF cookie does not match POST argument)`

Header `X-XSRFToken` was set, we tried passing value in the body, setting token in the template, setting it in the backend only in certain cases but nothing helped. Finally my coworker found out that we're not sending `_xsrf` cookie with the request at all so it generates a new one every time...

Turns out fetch doesn't send cookies by default. It's by design:

The fix is incredibly simple: tell fetch to include credentials in the options:

fetch("/someURL/", {
    method: "post",
    headers: {
       "X-CSRFToken": token
    credentials: "include"


Book Review: The Art of Manliness: Classic Skills and Manners for the Modern Man by Brett McKay

I'm a a listener of The Art of Manliness podcast for over a year now and just before my last vacation I decided to buy the book. Partly as a support for the podcast and partly to get my own opinion about it (reviews are really all over the place from 1 to 5 starts on Goodreads).

If you read most critical reviews you will find that Bret McKay draws a lot of inspiration from 19th century gentleman. You can think about your grandfather more than your father kind of man being the inspiration for this book. There is a bunch of practical advice on all kinds of topics from shaving, dressing to raising kids but also a lot of trivia and random facts you won't really need so you have to pick yourself.

There is one annoying quirk of this book though, it tries to explain things with words that should be explained with images. I have skipped most of tying knots and ties for that reason. I've noticed that there's a new book called The Illustrated Art of Manliness: The Essential How…

Book Review: Sapiens: A Brief History of Humankind by Yuval Noah Harari

That's my first review in a pretty long time, but I decided to only review good books - the kind I'm recommending and giving to my friends.

I heard about "Sapiens" a couple of times but I bought the book after learning more about the author and seeing that Cal Newport recommends the book as well. You can read about the author at Yuval Harari Works Less Than You maybe you will get interested the same way I did.

Sapiens starts when humans were hunter-gatherers and brings us to modern times. Most important is his perspective and high level view on agriculture, religions, ideologies and nations. Most striking was how much modern culture we live in is just another kind of ideology and how important it is for people to believe in the same things.

Rating: 10/10. Must read.

I was reading it in english but I liked the books so much that I bought Polish paper edition as well. Polish readers can find shops at: