Kids and Not a Lot of Sleep

Today I didn't get a lot of “work” done. My daughter woke me up a few times this night, so I only got a couple hours of sleep. Pair that with having a day job, and there's not a lot of energy left for doing tasks that require some concentration. In my spare moments, I keep up with articles about programming. For example, I found this React book by Chris Noring today.
Read more →

Run Docker nginx as Non-Root-User

How to run nginx as non-privileged user with Docker nginx is an open-source solution for web serving and reverse proxying your web application. You put it “in front” of your different services, and nginx can route the traffic to the correct url. That's useful for micro-services, for example. Per default, nginx runs as root user. Why? Only root processes can listen to ports below 1024. The default port for web applications is usually 80 or 443.
Read more →

TIL: Replace Local Files With Remote Files With Git

Read more →

Test Redirect With Jest, React-Router and React-Testing-Library

You've set up react-testing-library with Jest and react-router. You want to check that a component successfully redirects to another page. But how? Your React application comes with a protected route. If a user is not authenticated, the app should redirect the user to the login screen. You've managed to set up react-router-dom for your component. For example, here's an excerpt from a UserStatus.jsx component that only an authenticated user should be able to access:
Read more →

Friday Picks 031

Read more →

Month of Testdriven Python and React

Read more →

Tmux Workflow

Now that we've installed tmux, the terminal multiplexer, how do we use it? Start your project from your shell In the terminal, I navigate to the directory containing my project. Start a new tmux session tmux new -t <project-name> I usually name the tmux session after the project directory to avoid confusion. For example, if the project folder is called flask-react-auth, I create a new session with: tmux new -t flask-react-auth.
Read more →

Ideas for 2020

Read more →

Make Vim Work With Tmux

I've been toying around with tmux today. tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal. My terminal of choice is kitty, a GPU-based terminal emulator with tons of options. kitty even offers windows and tabs, so I didn't need to use tmux for creating new terminal panes.
Read more →

TIL: Typescript Still Coerces Types

Here's a simple TypeScript function: function f() { const a = 2 const b = 'a string' return a + b } What I expected: TypeScript can infer types. It will recognize that a is of type number and b is of type string. I expected a type error, because I try to add a string to a number. You can also be more explicit and tell TypeScript the types. Like so:
Read more →