RSSAmplifier

Blog

The blog of dlaa.me

My name is David Anson. I work at Microsoft where I've helped build client, server, and web apps. I contribute to OSS. I blog about anything that interests me.

dlaa.meRSS feed ↗20 posts

Latest posts

"I refuse to join any club that would have me as a member." [A simple Node.js web app to filter iCalendar events]

If you're a member of a club, organization, committee, etc. with regularly-scheduled events, you may want those events to automatically show up on your calendar. Fortunately, there's the Internet Calendaring and Scheduling Core Object Specification (iCalendar) which defines a way to represent calendar entries in a portable manner, and the webcal: URI scheme that makes it possible to subscribe to a…

En Provence [Some thoughts about npm package provenance - and why I have not enabled it]

Last year, the GitHub blog outlined efforts to secure the Node.js package repository by Introducing npm package provenance . They write: In order to increase the level of trust you have in the npm packages you download from the registry you must have visibility into the process by which the source was translated into the published artifact. This requirement is addressed by npm package provenance:…

"Hang loose" is for surfers, not developers [Why I pin dependency versions in Node.js packages]

A few days ago, I posted a response to a question I get asked about open-source project management. Here we go again - this time the topic is dependency versioning. What is a package dependency? In the Node.js ecosystem , packages (a.k.a. projects) can make use of other packages by declaring them as a dependency in package.json and specifying the range of supported versions. When a package gets…

"DRINK ME" [Why I do not include npm-shrinkwrap.json in Node.js tool packages]

I maintain a few open source projects and get asked some of the same questions from time to time. I wrote the explanation below in August of 2023 and posted it as a GitHub Gist ; I am capturing it here for easier reference. Background: npm-shrinkwrap.json | npm Docs package-lock.json | npm Docs markdownlint-cli2 For historical purposes and possible future reference, here are my notes on why I…

"The unexamined life is not worth living" [Thoughts on writing an effective performance review at Microsoft (or elsewhere)]

It's "Connect season" again at Microsoft and I thought it might be useful to address something managers see pretty regularly: reluctance by their direct reports to fill out the required "paperwork". To start, it's important to understand what a Connect is. A Connect is a structured document that Microsoft employees are required to fill out every few months, submit to their manager for comment,…

"If you want to see the sunshine, you have to weather the storm." [A simple AppleScript script to backup Notes in iCloud]

As someone who likes to make backups of all my data , storing things "in the cloud" is a little concerning because I have no idea how well that data is backed up. So I try to periodically save copies of cloud data locally just to be safe. This can be easy or hard depending on how that data is represented and how amenable the provider is to supporting this workflow. In the case of Apple Notes, it's…

Can you use it in a sentence? [An example of solving the New York Times Spelling Bee puzzle with JavaScript]

The New York Times Crossword app includes a daily puzzle called "Spelling Bee" . The challenge is to make as many four-or-more letter words from a set of seven letters as you can. Each word must contain only those letters (using a letter multiple times is okay) and all of the words must include a specific letter (highlighted as part of the puzzle). It's pretty straightforward and the goal is to…

"We must never become too busy sawing to take time to sharpen the saw." [Two solutions to a programming challenge]

I stumbled across a programming challenge while looking for info on UglifyJS . It's called A little JavaScript problem , though I you can do it in any language. I will summarize the problem here, but please visit that page for the details: The problem : define functions range, map, reverse and foreach, obeying the restrictions below, such that the following program works properly. It prints the…

"If you can't measure it, you can't manage it." [A brief analysis of markdownlint rule popularity]

From time to time, discussions of a markdownlint rule come up where the popularity of one of the rules is questioned. There are about 45 rules right now , so there's a lot of room for debate about whether a particular one goes too far or isn't generally applicable. By convention, all rules are enabled for linting by default, though it is easy to disable any rules that you disagree with or that…

If one is good, two must be better [markdownlint-cli2 is a new kind of command-line interface for markdownlint]

About 5 years ago, Igor Shubovych and I discussed the idea of writing a CLI for markdownlint . I wasn't ready at the time, so Igor created markdownlint-cli and it has been a tremendous help for the popularity of the library. I didn't do much with it at first, but for the past 3+ years I have been the primary contributor to the project. This CLI is the primary way that many users interact with the…

