Matt Haliski

I smash my fingers on the keyboard and occasionally stuff happens.

Regex match for spaces outside of HTML tags

Let’s say you are truncating a blog post to produce an excerpt for multiple posts in an index view. In Ruby on Rails, we can use the truncate() method like:

You might already notice a pitfall with this implementation. By setting escape to false,...

How to Exclude ID Lookup by Integer When Using FriendlyId

Hello there! Are you at the point in your Ruby on Rails project where you’d like integer-based slugs like /users/2 to be friendlier and look like /users/matt instead? How about /posts/how-to-make-great-tacos instead of /posts/31? There are...

My New System

I’ve been starting my weekdays at 4:00 am for the last seven weeks. It’s dark, and the sound of silence is all around. I made the change to my morning routine “cold turkey” and haven’t missed a day. I am typically in bed before 9:00 pm and asleep shortly after. I’m shooting for seven hours of ...

Apple Studio Displays

Thanks to ordering the VESA mount option, I’m too late to the party to do a spec review, but I want to address the mood in the room. The internet sure went on a hot take rampage with these displays, didn’t they? There was a lot of disappointment and exasperation flying around. Here’s why I thi...

Dealing with Unity versions

I recently got a MacBook Air to serve as a mobile-friendly companion to my iMac and it got me thinking about how to deal with Unity installs. I had primarily been working on a single machine without any team members to worry about. Therefore my one machine, and the Unity versions on it, were a...

Copying Markdown text from Visual Studio Code

You’re trying to copy Markdown out of a .md document in VS Code and the results aren’t as you’d expect when you go to paste elsewhere. I was trying to paste it into Notion and most of the formatting wasn’t honored. Bizarre.

Turns out VS Code is trying to be...