RSSAmplifier

Blog

Shuhei Kagawa

A personal website of Shuhei Kagawa. I write mostly on web technologies and life.

shuheikagawa.comRSS feed ↗20 posts

Latest posts

Building a toy browser

In the last several weeks, I have been building a toy browser based on an online book, Web Browser Engineering . As someone who spent a fair share of his career on web frontend, it was eye-opening and satisfying. It felt like I had been living on one side of a wall for years and finally visited the other side of the wall. I imagine other web frontend folks would like it as well. The book Web…

2021 in review

I turned 40 this year. I've lived roughly half of my life—in a happy case. If time gets faster as we age, it'd be more than half. But 2021 didn't feel short to me, probably thanks to a lot of changes this year. Move My biggest event this year was the move to Switzerland. In December 2020, I started working remotely from Berlin for a team in Zürich. Then I flew into Zürich at the end of March and…

New look

I updated this website’s design and replaced its static site generator with Eleventy. Here are some notes about the new look and implementation details. Design I had used only sans-serif fonts on this website. Serif fonts felt too fancy. But I like serif fonts on paper books. Many of them use serif fonts regardless of the fanciness of their contents. I wanted to do so for my website as well. But I…

Making coffee at home

In this stay-home time, I started making coffee at home last November. I’m quite happy with this new hobby and wanted to share the fun here. My coffee history I was not a coffee person. My regular drinks at Starbucks in Tokyo were chai latte in the winter and matcha frappuccino in the summer. I had cappuccinos (or cappuccini !) at non-Starbucks cafes, but I never made coffee at home. I started…

Things I wish I knew about home office ergonomics

Here are some tips that I learned through my own mistakes. I’m not an expert, and I know I’m late to the train. But I hope you find some of the tips useful! Start from your body Find furniture and equipment that fit your body. Not the other way around. I made a mistake on it when I bought my standing desk. To have a good posture, check the following requirements: Chair: Your feet should rest flat…

2020 in review

It’s already been two weeks in 2021, but I’ll write anyway in the spirit of better late than never. 2020 was finally over. It was a weird year. Time flies, but things that happened feels like a long time ago. Work I had been working in the same area as before at Zalando. But I was not bored. My team welcomed new members. I helped building a brand new product. I was promoted. The new role exposed…

4 years at Zalando

I’m leaving Zalando with fond memories after 4 years. Here I’m writing down my experience. It’s never comprehensive, but I hope some people find it interesting! Beginning I had lived mostly in Japan for 34 years until 2016. I wanted to travel more, but I was lazy. I decided to work abroad so that I could travel while earning money. A job-matching website called Honeypot introduced me to Zalando. I…

Switching color schemes of Vim and Alacritty

I like fountain pens and good notebooks. They spark joy when I write on paper. Computer terminals are like stationery. A good terminal setup makes it fun to work with computers. Here is how I improved colors on my terminal and made it easy to switch them depending on the time and the mood. Using official color schemes I have been using Dracula color scheme on Vim and Alacritty for a while. I liked…

Goodbye, Textile

Textile is a markup language that is similar to Markdown. This blog had had posts written in Textile for more than a decade—I feel old now! I removed the Textile files last weekend. This post is a memoir on the markup language. I started using Textile on a blog engine called Textpattern . I don’t remember exactly when, but probably around 2004 or 2005. I was a university student. Movable Type was…

Responsive images with a static site generator

Responsive images An img without width / height attributes causes a page jump when it's loaded. It happens because the browser doesn't know the dimensions of the image until its data is loaded—only the first part that contains dimensions is enough though. It's common to specify width and height of img tag to avoid the jump. < img src = "/images/foo.jpg" alt = "Foo" width = "800" height = "600" />…

Winter terminal (mostly Vim) cleaning

In December, I spent some time cleaning up my terminal setup. Dust had piled up in a year, and my terminal was getting slower. It was time to dust off. Here are highlights of the changes . Faster text rendering I noticed a non-negligible lag when I was editing JavaScript/TypeScript in Neovim. At first, I thought some Vim plugins caused it. But it was not true. Not only editing was slow, but also…

2019 in review

Travels I visited six new countries and enjoyed each of them. January: Japan March: Budapest, Hungary April: Athens and Aegina, Greece April: Wrocław, Poland June: Prague, Czech Republic August: Brussels and Bruges, Belgium September: Munich, Germany October: Dubrovnik, Croatia November: Japan There are many more places to visit in Europe. I'll keep traveling in 2020. Bike I bought an entry-level…

Generating Twitter Card images from blog post titles

Twitter shows links to some websites as nice cards with images, but not for all websites. I realized that Twitter didn't show the card for my blog. Why? It turned out that they were called Twitter Cards, and Twitter showed them for websites that provided specific metadata. Is it common sense? Maybe, but I didn't know. Twitter Cards give websites an ability to add an image, a video, etc. when they…

Migrating from bash to zsh

A few days ago, I updated my Macbook Air to macOS Catalina. The installation took some time, but it was done when I got up the next morning. The applications that I use seemed to work fine on Catalina. But bash started complaining at the beginning of new sessions. The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please…

Writing an interpreter and a compiler in Rust

In the spring of this year, I read Writing an Interpreter in Go and Writing a Compiler in Go by Thorsten Ball , and implemented an interpreter and a compiler from the books in Rust. (I started writing this post in April but left unfinished for six months. Now I'm finishing it.) The first book Writing an Interpreter in Go is about writing a parser and an interpreter for a programming language…

DNS polling for reliability

In December 2018, I wrote a package to poll and cache DNS records, pollen , as a mitigation for incidents at work. My team at work migrated our Node.js servers from AWS EC2 C4 instances to C5 instances. Then mysterious timeout errors on outbound HTTP(S) calls started happening. They happened only in an availability zone at a time. We tried different things to investigate the issue, like profiling…

Check your server.keepAliveTimeout

One of my Node.js server applications at work had constant 502 errors at AWS ELB (Application Load Balancer) in front of it ( HTTPCode_ELB_502_Count ). The number was very small. It was around 0.001% of the entire requests. It was not happening on other applications with the same configuration but with shorter response times and more throughputs. Because of the low frequency, I hadn’t bothered…

2018 in review

Looking back 2018, it flew like an arrow. It was so fast that it's already in February 2019! Move We had lived in an apartment on the border of Schöneberg and Wilmersdorf for 2 years, and decided to move out at the end of October without extending the contract. We spent two or three months for flat search, and a month and a half for moving, buying furniture and setting up the new apartment. After…

Histogram for time-series metrics on Node.js

The "metrics" library I have been using metrics library for application metrics of Node.js applications at work. It was already widely used in the company when I joined, and I kept using it without questioning much. The metrics library was ported from Dropwizard metrics , which is a widely-used metrics library for Java and also called as Coda Hale metrics, Yammer metrics, or Metrics Core. It…

Node.js under a microscope: CPU FlameGraph and FlameScope

Last week, I had an opportunity to talk about profiling Node.js applications on production at an internal guild meeting at work. Here is a written version of it plus some additional information. Background I have been working on Node.js microservices, which fetch data from API servers and render HTML with React, at work. We monitor response times at load balancers, in application metrics and with…