How to Write Conditional Properties in a Javascript Object’s Initial Declaration  

Let’s say you want to write a single declaration that maybe has a property on it, based on some boolean expression. You can do that like so:

const hasAvatar = false;

const user = {
  firstName: 'martyn',
  ...(hasAvatar) && { avatar: 'link/to/some/avatar' },

Here, user is nothing other than:

{ firstName: 'martyn' }

But if you flip hasAvatar to true then it successfully evaluates to:

{ firstName: 'martyn', avatar: 'link/to/some/avatar' }

There are situations where the ability to one-liner an object declaration with conditional properties like this allows you to avoid moving around a lot of stuff you’d otherwise have to refactor. It’s definitely something worth keeping in your wheelhouse.

Transit Goes Old School in Its July Release Notes  

The Transit app release notes from July 1:

My liege,

Your humble servants at the Transit Mobile Application Bug Plumbing Company do henceforth declare the following services Remedied And Restored to Satisfactory Working Order:

Whoever put this together had a good grip of old English. They knew not just the old words, but the old spellings (e.g., “Office Moode”) and the old pronunciation rules (e.g., “an ‘Hilarious GIF’”).

A Business Case for Dropping Internet Explorer  

Ollie Williams, writing at CSS Tricks:

The distance between Internet Explorer (IE) 11 and every other major browser is an increasingly gaping chasm. Adding support for a technologically obsolete browser adds an inordinate amount of time and frustration to development. Testing becomes onerous. Bug-fixing looms large. Developers have wanted to abandon IE for years, but is it now financially prudent to do so?

Evan You Teases a Virtual DOM That Beats Svelte’s  

Evan You:

What if I told you I made vdom faster than Svelte 🙀

Two hours later:

Kinda hesitant to post the benchmark (which includes React, which inevitably is going to lead to React devs telling me how perceived perf is the only perf that you should care about, and other pissed off people complaining about how stupid benchmarks mislead devs)

If you picked Svelte over Vue for a project purely on its merits of speed, it’s time to take a step back and reflect on how that’s working out for you.

Changing the User Icon in Chrome  


Once the image is in place there seems no way to change it with a different custom image. FRUSTRATING!

Yesterday I finally got around to adding an avatar to my Google account, but it never updated the avatar that appears to the right of the address bar in Google Chrome. I restarted Chrome, restarted macOS Catalina, no luck. The only solution was to sign out of Google Chrome and sign back in.

The Value of an Awaited Item

While you’re doing an await for a promise in JavaScript, what is its value before it resolves? Answer: whatever it previously was.

let baz = 'hello world';

const foo = async() => {
  baz = await new Promise(resolve => {
    setTimeout(() => {
    }, 1000);

baz;  // value is 'hello world' until 1 second, at which point it changes to 'resolved'

Didn’t know this until yesterday. 🤓

How to Disable Chrome’s URL Hiding  

Judging by the publish date of this article, apparently this nonsense has been going on for a year and I just haven’t noticed. Or maybe it’s not been enabled by default until a recent update. But regardless, I’ve noticed lately that Chrome is trying to do the same thing Safari did: hide parts of the URL like the “www.” That would be fine, except that when you go to edit the URL, the whole thing jumps around because then it has to insert all the missing pieces. It might be great for people who rarely touch the address bar, but for web developers, it’s no bueno. The secret is to go to chrome://flags, search Steady select Disabled on all the search results, and restart Chrome.


Had no idea that was the same as 127.1.

Strava Pulls the Plug on Relive  


Strava decided to no longer work with us and shut down our access to your activities. This means you can no longer create Relive videos based on your Strava activities.


We then tried to call, email, and talk this out with Strava. No response, except for new ultimatums and threats about our existing features they’ve applauded for years.


Nothing has changed about how Relive uses and protects your data or how we use their API.

This is a very different sounding memo than the email Strava sent last night:

Many of us at Strava have enjoyed using Relive over the last few years, but because of Relive’s recent updates, unfortunately, we have decided to end this integration. The current version of Relive violates several of the terms that we ask of API partners. These terms are in place to safeguard your personal information, to ensure a level playing field for all our partners, and to protect what makes Strava unique. We’ve worked hard with Relive to try to fix this, but they have ultimately chosen not to make the changes needed to honor their agreement. So as of today, Strava will no longer send your activities to Relive for playback.

Does the “current version of Relive violate” terms, or has “nothing changed about how Relive uses” Strava’s API? Has Strava “worked hard with Relive to try to fix this” or has Strava given “no response” to Relive’s calls and emails? It’s hard for me to understand how both of these sides of the story can both be fully factual.

Tech Giants Are Censoring Anti Big Pharma  

Mike Adams:

YouTube has already begun scrubbing historical documentaries as part of its accelerated purge. Facebook is going to start taking down all anti-cancer food channels, and diabetes will be next. MailChimp just started banning all vaccine safety email lists today, blocking any senders from distributing emails that are critical of vaccine safety. is about to dump all small brand nutritional supplements and replace them all with synthetic, toxic vitamin products made by Big Pharma subsidiaries.

This part about MailChimp has been corroborated. It’s disgusting. This means war. For the first time ever, this week I’m trying to use Firefox and DuckDuckGo instead of Chrome and Google.

Update November 9, 2019: Yeah, that didn’t go so well. 😂

Malcolm Gladwell Talks About Puzzle Rush  

Malcolm never said “” in the episode, but here’s a fact: the only place you can play Puzzle Rush is at

I’ve had the privilege to be a core developer on this project, and it was fun to hear a high-profile outsider’s take on the feature.


We’re all patiently waiting for Slack to introduce Dark Mode for its Mac app. Meanwhile though, Sblack is an interesting app if you’re looking for a way to have dark mode in a native Slack App.

The challenge with 3rd party dark mode support is that it constantly has to adjust to the HTML and CSS changes of the host DOM. I’m noticing that recent threaded replies have lost whatever customization they used to have, for instance. Little broken details like this keep someone like me from being able to use this, but your mileage will vary. It’s worth checking out.

Why Jason Fried Doesn’t Wear an Apple Watch  

Jason Fried:

I love mechanical watches for a number of reasons – the art, the science, the ingenuity behind the mechanisms, the continuation of a craft dating back centuries, the look, the feel, the freedom from batteries and tethers and cords.

But lately it’s really come down to this: When I look at my watch, it gives me the time. It asks nothing in return. It’s a loyal companion without demands.

This freedom from distraction is one of the reasons I’ve never bought an Apple Watch and continue to primarily wear leather-banded Fossils. Smartwatches are ubiquitous in my line of work, but Jason’s onto something.

Apple’s New 6k Monitor Is Not the Monitor for the Rest of Us  

If you’re regularly in a coworking space like I am, you want the non-glossy finish. So instead of the $5,000 one, you need the $6,000. And on top of that you need the stand, which sells separately for $1,000. So all totaled, you’re looking at $7,000 pre-tax. Where I live with a roughly 8.5% sales tax, that’s $7,600 total. To put things in perspective, that’s more than what I paid for the Honda Accord that I bought in 2012 and that I still drive to work every day.

This new monitor isn’t the monitor for the rest of us. It’s the monitor for the elite of the elite. And here I was thinking that LG’s 5K monitor was a splurge at $1,300. 🙄

My day-to-day monitor is a discontinued Dell 27” 4k Monitor. I bought it used from a friend for $200 earlier this year. It’s not as elegant as Apple’s aluminum Thunderbolt Display monitor of yore but it’s got a sharper display and (very importantly) it has a matte finish. Unless you want to see your face in a mirror all day, if you’re in a well-lit open office environment, you need a matte finish.

In a way, it’s a relief that Apple’s one and only standalone display is so ridiculously out of our price range. It keeps us from even being tempted. Still, this is bonkers. Nobody except those within rich Hollywood film studios (and similar) are going to buy this. In making the best monitor in the world, in settling for nothing except the best, Apple priced itself out. Apple made its accomplishment irrelevant. Meaningless. It would have been far better for Apple to offer an aluminum 27” 5K monitor that was “close enough,” and offer it at $1,000. That’s what the Steve Jobs Apple did with the Thunderbolt Display.

Don’t give me some nonsense about “Apple just doesn’t compete at those lower margins.” The 27” 5K iMac starts at $1,800. What I’m asking is that Apple take that computer body, gut the internals so it’s just a standalone monitor, and slash off $800.

Maybe they’ll still do that at some point in the future. But I’m not holding my breath.

Google Chrome Restricting Ad Blockers  

Tl;dr — Google is making it harder for ad blockers to block ads. If you worship the shrine of privacy, this will bother you. For the rest of us, it’s fine; Google Chrome remains the #1 browser with the most market share and the best developer toolset. Ads are how sites make money. Ads pay the bills. That’s the way it is. 🤷🏾‍

Virtual Dom Is Pure Overhead  

Great article by a core contributor to Svelte about why the pure DOM that’s offered in React and Vue and most every other modern JS framework is not all it’s cracked up to be. Both the clarity of the writing and the typography of the Svelte blog are a joy to behold.

I’ve gotten to the point where if I have a choice in a new project, I go with Svelte. Smaller bundle sizes and faster runtime outweigh its slightly more verbose syntax.

Why Light Modes Are Better for the Eyes  

Turns out, there’s scientific reasons backing up the argument that light modes (dark text on light backgrounds) are better than dark modes. We live in an an era in which websites, apps, and operating systems are trying hard to accommodate both. But they’re not created equal.

CSS-Only Async Chat  

Add this to the list of “using CSS for things that most people would say require JS.” This is one of those incredibly innovative things that you would never do unless you were truly resource-constrained and couldn’t use WebSocket and Ajax. But knowing that it is possible and how it’s possible is worth the read.

8-Digit Hexadecimals  

I’m not sure how I never knew about this, but you can specify transparency in a hexadecimal color in CSS. Keep in mind that IE 11 and Edge don’t support this yet, but you can get around that by using something like SCSS that then compiles this into a more compatible and recognizable rgba() output. Serious levels of Unobtanium, this.

Chrome 73 Brings Dark Mode Finally  

This looks so good. I refused to use a dark Chrome theme because I just couldn’t stomach the gradients. So I’ve gone from the native light mode to this native dark mode after many moons of waiting.1 The new breakpoint editor is also amazing.

  1. Ever since Dark Mode came out in Mojave last fall. ↩︎

Navigating macOS Dialog Boxes Using Keyboard Only  

Dave Land:

tab moves between buttons
space presses focused button (with blue outline)
return presses default button (with blue background)
⌘+first letter on button presses that button (works sometimes)
⌘+. cancels
esc cancels (works sometimes)

I’d forgotten ⌘+first, and I don’t think I’ve ever known about space and ⌘+.. Definitely going to be using this.