More from Evan Hahn (dot com)
In short: I use iOS Shortcuts to run a Mastodon bot. I run a Mastodon bot that posts random quotes from The Legend of Zelda: Link’s Awakening. (The writing in that game is so charming!) I used to run it off a server, but for the past few days, it’s used an iOS Shortcut on my phone. How it works The bot is called Ulrira, named after a beloved Link’s Awakening character. Ulrira (the bot, not the character) samples a line from the text dump, then makes an HTTP request to post it. Here’s a screenshot of the full thing: As you can see, everything here is hard-coded, from the server credentials to the file name. (It probably wouldn’t be hard to make this more generic, but I didn’t bother.) This used to be a short, hand-written Bash script. I used the new AI-powered Shortcut creator and prompted this into existence. I said something like, “Here’s a Bash script. Turn this into a Shortcut.” Like a lot of LLM output, it wasn’t quite right, but it was useful for getting started. Shortcuts doesn’t seem to have an elegant way to express something like “run this every 6 hours”, so I created four additional scheduler Shortcuts that call the main one. They run at 12am, 6am, 12pm, and 6pm. That means there are five shortcuts in total: one to actually make the post, and four to schedule the main Shortcut at different times. Why do it this way? I didn’t want to pay for my server anymore, nor did I want to maintain it. When I went looking for alternatives, they either (1) cost money (2) had some significant limitation (for example, GitHub Actions requires me to update the repo every 60 days). This solution runs on a device with high uptime and is effectively free. If you’re a pro software genius, you might complain that this is not reliable! It doesn’t work if my phone is offline, for example. Or what if I change timezones? But in the words of Link’s Awakening: You’re good! You’re a pro, aren’t you? ………… Well, beat it! Pros aren’t allowed in here! Follow the bot here.
Here are the Vim forks I know about: Neovim: “a Vim-based text editor engineered for extensibility and usability, to encourage new applications and contributions.” Vim Classic: “a stable, long-term support fork of the ubiquitous text editor, maintained without the assistance of generative AI tools.” EVi: “a hard-fork of Vim v9.1.0 (Jan 2024) before AI was used in the project.” MacVim: “a macOS version of the Vim text editor, providing a graphical user interface for Vim, while tightly integrating with macOS and providing features specific to the platform.” This list doesn’t include Vim-inspired editors like Kakoune, Vim-style plugins for other editors like IdeaVim, or Vim “distributions” like LazyVim. Contact me if you know of other forks!
In short: from my experience, people like map and filter, but not reduce. I use functions like map and filter all the time. When I put that code up for review, my peers rarely complain. I get plenty of feedback about other decisions, but not about my use of map and filter. I cannot say the same for reduce. Often, when I’ve submitted a patch with reduce inside, I get a comment like, “this part is hard to read.” And I see reduce way less than map, filter, some, and so on. Anecdotally, I have come to believe that programmers don’t like reduce as much. I don’t know why, but I have a few theories: reduce is harder to read. reduce is less familiar. reduce can have worse performance compared to other options. reduce is less elegant in languages I use, like JavaScript, Python, and Swift. In my blissful stint as a Clojure developer, I did not get this feedback. I’m wrong, and I’m seeing a trend that’s not real. I usually just change reduce to something else and move on. Even though I prefer it, I don’t usually care much. But it’s a little social phenomenon I’ve observed, and I thought I’d document it. I’ve also noticed this less recently, possibly because code review is less thorough nowadays. Do you notice this? Do you like reduce? Please tell me.
In short: Vim has a joke autocmd called UserGettingBored that doesn’t do anything. Vim’s automatic commands feature, usually shortened to “autocmd”, lets you run code when various events occur. For example, you could implement an auto-save feature by binding the TextChanged event to the :w command. Vim has over 100 events, from “buffer was created” to “file was saved”. But one of them sticks out to me: UserGettingBored. Here’s the documentation: UserGettingBored: When the user presses the same key 42 times. Just kidding! :-) When I saw this, I was busy doing something else and it completely derailed me. “I must know more,” I thought. Here’s what I found: Unfortunately, it doesn’t do anything. It only exists in the documentation (and some tests). If you try to use it with somethig like autocmd UserGettingBored ..., you’ll get a “no such group or event” error. It’s present in Vim, Neovim, and Vim Classic. It was first added by Bram Moolenaar in July 2000, over a year before Vim 6.0 was released. The original description was, “When the user hits CTRL-C. Just kidding!” And it didn’t do anything back then, so I don’t think it’s ever been real. In August 2001, he added the smiley face to the documentation. It then read, “When the user hits CTRL-C. Just kidding! :-)” Twelve years later, in 2013, the description changed to its current iteration: “When the user presses the same key 42 times. Just kidding! :-)” In 2022, developer Mike Smith created an unofficial plugin inspired by this joke autocmd. If you press the same key 42 times in Insert mode, a picture of Samuel L. Jackson appears. 22 years later, it’s finally real.
More in technology
The resiliency startup has slashed the amount it spends on AI; down from $4,500 per dev, per month, in August, to $1,600 now.
Internalize this graph, we post it on this blog a lot. If trends continue, China will have 10x the electricity of the US in 10 years. Whenever you think about geopolitical strategy, always keep it in mind, because whatever your plans are must consider this. Here’s a strategy that would make sense for America long term. Sell as many AI chips into China as possible, use the money to purchase solar panel and battery factories, and build out electricity capacity as quickly as possible. Fundamentally, compute is a function of electricity. That’s the sort of long term thinking that gives America a chance. With robotic labor, immigrants like Jensen and Elon, a business friendly culture, and an incredible chunk of land, it’s not so clear who is ahead in 50 years. Regardless, I do know this strategy would lead to massive prosperity for the citizens of both countries. However, that’s not close to what we see happening. We see a lot of short term zero sum thinking in action. It’s very scary what the US “AI race” mentality leads to. When exactly does the race end? Whatever capabilities you have today will eventually be matched, unless… …you believe that you can use ASI in a decapitating first strike. I’m worried that this is what these people see as the only way out. It probably doesn’t work, can you outthink steel and drone production? I don’t see how, see my critiques here. But I’m not totally sure, I’m not a superintelligence. And if it does work, that may be the end. My likelihood of imminent WWIII went up a lot with the nationalization of NVIDIA.
Nathaniel Christopher has a lovely recap of his time at WordCamp Canada. Very cool that the dashboard widget helped connect him to the local community. Hat tip: Anne.
Managing a house with five kids can be challenging so I like to share what’s working for us when I can. This post is how we currently handle screen time. Screens can be addictive, and it’s easy for anyone (both kids and adults) to fall into unhealthy patterns using them. Historically, I’ve been uncomfortable with screen time restrictions because I don’t want to restrict all the useful, creative, and productive opportunities that screens can provide. We’ve tried zero restrictions in the past (alongside Daily Demos as a creativity incentive), which worked ok, but at some point we wanted bit more structure. Here’s what that structure currently looks like. Device use categories For family members without phones, we have carved out the following categories of time: “Free Time” - Kids are free to do whatever activities they want (bounded only by what we’ve made available for them at the house). Video games, movies, board games, homework, run around outside, whatever. Often, this time trends towards consumption on devices, but it doesn’t have to. We call it “free time” instead of “screen time,” because we want to emphasize that the opportunities are wider than just screens. “Project Time” - Kids are encouraged to do projects, which are usually defined as creative activities of all kinds (with or without screens). This category can be blurry so we’ve often put together lists of approved project time activities, including things like: arts and crafts, coding (including “Scratch create”), playing musical instruments, recording videos, Minecraft (creative mode), the Powder Toy, Dojo Islands, and anything on Let’s Get Creative. Device-based consumption is not allowed. Offline activities are usually considered fine (reading a book, doing a puzzle, etc). “No devices” - No device use allowed. Addendum: Grant Proposals If a kid wants a one-time exception to one of the categories above, we tell them to “submit a grant proposal.” This means they need to get some paper, and write out what they want to do, and why they think it is justified. Example 1: “I want to play Minecraft creative after dinner because I am building a full-scale piano, I want to demo it tonight, and I only have 10 more minutes of work until it’s done.” Example 2: “I want to play Terraria during project time because I am making an tutorial on how to beat Moon Lord, and I need to collect screenshots from the game for my tutorial.” We usually approve grant proposals, as long as they aren’t incomplete. Schedule With these categories defined, we just need to decide how much time to allocate, and when to schedule it. For example, here’s our current “no devices” schedule: "No Devices" times Reason After Dinner Reduce stimulation before bed Sundays Protected for church and family Saturdays, before chores are done Incentivize quick completion of chores, so our Saturday afternoons remain available The categories + schedule constitutes our device policy, in addition to Daily Demos, which we continue to hold on the side. Summary Addictive device consumption can easily crowd out activities that are important long-term but deliver less dopamine short-term. Our device-time categories create a protected space for those activities on a consistent schedule that our kids can expect and make plans around. This is what works for us. Your milage may vary! Thanks for reading this post via RSS! Let me know your thoughts by leaving a comment on the original post or sending me an email.
There are few things worse than a dead AirTag when you need it. That's why we designed the The 4-Year Battery Keychain for AirTag. It replaces the low power CR2032 coin cell with an included Toshiba CR2477 battery for over 4x more capacity. And does so in a minimal form factor. Assembles in seconds. Split key ring + braided cord included. Easy to open with included tool. Perfect on a keychain. And great for backpacks or a purse. Also available on Amazon.