Obey the Fist – the movie

Today I was sitting on my couch after dropping my kids off at their mom's house thinking about how I used to be cool. And, you know, I was never "cool", just now that I'm 46 and past any possibility of having my dreams of coming across as "reluctantly cool once I grow into it…" fulfilled, I started reminiscing on some cool things I've done in the past.

This thing I do, revisiting my cool days which only ever existed in my self-observations, isn't new, just increasingly validating all the choices I've made in life that have been right while never directly benefitting me in any way.

  • First things first
  • Second things second

$8.00 Blog Posts

You can get a domain name pretty cheap, so I do it all the time. I have domains like dysturban.com, plannedparenthood.co, kaitmoon.com, lostinplace.co, bipolar.fun, and johnston.io just to have them.

I’ve done very little with them in general, but I think I’m going to give each of them a purpose. A blog post or some random art.

I dumped facebook a few months ago and it’s been an amazing stress relief. But I miss posting funny, important, or random things. I could do 2 posts a month, each on a unique domain I own that is otherwise unused.


Native macOS app to run PHP scripts

Ok, first

Many, many years ago, as an open source PHP and WordPress developer, I had a system for testing arbitrary PHP as I honed my skills and learned new techniques. I had a file on my web server called test-php.php that did nothing but output the results of my code and would spend hours writing code, upload to server, switch to browser, refresh. This is how I learned the basics of regex, converted base64, tested operators, and refined my database access techniques.

On a bored and underutilized day in 2012, I decided to figure out how to write an app to simplify the process. I had similarly written two apps previously, the first of which was a rip on a crazy flub by the Mitt Romney campaign when they released a campaign app called, “I’m with Mitt!” which would overlay Mitt Romney Oh ’12 campaign slogans on live photos. Hilariously, their developers failed to QC it thoroughly, ending up with a silly typo on the main overlay which draped the photos, meant to be shared socially using the app’s built-in functionality, with the slogans, “A Better Amercia” and “I’m with Mitt”.

That was not typo in my post. I know how to spell America. So, being smart like I am, I built an app that did the exact same thing. Except I misspelled “Mitt” as “Milt”. I called it “I’m with Milt” and overlookably misspelled something in every overlay.

My other app converted dates to other calendar systems (it was mainly a countdown to the end of the Mayan calendar). This app I called, “ΩiStars” (Oh my stars?) I worked on it for months, but it was so dependent on icons and graphics that when I went to replace the placeholders I had relied upon during development, by December 12, 2012, I still had not worked everything out. I questioned the demand for such an app after the Mayan calendar ended.

It took the better part of the day, but I eventually found all the right resources, sample code, and Xcode tutorials to land on a solution. I posted about it on HariKari.com because I had spent so much time figuring this out when, in the end, it was so simple.

Shortly thereafter I saw apps popping up in the Mac App Store with names like “CodeRunner” and “PHP Runner” and “Test PHP”. My code was so basic and these apps were so much better that I quit using my own.

Recently, though, I’ve needed something more specific to my own dev environment. So I pulled up that old Xcode project and, surprise!, it won’t build. I can’t even figure out how to fix it, either. So I went on a Google safari once again to build the whole thing from scratch.

That’s when I found the always impressive and curious-developer-oriented, RayWenderlich.com tutorial for using NSTask in modern Swift. It’s so much simpler than the original app I cobbled together for personal use and I was able to create a new app with far fewer lines of code and a much more sensible and human readable syntax!

So, first visit RayWenderlich.com and follow the excellent tutorial. It lays out basic details and gives a solid description of how and why this works. Their tutorials are written with people like me in mind – someone who codes for a living, but whose day job does not satisfy the most exciting boundaries of his curiosity:

NSTask Tutorial for OS X

The results (copied from the README):

Behold: Swift-phpRunner

Download project files on Github.com

What is it?

Sample code for running PHP scripts inside a macOS app. Has a very simple and basic UI consisting of a split scroll view and a button.


Enter PHP code in the top view and see results in the bottom view.

Uses macOS default PHP

For simple protability, uses default PHP binary included with macOS. However, it is possible to embed a PHP binary, custom php.ini file, and PHP extensions.

