Tangible Bytes

A Web Developer’s Blog

Prettier in Docker

I’m working on a PHP project and code review brought up some formatting issues in my CSS.

I wanted to added automated formatting of these files accessible to everyone in the team without them having to install node as this isn’t a JavaScript project.

We already use Docker so that seemed an obvious choice.

Read more ...

Laravel Formatting with ‘Pint’

Code reviews are a real opportunity to learn from each other - we each write code a little differently and bring with us a range of experience. So much better to spend time on this than debating blank lines.

I’m also slightly dyslexic and find it hard to even see the issues some care passionately about.

I want to do the right thing for the team but going through code line by line and applying a strict set of rules is not something I am good at or enjoy.

Computers are good at following rules though.

Read more ...

Unicode

A couple of things about UTF-8 have eluded me for a while …

I knew that the first bit of ASCII (the bit people agreed on) is the same in ASCII and UTF-8

I knew that the rest of Unicode needs 2 or 3 bytes

But I wasn’t clear how you could tell how many bytes needed to be read at a time

And mostly I didn’t need to because the computer does it all for me - but those bits of vagueness can catch you out and so I went down the rabbit hole and it turns out to be fairly short.

Read more ...

Prometheus Excess CPU/RAM Issue

A key part of any modern infrastructure is good monitoring, even on my local desktop system I like to have monitoring in place so that if a problem gradually builds up I can trace where it started.

Unfortunately in this case the monitoring system actually caused the problem and Prometheus was using up all my system CPU and RAM.

Read more ...