Magit’s Killer Feature #1: Commit Text Completion Based on the Diff

Teaser image

I’m using the Emacs git frontend (‘porcelain’) Magit for all my projects nowadays. I fire up GitUp (which is great) only to traverse the commit history visually. Here’s one of the reasons: With auto-completion framework company, I get completion suggestions when I type my commit message. These are based on the actual code diff of the commit.

Continue reading …

Happy People = Mac Users

I talked about my “job” the other day and, again, pointed out that I’m making apps, but for Mac, not iPhone. No, no, I also do iPhone. I just don’t like to, and avoid it if I can. But using a Mac, that is fun, and working on a Mac is great. The machines are good, the OS is still good. That’s what I believe the most. For the things I’m interested in making, the Mac is a good platform. It’s a platform to get serious stuff done. And I can be a part in making the experience enjoyable and make “work” fell less like a chore. That’s what I’m interested in.

Continue reading …

Dependency Injection and the Tree of Knowledge

On Twitter, Manuel Schulze (@zet_manu shared the Swift package Resolver that does dependency injection in a very convenient way with little boilerplate thanks to property wrappers: Mr Dr Dominik Hauser replied, and that’s how it entered my Twitter timeline. I was curious why people use packages like this – I know the concept from Java, but have always found constructor injection and maybe a Service Locator here and there to suffice.

Continue reading …

STTextView: A TextKit 2 Text Editor without NSTextView

Teaser image

In my recent post about the TextKit 2 sample app, commenter Frizlab pointed out that Marcin Krzyzanowski (@krzyzanowskim on Twitter) is doing TextKit 2 stuff. I didn’t notice that in my Twitter timeline even though I follow him for years now, so I was confused, nay, angry about the state of my Twitter timeline since Musk’s takeover /s.

And yes, Marcin does have a very extensive open source sample project that explores TextKit 2! He’s working on Swift Studio, a pure Swift IDE and his STTextView is a part of that.

So meet STTextView, a “TextKit2 text view without NSTextView baggage”.

Check out the video demo!

One thing I love about the code comments for the UI compoents is the ASCII diagrams of layer contents, e.g. in STTextView.swift:

//  STTextView
//      |---selectionLayer (CALayer)
//      |---contentLayer (CALAyer)
//              |---(STInsertionPointLayer | TextLayoutFragmentLayer)
//

Am totally going to adopt this :)

Clean Downloads Folder on Mac with Hazel

Teaser image

I have a confession to make. I eased into this by sharing the same info on Twitter/Mastodon already. My ~/Downloads folder is a mess. It’s much less messy than your Downloads folder, most likely, but still. I achieved relative de-messification by automatically filing old downloads into sub-folders, one per month, like ~/Downloads/2022-05 Downloaded. That was amazing because the actual Downloads folder was clean, and old stuff was somewhat highlighted.

Continue reading …

Weak Self – Closure Rules of Thumb

In Swift, you can weak-ify references to self in escaping closures, and then you need to deal with the case that the reference is gone when the block is called. Last month, Benoit Pasquier and Chris Downie presented different takes on the problem. That discussion was excellent. It prompted me to take some more time to revisit this problem systematically, and I took away a couple of notes for future-me.

Continue reading …

How to Upgrade Sendy from Version 5 to 6 from the Shell via SSH

I’m using Sendy for our newsletters. Recently, verison 6 was released. Here’s how I updated like a pro on my VPS via SSH. The beginner-friendly but ultimately drag-and-drop/FTP-based online instructions assume that you will be moving files over from “new location” to “existing location”. That’s quite cumbersome when all you have is SSH.

Continue reading …

Aergrind by Knock Coffee Grinder, and Their Amazing Customs Duty Service

Teaser image

I bought a hand grinder that would replace our 40+ years old, dull antique. Of course I looked for advice on James Hoffmann’s YT channel and figured the Aergrind by Knock would be a great fit. As the man coffee scientist himself says, the grinder is so good it would’ve blown away any cheaper competition from his other video, so he included it in the premium segment comparison. That was one reason I considered this.

Continue reading …

Add Numbers to Emacs tab-bar-mode Tab Titles for Quick Access

Teaser image

For about two months now, I’ve been using tab-bar-mode in Emacs to have multiple “workspaces” open. I was fine with buffer switching, too. But tab-bar-mode not only allows you to switch between buffers, but also window configurations – that means one tab will have 1 window with 1 buffer visiting a file, while another might have a gazillion split panes. So the main upside for me is to arrange stuff into panes aka windows, and then open a new tab to do something in a single-pane view.

Continue reading …

Copy Dropbox Link to File Using Maestral

Joel Rendall on the Keyboard Maestro forums published a macro collection for Maestral users. Since my switch to Maestro from the macOS native Dropbox app with all its annoying features, there’s only one thing I missed from the Dropbox app – copying links to files in my Dropbox to share them with others. I do this quite often with video recordings for bug reports, I found.

Continue reading …

I Uninstalled the Dropbox App in Favor of Maestral

Today I have uninstalled the Dropbox app from my Mac. I’ve been an early Dropbox user and invited friends until I got up to 10 GiB, which was a ton of storage back in the day. But the native apps gets more and more annoying; they have a history of faking system standard dialogs to “trick” you into installing the kernel extension with root privileges; and resource consumption was at times confusingly high. Stuff like that made me tired of the app.

Continue reading …

Closing Circe IRC Buffers in Emacs Without Leaving the Room

It’s a hack but it works: To stay in a room (or rather: let the bouncer stay there) and still close the buffer locally, it helps to change the major mode of the circe buffer: M-x fundamental-mode RET. If you change the buffer’s mode to any text mode, the circe-mode specific teardown hooks won’t be triggered and you can close the buffer without leaving the room.

Continue reading …