Custom PHP binary

Compile php (or just add your existing PHP binary, usually located at /usr/bin/php):

Then set the path to your custom PHP binary’s bundle resource location:

let path = Bundle.main.path(forResource: "php",ofType:nil)

Custom php.ini:

From PHP documentation:

You can specify the php.ini file in command line by using the following syntax:
php -c [Path to php.ini file] [Path to .php file]

For example:

php -c /etc/php-alt/php.ini /var/www/public_html/example.php
Now the example.php file will run with the configuration set in the php.ini file located here: /etc/php-alt/


Add your custom php.ini to your Xcode project.

Add -c to the NSTask arguments list:


Then add the path to php.ini within your bundle to the arguments list (arguments are added to the command in order):

arguments.append( Bundle.main.path(forResource: "php",ofType:"ini" ))

Additional functionality.

You’ll have to figure out how to set the paths used for extenstions in php.ini separately, but send me a note if you have a solution I can include here. Would be interesting to get xdebug output.

Also, php errors go to the Xcode console log. Would be fun to display them in the app.


NSTask functionality cribbed with comments from: https://www.raywenderlich.com/125071/nstask-tutorial-os-x

Syntax highlighting from the super simple and bare bones Macaw (not PHP syntax, but C-like and very easy to understand – a few tweaks and it’s fine for PHP): https://github.com/kuyawa/Macaw

And this is a much simplified version of something I put together in Objective-C many years ago:http://www.harikari.com/technology/how-to-run-php-scripts-in-xcode-mac-os-x-application.html

Day’s finally over. Week, in fact.

IMG_1067Started out panicking a little that I wasn’t going to be able to give my kids the Christmas I wanted to. My debit card was on its eleventh day of replacement delivery after some earlier fraud.

A few comments from the kids about disappointment over spending Christmas at dad’s house heightened my anxiety, and when my card arrived I went overboard.

In my sudden relief and joy, I let them open several of their “lesser” gifts. Bad reactions and disappointment from the kids brought back dad’s bad response. More panicked spending.

Finally talked to mom and a close friend, both of whom adore Christmas and have been doing it forever, and surrendered to their advice. I had nothing to lose at this point.

Mom: Invite your brother over and have him make dinner. Make a Christmas memory and don’t focus on the gifts.

Friend: Make interesting and cheap stockings. Everything’s going to be discarded and forgotten just as quickly as the expensive gifts, but a grumpy reaction to a single disappointment is easily overshadowed by amused reactions to 20 confusing dollar store gifts.

First thing in the morning I hear screaming: “Dad! Dad! Where are you!” I let them sleep in the living room last night and didn’t get to bed until 3 or so, so I was disoriented and still half asleep. I jump out of bed and Malcolm and I startled each other in the dark as we ran into each other. “Santa did come! You have to see these stockings! And oh my gosh! We both have huge presents under the tree!”

Stockings were an amazing hit, though they both LOVED the gift they opened this morning. Still, icing on a successfully baked cake. But they had both expressed some concern over the week that I wasn’t going to get any presents and that morning there was nothing stuffed in my stocking. *Lesson learned…put some crap in your own damned stocking if it’s hung over the fireplace. So I had also stuffed a microwave popcorn packet into each of their stockings with a note from Santa about how they were to wait for the delayed arrival of the new microwave oven he had ordered for me from Amazon (ours went out in, like, August and I’m replacing it next week). “Hey! Santa brought dad a present but it just didn’t get delivered on time!”

The kids weren’t so thrilled about dinner, but god damn it was amazing to have another adult there with me after this week. And he’s a fantastic cook. Brussels sprouts with uncured bacon and garlic, mashed potatoes with a surprisingly improvised gravy from ramen noodle spice packets (I forgot the gravy mix!), ham steaks with a sweet pepper glaze, and the company of my brother around my dinner table.

Thanks for everything. Not everybody’s near, but they’re close.

Daniel Tammet

This guy fascinates me. He seems so self-aware and capable of explaining his understanding of himself to the rest of us. I once read an article written by a neurosurgeon who suffered a stroke and recorded her experience as it was happening. I love it when people can express their own amazing weirdness in a way that makes sense to those of us who haven’t been through the same thing. It’s the definition of genius to me.

