Blog

learnings

Fixing high-DPI (retina) screenshot metadata

10 May 2020macospng

On my MacBook Pro with retina display, when I take a screenshot, the image is saved with a DPI of 144. But, using ImageOptim to compress the image with Strip JPEG/PNG Metadata enabled will remove (or reset) the DPI setting to 72 DPI - resulting in a double sized image when displayed in Preview and Quick Look. Here is how I correct this.

Continue reading...

macOS zsh configuration

07 May 2020macoszsh

From macOS Catalina 10.5 onwards, zsh is the default shell, instead of bash. I have a lot to learn about this shell, and so far, this is how I configured zsh... There is an overload of snippets on-line, but I’ve not seen a post doing what I do, so hopefully this helps someone!

Continue reading...

CSS tips to avoid Javascript

Recently I’ve been building a few web sites without JavaScript where possible, relying instead on modern browser support for CSS.

Here are some things I’ve figured out, including toggling the NavBar burger dropdown, smooth scrolling, showing and hiding modal dialogs with transitions!

Continue reading...

Static domain name resolution for Kubernetes pods

31 Mar 2020k8s

I recently needed to setup a Kubernetes cluster without an external DNS and without Internet access. In the old days, static IPs could be mapped to FQDNs by creating entries in the hosts file, but that won’t work with Kubernetes. With Internet access, the typical solution would be to use a wildcard DNS like xip.io or nip.io. Instead, the workaround is by hardcoding the mapping in the CoreDNS configuration.

Continue reading...

Shortcuts on iPhone home screen

23 Jan 2020iosworkflow

Here’s how I “changed” an app’s home screen icon on iPhone. I’m so OCD that I want my home screen dock icons (the tray at the bottom) to be all of the same colour! Actually, changing an icon is not possible, but creating a new shortcut with an icon of my choice is!

Continue reading...

Fixing Windows 10 100% disk by stopping SysMain

21 Jan 2020opinionwin10

I just spent hours trying to figure out and fix a Windows 10 machine that was taking 100% disk, 100% RAM and about 50% CPU with abolutely nothing running. Of course, I initially blamed the user... then, a misbihaving (hidden, background) app... then, malware / virus... the, a runaway Windows Defender... then, a hard disk / hardware failure... but ultimately discovering the culprit is - drum roll - Microsoft Windows itself! As usual!

Continue reading...

Single Page Bulma template with Smooth Scroll and Scroll Spy JavaScript

I was building a single page website using Bulma, and I wanted to achieve effects similar to what I was familiar with using Bootstrap’s Creative one page theme. As you know, Bulma (mostly) does not provide any JavaScript code, so I had to code the Smooth Scrolling and Scroll Spy features I missed. I intentionally avoided jQuery! So I present my solution using plain-old JavaScript.

Continue reading...

Word Macro to paste MS Office Drawing / TIFF image as PNG

I really don’t know how to explain today’s post. In short: I want to copy drawings and images out of Microsoft Office in PNG format. On macOS, copy-and-paste seems to prefer the TIFF format, resulting in large Office files. I’d rather the images be converted to PNG, preserving transparency but providing high compression. However, this is more complicated than it seems, because of limitations in Office and PowerPoint in particular...

Continue reading...