Posts

New blog domain: kula.blog

It's still work in progress but new posts will be published on  https://kula.blog/ Thanks to 11ty base blog RSS is working from the start so it should be easy to add to your reader if you still use any :) If now then I hope you can sign up to the newsletter where I'll be publishing new posts and interesting articles to it from time to time. Please use  kula.blog  from now on.

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

Image
Photo by Tim Gouw from Pexels 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:  https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch 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

Image
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 Essent...

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

Image
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:  lubimyczytac.pl

Pomodoro Yo-yo Effect

Image
Recently I started feeling stressed and less productive which forced me to be more conscious of my work, habits and everything around it. Thanks to that I noticed: I got a lot of notifications from Slack, Messenger and Email. I felt anxious before starting new tasks. My focus wasn't predictable, especially on harder tasks. Don't get me wrong, I felt great most of the time, especially when I sat for hour or two at a time coding. The troubling thing was that it wasn't every day and I felt it was getting worse. Most of those problems should be fixed by Pomodoro techinique I was writing about before, did it stop working? The thing is, I stopped using it. A couple of months ago I noticed that staring new tasks, and taking breaks is actually a hindrance. I could easily focus for an hour or more on a task and basically forget about Pomodoro, and feel guild about not following it or not keeping proper count. I've decided that it wasn't necessary anymore. ...

Book Review: Influence by Robert B. Cialdini

Image
I published a new review on Medium.com:  https://medium.com/@krzychukula/book-review-influence-by-robert-b-cialdini-f4575b6786a4#.55i8vpylc

Morning Paper Series About Architecture and The Rise of Worse is Better

Image
I was reading a really good series of articles on 'the morning paper' that I found myself going back to almost every week. Take a look if you don't know them but this list is mostly for me to make it easier to reference them :) https://blog.acolyer.org/2016/09/07/the-emperors-old-clothes/ https://blog.acolyer.org/2016/09/08/computer-programming-as-an-art/ https://blog.acolyer.org/2016/09/09/reflections-on-trusting-trust/ https://blog.acolyer.org/2016/09/14/why-functional-programming-matters/ https://blog.acolyer.org/2016/09/15/the-rise-of-worse-is-better/

Small improvements to keyboard layout

Image
There is a new post on my medium account about new experiment I'm starting and how to setup it for yourself: https://medium.com/@krzychukula/customizing-keyboard-layout-on-mac-572327b031dd#.w6hcwik6z TLDR: Remapping Caps-Lock to Backspace and disabling standard Backspace Switching Right Command and Option(Alt) for writing in Polish