I read one of his books a whole bunch of years ago, “Born on a Blue Day”. Afterward I memorized π to 75 digits over the next couple of days. I used telephone area codes I had memorized at one of my first jobs, home phone numbers I remember from my childhood, family members’ birthdays, and ZIP codes to find the most memorable patterns, and then when nothing matched I just thought to myself, “oh yeah, the bunch of numbers that don’t mean anything…” But it only stuck with me for about 2 weeks. I had to recite it every day, several times to hold the numbers but it was almost completely gone a week later and forgotten 2 weeks later. Well, not completely. I still remember it out to about ten digits. 

3.1 easy. 415, San Fransisco area code. 926, kind of like the 976 porn phone numbers from the ’80s. 535, 5 seven times. I don’t remember any of the rest of it, but I learned about finding meaningful patterns in noisy number trails as part of this exercise.

Meta Bedtime Story

The bed time story I told my kids tonight:

“Once upon a time there were two little boys who were going to bed. Their dad said, please turn off your iPad, Malcolm. And Malcolm said, I don’t want a story! And dad said just turn it off until the story’s over. And Malcolm said it better be short! And then dad said ‘the more Malcolm argued with dad, the longer the story was and the longer he had to sit there with his iPad off.’ And finally Malcolm turned off his iPad and dad was able to finish his story. All of this made Ian so tired and he was having a hard time keeping his eyes open. And then Malcolm prolonged the story by asking if he could turn on his iPad, to which dad said, ‘no! not until the story’s over!’ Every time Malcolm asked if he could turn on his iPad, the story got longer and longer! It was like magic. And then, Ian was so tired that he just couldn’t stay awake any longer and the time when Malcolm got to turn his iPad back on got nearer and nearer. And then, guess what! Malcolm asked if he could turn on his iPad again and the story got even longer!”

Mal: No I didn’t!

Story: “Oh, wait, no he didn’t. So then the story ended and everybody got to go to bed. Except Malcolm who turned his iPad back on and continued to stay up. The end.”

Lord of the Rings

Just watched Lord of the Rings with my boys. Best movie watching experience ever. They were enthralled and Ian started crying when Boromir dies at the end and we all hugged when Sam won’t let Frodo go alone and then Frodo almost drowns saving Sam. “It’s like they’re brothers! Like me and Ian. We would always stay with each other.” I choked up a little.

Malcolm: “I usually like the bad guys better in most movies, but I hate these bad guys.”

Dad: “me too!” ::pride::

Ian: “I like it when people don’t have wars. I hope there’s never a real war. I’m never going to be in the army.”

Dad: “I can’t really talk right now.” ::I didn’t say that::

We’re going to watch Return of the King tomorrow.

The Cat is Boring

The argument that kept my boys awake half an hour past bed time:

Malcolm: “Dad, the cat won’t sit in bed with me. Now it’s boring.”

Ian: “The cat is boring?”

Mal: “No, it’s boring. The cat’s not boring.”

Ian: “Well, the cat’s boring to me because she was in your bed.”

Mal: “That doesn’t make her boring!”

Ian: “She’s boring to me.”

Mal: “You’re boring!”

Ian: “No! The cat’s boring.”

Mal: “You’re boring!”

Ian: “No! You’re boring!”

Mal: “No, you!”

Dad: “Would you both stop talking and go to sleep please? It doesn’t matter who’s boring because it’s bed time and boring is a part of going to sleep!”

One of them: “I’m not tired.”

The other: “Me either.”


A while ago I discovered that the reason Ian starts counting backward from 60 at seemingly random times is that, when I say “just a minute,” he takes me literally and counts down the seconds.

The other day I said, “In about 6½ minutes.”

He asked, “How many seconds is that?”


He groans, “awww… frown emoticon” and then walks out mournfully counting down, “three hundred and ninety, three hundred and eighty nine, three hundred and eighty eight…”

He seemed more annoyed that he had to count down from 390 than that I needed to work for another 6½ minutes before I could come look at his Minecraft water world that makes Endermen do something twitchy (I don’t really understand what was going on with the Endermen and water).