blog.8-p.info

I don’t like Google’s AMP project much, but this mix is good.

I used to leave my work laptop at office, except for on-call weeks and some crunch time. However since this pandemic, my work laptop is always on and connected to a larger display. It is essentially “ready”.

And then, I tend to do a bit of stuff there even after having dinner. That’s a bad habit which eventually results burnout. Or even it wouldn’t, I have other things to deal with. Work is designed to be achievable, manageable and somewhat fulfilling, whereas life is not. I must intentionally separate myself from work to do some hard stuff. I meant, hard for me. Like decluttering home.

From now on, I’m going to turn-off my work laptop after work. I usually don’t turn off laptops regardless of work or personal one, but I usually don’t work from home also. Different situation needs different solution.

A few years ago, I read Google Assistant’s tell me something good and learned about solutions journalism.

The stories come from a wide range of media outlets, curated and summarized by the Solutions Journalism Network. They’re a nonpartisan nonprofit dedicated to spreading the practice of solutions journalism, which highlights how problems are solvable and that doing better is possible.

Ever since I occasionally think about the mix of information I read. Don’t I read too much problems, without knowing the responses? The answer tends to be “yes”.

Honestly speaking, I haven’t figured out the way to read news as a grown-up. I was reading the New York Times’ Coronavirus newsletter in the beginning of this pandemic. It was good but I’ve unsubscribed that recently since things wouldn’t move that fast. I read neither daily newspapers nor the Economist magazine.

I used to use hugo undraft command but the subcommand was removed in 2018.

date '+date: %Y-%m-%dT%T%z' | sed -E 's/(..)$/:\1/g' | pbcopy

sed is needed since %z returns -0700 but TOML’s timezone offset has to be -07:00.

Support old C++ compilers that don’t have <filesystem>

bpftrace uses <filesystem> which is relatively new in the C++ world. Amazon Linux 2 has g++ 7.x, which doesn’t have <filesystem> but has <experimental/filesystem> instead.

I initially used __cpp_lib_filesystem, but it is defined inside <filesystem>. So checking that to conditionally include <filesystem> doesn’t work.

Then there is <version> which defines __cpp_lib_filesystem and all other feature macros. But this header is also relatively new. Loading this header itself may need another #ifdef.

I ended up having __has_include (<filesystem>). Apparently it is in GNU cpp and Clang, but C++ 17 makes it “standard”. Yay!