Don't just complain - offer solutions! [Enabling markdownlint rules to fix the violations they report]

In October of 2017, an issue was opened in the markdownlint repository on GitHub asking for the ability to automatically fix rule violations. ( Background: markdownlint is a Node.js style checker and lint tool for Markdown/CommonMark files. ) I liked the idea, but had some concerns about how to implement it effectively. I had recently added the ability to fix simple violations to the…

Absolute coordinates corrupt absolutely [MouseButtonClicker gets support for absolute coordinates and virtual machine/remote desktop scenarios]

I wrote and shared MouseButtonClicker almost 12 years ago. It's a simple Windows utility to automatically click the mouse button for you. You can read about why that's interesting and how the program works in my blog post, " MouseButtonClicker clicks the mouse so you don't have to!" [Releasing binaries and source for a nifty mouse utility] . I've used MouseButtonClicker at work and at home pretty…

Make the Pi Higher [Configuring a Raspberry Pi for Node.js and web development]

Since the beginning of the year, I've been doing all my OSS project development on a Raspberry Pi 4 running Raspberry Pi OS (née Raspbian). It's not as powerful a machine as my Intel-based desktop PC running Windows, but it's much smaller, it uses much less power, it's completely silent, and it cost about 5% of the price. To be clear, I still do photo editing on Windows and the extra speed of the…

Without geometry, life is pointless [Another interesting programming puzzle worked through]

I happened across another coding puzzle recently that caught my interest. (If you're curious, here is a link to the puzzle I discussed a few weeks ago about implementing a weird kind of addition .) The problem this time is as follows: You are given an array of coordinates, coordinates[i] = [x,y] , where [x,y] represents the coordinate of a point. Check if these points make a straight line in the…

Interviewing for Fun and Profit [An unreasonably detailed consideration of a practical programming puzzle]

A few days ago, Brent Simmons published a thoughtful blog post about one aspect of programming interviews. As someone who conducts interviews regularly for work, the topic is of interest to me. Rather than summarizing the post, I encourage you to go read Practicing the Coding Challenges now. (You might also enjoy some of the replies to Brent's tweet linking to it .) After reading the post, I…

Existence is random [JavaScript code to efficiently generate a random (version 4) UUID]

A few months ago, I dashed out a JavaScript function to efficiently generate a random (version 4) UUID per RFC 4122 . This was inspired by code I saw for the same purpose that was not especially efficient - or random. (For more on randomness in JavaScript, see my post about polyfilling Math.random() .) My UUID generator uses crypto.getRandomValues() for the best randomness and tries to do as…

Let's go to the video tape! [tape-player is a simple, terse, in-process reporter for the tape test harness for Node.js]

I've been a happy user of the nodeunit test harness for a long time, but it was deprecated a few years ago. Recently, I went looking for a similar Node.js test harness to replace it. I prefer small, simple packages and settled on the tape test harness . I enjoy nearly everything about it, but didn't like having to pipe output to a formatter (more on this below). So I wrote a quick bit of code to…

Good, cheap, fast: you only get one and you don't get to pick [CoLR, the Camera of Last Resort]

One way I learn about new technologies is by using them. Sometimes I have a compelling scenario that yearns for a creative solution. Other times I don't. This was one of those times... So I created what's probably the worst camera app ever as a way of experimenting with four new (to me) technologies. Excerpting from the README: CSS Grid Layout - A modern layout system based on grid cells with the…

Oops, I did it again [A rewrite of my website/blog platform - now public, open-source, and on GitHub as simple-website-with-blog]

Almost 5 years ago, I moved my blog (and website) from a hosted environment to a Node.js implementation of my own creation. At the time, I was new to Node and this was a great way to learn . That code has served me well, but over time I've found a few things I wanted to change - in part due to the rapid growth of the Node platform. Some of the changes were foundational, so I chose to do a rewrite…

A picture is worth a thousand words [A small script to update contact photos on iOS]

I'm always looking for new ways to develop code. My latest adventure was writing a script to update contact photos on iOS for a prettier experience in the Messages app conversation list. The script is called update-ios-contact-images.js and it runs in Scriptable , a great app for interacting with the iOS platform from JavaScript. The idea is: There are various conditions where Apple iOS can't (or…