Hi, I’m Sam

This is my blog. I also have a website thing.

Thirty-Two

Posted on

It’s my birthday. The past few days I’ve been thinking a lot about what I was doing around this time last year. What a year it’s been.

This morning, I read my Thirty and Thirty-One blog posts. These usually reflect on my last year some and look forward to the next year. Thirty was mostly about how work stuff isn’t the most important thing and I want to focus on family and hobbies. Thirty-One was mostly about goals for my free time. Needless to say, I didn’t accomplish many goals from that post this year thanks to COVID.

Last year on my birthday (March 2020), I was with some friends in Joshua Tree for the weekend. I remember being shocked to see the paper products aisle being completely empty in Wal-Mart. A guy that passed me in the store made a joke that all of the beer was sold out except Corona and that was his favorite so he didn’t mind. No one was wearing masks. We didn’t know you were supposed to yet. That following Monday, shelter-in-place started. That Tuesday, I started at GitHub from home. So weird.

Continue reading →

Ruby on Apple Silicon

Posted on

I’ve been using Homebrew on Apple Silicon for a few weeks now and it’s been working well.

With Ruby 3.0.0, I haven’t had any issues installing it with rbenv. Today, I needed to install an older version and had some trouble getting it. Here’s what I did to figure it out. (This assumes your Homebrews are setup like I described in my post.)

First, install rbenv with your native Homebrew:

Continue reading →

2020

Posted on

What a year. Besides the global pandemic, police brutality, and a very stressful election, a lot happened for me personally this year. I’m really thankful that I have a job and my health.

I went scuba diving in the Philippines. It was really amazing. I took some photos I’m really proud of. Maybe I’ll post them some time. (I’ve been saying I’ll post them “next week“ all year. Hah.)

I remember hearing about this COVID-19 thing on the news and not being sure if I should worry about it. When I was reentering the US, seeing the US border folks wearing masks made me worry a bit. I had to sign something promising that I hadn’t been to China. So crazy.

Continue reading →

Homebrew on Apple Silicon

Posted on

Today, my new 13-inch MacBook Pro arrived! I was super excited to get it out of the box and set it up. This thing is fast! I am already very impressed. When I started setting up my development environment, things started to get a little frustrating. Have no fear, it’s solvable!

The biggest issue for me was Homebrew. According to this issue “There won’t be any support for native ARM Homebrew installations for months to come.” No big deal though. Homebrew can work just fine with Rosetta 2 and some things work natively.

Rosetta 2 is Apple’s translation layer. This lets you run Intel things with a little overhead. In Terminal, you can run any process with Rosetta by prefixing it with arch -x86_64.

Continue reading →

Debugging JSON Data in LLDB

Posted on

Recently, I added a snippet to my ~/.lldbinit for an easy way to print JSON in LLDB. It has saved me a ton of time, so I thought it was worth explaining.

Here’s the snippet:

command regex json 's/(.+)/expr let input = %1; print(String(data: try! JSONSerialization.data(withJSONObject: (input is String ? try! JSONSerialization.jsonObject(with: (input as! String).data(using: .utf8)!, options: []) : (input is Data ? (try! JSONSerialization.jsonObject(with: input as! Data, options: [])) : input as! Any)), options: [.prettyPrinted]), encoding: .utf8)!)/'

Continue reading →