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
julianlam / datetime-local-across-locales.md
Created June 8, 2022 15:37
Testing `datetime-local` input across various locales #blog

Working with <input type="datetime-local"> is a lot of fun. All major browsers have standardized their UIs, and offer full support, and so the days of using polyfills or jQuery fallbacks are numbered.

Should you need support for older or more esoteric browsers, it may be best to fall back to a bunch of <select> inputs instead.

The cool thing about datetime-local is that the UI itself is localised based on the user's browser/machine language settings.

For example, in Canada:

image

@julianlam
julianlam / bye-fast-checkout-lanes.md
Last active May 30, 2022 15:54
The age of the fast self-checkout lane is over #blog

I have a not-so-secret confession to make — I use the self-checkout line at grocery stores because they get me out of the store faster.

The choice used to be simple: at any given checkout queue, the queue for the self-checkout is usually non-existant, and I am adept enough at the interface so that it is not overly cumbersome to use.

My so-called "Speed Hacks"

  1. If you take care to cart your items with all of the barcodes facing upwards, then at the scanner, you can use the hand-held scanner to scan everything without having to waste time turning the product across three dimensions trying to find the barcode1. The time spent locating the barcode is spread out across my entire shopping trip, instead of at the till. If you use the "skip bagging" option, then you can even leave the items in the cart, instead of needlessly scanning/bagging/carting your items.
@julianlam
julianlam / wannabe-security-researchers.md
Last active May 16, 2022 16:20
Wannabe "Security Researchers" are the worst part about running a bug bounty #blog

Where I work, we run a bug bounty. We've done this for a number of years, and it's yielded great results in that bugs that could potentially affect user data are quickly and quietly dealt with at our own pace, and we retain control over the narrative (as opposed to having it disclosed publicly and dealing with the fallout.)

By far, however, the most annoying part of running the bug bounty program are the wannabe security researchers.

You know the kind;

  • The ones who run automated scanners against every website they can find
  • The ones who copy and paste technical jargon from websites in an attempt to feign legitimacy
  • The ones who assign a "high" priority to their reports via subject—just to get your attention
  • The ones who, when pressed for details, have no clue what they're talking about or even reporting
@julianlam
julianlam / gmail-basic-html.md
Last active May 2, 2022 02:12
Quickly switch GMail to Basic HTML mode #blog

I often have to toggle between a number of GMail accounts because even though they are managed by Zendesk, occasionally ham is caught by GMail's spam filter and never makes it to Zendesk. I've had enough important messages fall through that I became suspicious, and then discovered that I have replies and incoming leads being caught almost weekly!

Anyways, in short, GMail takes bloody forever to load anything that isn't Chrome, and the UI is not very snappy. Clicking "Use Basic HTML" at the bottom left is pointless because it doesn't actually trigger right away, and I've already waited many seconds before it sends me to that interstitial page asking me if I really wanted to use Basic HTML. Oh the horror.

In the future, just append ?ui=html or /h/, and voila!, watch your mailbox load in .5 seconds, flat.

So in the future, accessing your main mailbox would be https://mail.google.com/mail/u/0/h/. Note the trailing slash, that's needed.

I really miss when webs

@julianlam
julianlam / port-forward-cheatsheet.md
Last active April 21, 2022 20:10
Forward port from remote server to local machine #blog

This is how to do it, because I have the memory of a goldfish and have to look it up every time.

The context

Let's say there's a server (123.123.123.123) running a service on port 1234.

You want to view it on your local machine on port 2345.

The command

@julianlam
julianlam / programmatically-setting-values-multiselect.md
Last active April 11, 2022 17:33
Programmatically getting & setting values of a multiselect (without jQuery) #blog

I came across an interesting problem without a good native browser solution, recently. Usually, browser APIs are so complete that this is a non-issue, but nonetheless...

The specific scenario involved a multiselect:

<select multiple id="mySelect">
  <option value="1">One</option>
  <option value="2">Two</option>
  <option value="3">Three</option>
 Four
@julianlam
julianlam / fido2-webauthn-pitfalls-solutions.md
Last active January 13, 2022 03:59
Node.js FIDO2/WebAuthn Pitfalls and Solutions #blog

While implementing what was supposed to be a rather straightforward use-case of second-factor authentication via WebAuthn, I ran into a surprising amount of roadblocks that made my implementation harder than it should've been. Complicating the procedure was that I initially implemented the hardware key checking using the old deprecated U2F protocol — which for the record, was more straightforward.

However, WebAuthn is the future — just look how slick this guide is! If that's not going to make you think it'll be done lickity-split, I don't know what will. Reading through that helpful guide (put together by the fine folks at DUO), I couldn't help but be struck by how "enterprise-y" it all felt. It did not bode well, and my fears were not unfounded.

I decided to put this post together as a catch-all for the problems I faced in my implementation, and direct links or write-ups to the solutions.


MDN docs, what MDN docs?

@julianlam
julianlam / gooseneck-kettle.md
Last active January 6, 2022 18:08
Do you really need a gooseneck kettle? #blog

What's the big deal behind a gooseneck kettle anyway?

Mighty-Lobster asks:

Do I really need a goose neck kettle? I've seen several articles claiming that I totally need one for pour over coffee but they can't manage to articulate why it's going to help me in a language that I understand. "It helps you control the flow rate!" ... Uhm... sure. How is that going to make my coffee better? What happens if my coffee rate is wrong?

Like Mr. Lobster, I was also of the opinion that a gooseneck kettle couldn't possibly offer that much more to the coffee brewing process, compared to being careful with a regular wide-spout kettle.

While in some ways I was right, I was also quite mistaken.

@julianlam
julianlam / my-coffee-journey.md
Last active December 30, 2021 14:59
My Coffee Journey #blog

It recently dawned on me just how many variables go into a cup of coffee. The same could probably be said of tea, or audio equipment, or any other hobby that people pursue. After all, if it's worth doing, it's worth overdoing, no?

My coffee journey has only really just begun (as of writing, November 2021), mostly as a consequence of staying and working from home, and picking up new hobbies during the COVID-19 pandemic. I don't consider myself a coffee snob, despite what all of my friends and family say, but more like a coffee snob wannabe. I could certainly go whole-hog into getting all the best equipment and single-origin beans, but I am a firm believer that a little effort will get you 90% of the way there, and everything else is chasing after that elusive remaining 10%1.

The update (December 2021)

PXL_20211230_142801545 PORTRAIT

Since the original post, my Timemore Chestnut C2 and a

@julianlam
julianlam / fastmail.md
Last active December 29, 2021 16:02
Why I Switched to Fastmail (and how you can too!) #blog

Every once in awhile a couple articles here and there make the rounds of social media about why one shouldn't use X email provider, whether that be Gmail, Outlook, or any other myriad of online services offering a virtual mailbox in exchange for a) your hard-earned money, or b) your personal information, please and thank you.

Most recently, Running your own email is increasingly an artisanal choice, not a practical one.

More often, you read horror stories about how someone lost access to their email – and by extension, access to a great many other online services that happen to use email as the fallback mechanism.

I'm old enough to remember when email inboxes were something ISPs provided (and as of today, they still do, if you ask for it), with miniscule quotas compared to what you can get today. I remember when Gmail launched and was invite-only, too. My first email provider was probably Yahoo! Mail, which hosted email with an ample storage quota of