Categories
Keyboards Retro Computing

Buckling Springs

🎶 Oh buckling springs oh buckling springs! 🎶

The (current) daily driver on my Mac Studio, a Model M from 1992, got some new blue keys + caps today courtesy of Unicomp.

There’s quite a following for these keyboards for good reason – they’re built like tanks, have wonderful feedback from the buckling spring mechanism, and audibly alert everyone within a one mile radius that you have a mechanical keyboard.

IBM Model M keyboard with blue keys from Unicomp.

It doesn’t take much to run this keyboard on a modern system. Most machines these days won’t have a PS/2 port (although some high end gaming motherboards do, due to the lower latency), but it’s simple enough to use a PS/2 to USB converter like this one. Not all converters will work, so it’s good to check out reviews or forums beforehand. In case the Amazon link above eventually fails it’s a Monoprice PS/2 Keyboard/Mouse to USB Converter Adapter 110934.

You’ll also notice there’s a lack of “super” key in between Ctrl and Alt. To get around this on my Mac I’ve simply mapped Command to Alt and Option to Caps Lock. If this is too much of a deal breaker the good news is that Unicomp makes a modernized version.

Categories
Retro Computing

Merry Christmas!

May the ending of your year be as fancy as the ending of this synthesized rendition. 🎄

Categories
Fun iOS Projects

SpriteKit SnowFlakes

From the seasonal hacks department, here’s my toy app to make it snow on macOS. ❄️

https://github.com/twstokes/snowflakes

How it works:

When the app is told to make it snow it adds full-screen non-interactive windows on each display and inside those windows adds a SpriteKit view with a scene inside that contains emitters.

That’s basically it!

Categories
Fun

Happy Festivus!

For the rest of us.

Scrolling text on a flip dots display that says “happy festivus!”

Categories
Thoughts

Old iPhones are teeny tiny

My iPhone 12 Pro next to my old iPhone 4S

A few surprises today:

  1. I still have my iPhone 4S.
  2. It still charges and boots!
  3. It’s so tiny! The picture doesn’t do it justice.
Categories
AI Fun Projects

Do you hear what I hear?

Thanks to Whisper and this awesome port, the tree is responding to spoken words. 🗣🎄

Since the tree itself only has a low-powered MCU, we need another machine to act as a listener.

The architecture is:

  1. A machine in my office runs the Whisper model and listens for words.
  2. If certain keywords are found it finds a corresponding command to run (e.g. do a theater chase sequence in a green color).
  3. It sends that command to the tree over the network.

For now I’m running it from iOS and macOS, so I wrote the current implementation in Swift. The code is currently still in “hack” status, but working well!

Now it’s time to test it when talking to coworkers at Automattic.

Categories
Fun Retro Computing

Windows 3.11 in QEMU

Thanks to this repo you can fire up Windows 3.11 painlessly and even connect to the Internet! Lots of goodies are already installed so it’s a fun virtual trip.

To get it going on my Mac all I had to do was:

  1. brew install qemu
  2. Run qemu-system-i386 -nic user,ipv6=off,model=ne2k_pci -device sb16 -vga cirrus -snapshot -no-shutdown hda.img

There were some graphical glitches (restarting or dropping down into DOS and back helps) and it crashes when running Netscape, but Microsoft Bob seemed to work fine!

After configuring the network’s gateway and DNS servers, I had to visit one of my favorite test sites for old browsers:

The Dole / Kemp ’96 website is still alive and kickin’.
Categories
Arduino Projects

Tree OTA updates

Something I should’ve done long ago – enabling OTA (Over The Air) firmware updates so I don’t have to disassemble the project box and move the tree every time I want to change its code.

To add a touch of UX, the pixels represent the upload progress. 😎

NeoPixel tree being updated via OTA firmware update.
Categories
AI SwiftUI

Can ChatGPT draw a Christmas tree in SwiftUI?

Here’s the prompt I gave ChatGPT:

Draw a Christmas tree using SwiftUI

Here’s the code I got:

struct ChristmasTree: View {
    var body: some View {
        ZStack {
            // draw the tree trunk
            Rectangle()
                .fill(Color.brown)
                .frame(width: 20, height: 100)

            // draw the tree branches
            ForEach(0..<5) { i in
                HStack(spacing: 5) {
                    ForEach(0..<5-i) { j in
                        Triangle()
                            .fill(Color.green)
                            .frame(width: 10, height: 10)
                    }
                }
                .offset(x: 0, y: -10 * CGFloat(i))
            }

            // draw the star on top of the tree
            Circle()
                .fill(Color.yellow)
                .frame(width: 10, height: 10)
                .offset(x: 0, y: -50)
        }
    }
}

The only major issue syntax-wise is that Triangle() isn’t defined – where did it get that?

A quick visit to Hacking with Swift had this nice snippet, which I dropped in.

struct Triangle: Shape {
    func path(in rect: CGRect) -> Path {
        var path = Path()

        path.move(to: CGPoint(x: rect.midX, y: rect.minY))
        path.addLine(to: CGPoint(x: rect.minX, y: rect.maxY))
        path.addLine(to: CGPoint(x: rect.maxX, y: rect.maxY))
        path.addLine(to: CGPoint(x: rect.midX, y: rect.minY))

        return path
    }
}

Now we can compile and…. tada!

A Christmas tree in SwiftUI drawn by ChatGPT

Not great, but darn impressive! 🎄🤯

Categories
Thoughts

A K&R classic

It has been zero days since opening this classic.