yarn.lock
or package-lock.json
#!/usr/bin/env perl
# Node dependency manager. Never wonder whether to use `yarn` or `npm` again.
# Usage:
# np --> runs `yarn` or `npm i`
# np <args> --> runs `yarn <args>` or `npm run <args>`
use strict;
use warnings;
if (!-e 'package.json') {
my $did_run = 0;
my @dirs = grep { -d $_ } glob('*');
for my $dir (@dirs) {
$did_run = 1;
chdir($dir);
if (-e 'package.json') {
print "Running `np` in $dir\n";
my $exit_code = system('np ' . join(' ', @ARGV));
exit($exit_code >> 8) if $exit_code != 0;
}
chdir('..');
}
if ($did_run == 0) {
print "No package.json found. Exiting.\n";
exit(1);
}
exit(0);
}
my $exit_code;
if (-e 'package-lock.json') {
if (@ARGV) {
$exit_code = system('npm run ' . join(' ', @ARGV));
} else {
$exit_code = system('npm i');
}
} else {
$exit_code = system('yarn ' . join(' ', @ARGV));
}
exit($exit_code >> 8);
Our cat Jinx keeps getting sick and vomiting, and the vets are saying this is most likely because young cats like to eat random stuff outside. We really don’t want to restrict Jinx to being an indoor cat, so we decided we would build him a little outside enclosure, a “catio”.
Continue reading →Elevators Lifts have this cool accessibility feature where, depending
on whether they’re going up or down, they’ll ding once or twice when they
arrive. This is so you know the direction without having to look at the display
above the doors.
I’ve finally come up with a mnemonic for remembering which is which:
🤯
Having a handful of different instant messaging clients on your computer is inconvenient. There is Ferdi Ferdium, but that’s basically just a browser with a tab for each service. I want something like Adium: an app that transparently talks to all your IM services, so you don’t have to think about it.
For years this seemed to be impossible, but recently I heard about Texts, and decided to give it a go.
My first thoughts were:
The setup was relatively smooth. Adding accounts worked fine. The UI is pretty ok.
There are some nice settings:
The UI is pretty nice and feels almost like a normal app, except for the very modern-web-app-feeling tooltips:
I may be the only person on Earth with this opinion, but I do actually like the native tooltips you get on macOS (and, I assume, Windows and Linux), that only show up after you point your mouse at a thing for a second, and look a bit more subtle.
The app has a bunch of other interesting features like automatic reminders, labels, undo for sending messages (via a delay), etc. Also there are keyboard shortcuts for everything and you can change the app icon to whatever you like.
The notification settings seem reasonable too:
When first setting up my accounts, the unread counter badge in the Dock icon was stuck on 1, but that eventually resolved itself.
So the app seems nice and things broadly work. But how well does Texts support all the custom features of the various IM services?
Yep:
This is Telegram, but it seems to work just as well with Messenger. Also, the original message gets a “Show reply” button and a “Show All Replies” button. “Show All Replies” opens a little popup with all replies to that particular message. (Would be nice if the UI team could make up their minds on whether they want sentence case or title case for their button labels tho.)
Nope. At least in Telegram, forwarded messages just show up as regular messages. This can be confusing, but people in my circles mostly use forwarding to quickly send a message to multiple people (i.e., send long message to person A, then forward to person B, C, etc.). In that case, it doesn’t matter that it’s not marked.
The Telegram integration even gives you an extra button for stickers.
Working totally fine in Telegram and Messenger (haven’t checked others), but the emoji picker looks a bit odd:
Yep. Text marked as a spoiler/redacted works with Telegram. You can click to reveal it.
CPU usage seems ok, but it uses 1 GB of RAM. But then again, what doesn’t, these days? My browser uses 5½ GB.
Texts is free for up to 10 accounts, and £12 per month if you have more. This seems fair. I don’t have 10 accounts in the app, so I’m using the free tier. But, assuming I don’t find any big issues, I’d absolutely be willing to pay £12 per month for an app like this.
Using Texts really does revive some of that Adium feeling from the early 2000s. I’ll keep using it for now and see how it goes.
For some reason, my glasses really don’t like staying on my face. Since this is especially bad when I’m sweating, I wanted to figure out a way to improve the situation before the summer. It looks like wrapping a hair tie around each temple, just behind the place that rests on the ear, might help keep the glasses in place a bit more.
So far this seems to work for me, and it doesn’t feel like it adds too much pressure on my head. One drawback is that now my glasses sometimes come off when I take off my headphones, but that is probably overall still better than constantly fighting the glasses.
I really don’t like Python1, but I have to use it for work, and so I have set myself the goal of learning to appreciate it. This is a list of mostly objective claims about Python that I appreciate. Submissions are welcome, but I’ll only add them if I agree that they’re basically objectively true.
import pandas as pd
,
import numpy as np
), so you can always tell where a function or class is
coming from (e.g. pd.DataFrame
, etc). This also probably helps avoid using
“private” APIs: if the top of my file says from whatever import _hello
, a
thousand lines further down, it won’t look out of place to call _hello()
(“maybe it’s just a private helper function defined in this file!”). But if
you do import whatever
, you’ll have to write whatever._hello()
, which will
stick out like a marginally sore thumb.zip
is a built-in function.I’ll add more points as I think of them.
I have an unfinished post titled “Unhinged rant about the Python community” explaining some of my feelings. Maybe one day I’ll publish that too. ↩
You’ve heard me complain about how, while people will tell you that “the Germans have a word for that”, German actually has too few words, and one thing that makes English so beautiful is its rich vocabulary.
(If you haven’t heard me rant about it, all of those “the Germans have a word for that” words are just compound words that work just as well in English – German just makes things confusing by leaving out the spaces or hyphens. (E.g., “Schadenfreude” is just “damage-joy”. It sounds weird in English, but that’s just because it’s not established as a common phrase.) This compound-word game can be a lot of fun at parties, but it doesn’t help you when you realize German doesn’t really have different words for “proof” and “evidence”.)
So, after two paragraphs of preamble, here’s the list (at the time of writing, this list has only two items, but I may extend it over the years):
The option key in macOS should be called alt like on Windows, because it is used to type alternative characters, or to run alternative commands when used in conjunction with the command key. On Windows, the alt key should be called command because you use it to move focus to the menus to execute commands. The alt gr key on Windows should become the alt key because that’s what you use to type alternative characters. The shift key should be called caps because nobody has used a typewriter in decades, and nothing is being shifted anymore. (The name isn’t perfect because you also use that key to type alternative symbols on the number row, but we already have an alt key. Maybe we could use our new alt key to type all the symbols from the number row and the number keys can produce old-style figures without caps and lining figures with – though that would require changes to unicode, so that might be out of scope for this project.) The caps lock key should be dropped entirely and replaced with an escape key that functions as ctrl or command when held down, according to user preferences. On keyboards that have one, the fn key should be renamed to something like alt-ctrl because it’s usually like a ctrl or command key, but it does different things. Maybe special would work, as a nod to the old “Special” menu in Classic Mac OS.
And while we’re renaming keys, the tab key should be renamed to shift because we make tables using the “Insert table” command, not by pressing the tab key. The tab key is used to shift text to the right, or to shift focus to the next input element. (On the other hand, ctrl + tab is used to navigate between browser tabs, but that’s one bit of elegance we can probably do without. (You can still say you’re “shifting” focus to the next browser tab, so it all works out in the end.))
Fun things I discovered about my muscle memory.
Continue reading →At my previous job, we were told not to use partials to clean up our view code, because each rendering of a partial would add around 10ms to the overall response time. After I was told this I did a quick test in my dev environment, but I’d never actually tested the claim on production … until today!
Continue reading →