Skip to content

Instantly share code, notes, and snippets.

View julianlam's full-sized avatar
I may be slow to respond.

Julian Lam julianlam

I may be slow to respond.
View GitHub Profile
julianlam /
Last active October 10, 2023 14:59
DMM Ceros Locksafe; A Review #blog

Product photo of the DMM Ceros Locksafe Carabiner

Soon after field testing the Mammut Smart 2.0, I became acutely aware that the carabiner I had paired with the device — the Metolius Element II — was sub-optimal:

  1. The I-shaped stock in the basket end meant that there was less surface area in contact with the rope, and brake effectiveness was reduced.
  2. Lack of anti-crossloading features meant that the carabiner sometimes flipped/rotated during usage.

The two features I needed for it to pair nicely with the Smart:

  1. Round stock at the HMS end
julianlam /
Last active October 9, 2023 01:07
Test driving the Mammut Smart 2.0; A Review #blog

The Mammut Smart Belay Device

Having been climbing more seriously for the last 6 years, my exposure to belay devices has been restricted to that which my local gym allows — that is — the Grigri.

Since its introduction in 1992, the Grigri has become a ubiquitous item at climbing gyms and crags. As an assisted belay device, it offers unparalleled performance and positions itself as a solid alternative to older belay plates and tubes.

When I discovered that there were other products on the market that offered similar benefits to the Grigri, I jumped at the chance to test-drive them. My search brought me to two popular contenders, the Black Diamond ATC Pilot, and the Mammut Smart 2.0.

I later purchased a Smart from my local retailer and finally had the opportunity to put it to use today. The following is a brief usage review including some pros, cons, and surprises. T

julianlam /
Created August 15, 2023 15:47
Inserting an HTML string to the DOM #blog

Question: How do you insert an HTML string (e.g. <p>this is a paragraph <a href="#">with an anchor!</a></p>) into the DOM?

It's easy with jQuery, $(htmlString). But what if you don't want to use jQuery? It's also pretty straightforward.

const container = document.getElementById('container');
let html = '<p>this is a paragraph <a href="#">with an anchor!</a></p>';
html = new DOMParser().parseFromString(html, 'text/html').body.childNodes;

julianlam /
Last active July 12, 2023 18:06
How to have Node.js trust Caddy self-signed certificate #blog

Caddy has a neat feature where all routes automatically come with HTTPS enabled. Caddy achieves this by self-signing its own certificate via a certificate authority that is (or can be) added to the system CA list.

However, Node.js comes bundled with its own certificate authority list, so even if Caddy's CA is added to the system, Node won't allow it.

Here's how to allow calls to local https services served by Caddy:

  1. If needed, run caddy trust as root to install the Root CA.
  2. Run node with the environment variable NODE_EXTRA_CA_CERTS and point it to the local CA file.
    • Not sure what that is? Maybe you're on Debian or a derivative (e.g. Ubuntu, Pop!_OS, etc.): NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
julianlam /
Last active June 11, 2023 22:08
No-Bake Lactation/Energy Bites #blog

My wife found this recipe for energy bites that contain galactagogues — milk-promoting foods and herbs that could aid in building milk supply.

They also double as a really tasty (and energy-rich) snack for days when you just want something quick!

I had this recipe written down in my notebook, but I refer to it often enough I may as well put it up here as well. It also contains measurements for the tackier liquid ingredients in GRAMS, because measuring larger volumes of things like peanut butter and honey by volume don't make much sense due to variability.


julianlam /
Last active January 16, 2023 15:40
Re-tuning the ol' Hi-Fi #blog

For the longest time now, I've wanted to clean up and upgrade my Hi-Fi system, although what I had was "good enough" in many respects. I'm not audiophile by any stretch of the imagination, so I've felt that my needs were fairly minimal.

The reasons for having a Hi-Fi system at all were straightforward:

  1. I dislike how tinny TV speakers are, and how they point backwards/downwards from the back of the TV
  2. Bass response is often lacking — I once watched The Dark Knight at a friend's place, and couldn't get into it because the tiny TV speakers attempting to produce bass would just heavily distort any other sound coming from them.

For reference, my setup was inherited from my parents, who had used it back before I was born!

julianlam /
Last active November 28, 2022 22:24
Guide: MythTV 32, Hauppauge WinTV-quadHD, and Pop!_OS 22.04 #blog

As a cord cutter, I am an advocate of taking advantage of local broadcast signals in my area.

Not sure what kind of channels you'll get? Head on over here and find out

The following is a rough guide as to how to install MythTV on a machine running Pop!_OS 22.04.

Format the machine to Pop!_OS 22.02

julianlam /
Last active November 14, 2022 16:16
Sausage and Rapini Pasta #blog

No nonsense, just the recipe.

— Julian.

This is one of my go-tos for a weeknight dinner that is delicious, quick and easy to prepare, and does not break the bank.


julianlam /
Last active October 31, 2022 15:11
Fixing the burner on my GE stove #blog

I have an electric stove. It came with my house.

As an aside, since I moved into my house in 2015, every single major appliance in my kitchen has had some sort of defect. I suppose it says something about the quality of appliances nowadays.

One day the front 10-inch burner stopped working. Too bad, it was my favourite one!

A house call from a repairman later, I was told that the most likely culprit was the infinite switch behind the panel. Unfortunately, this ends the repairman's role, as he soon stopped returning my calls. Apparently, this was too small a job for him.

Complicating matters is that appliance manufacturers seem to have hundreds (if not thousands, by now) of models, all with subtle variations and combinations of parts, features, aesthetics, etc. There are some good websites that help you find out which part goes with which stove, but sometimes they have contradictory information too.

julianlam /
Last active September 23, 2022 15:13
Using `xargs` to `cd` into places and do things #blog