Mark Grealish

the life and code of a crazy cat man


2017

May


Somewhere Else

Taken at Three Rock, Co. Dublin.

With the Grealishings

Taken at 56 Central, Galway.

Galway, May Day 2017

Darren at Walpurgis Night

\m/

Generate all the rotational permutations of a string

This does not generate lexicographic permutations (use Lexicographer for that!); this plucks off one letter from the end and attaches it to the start: rotations = (str) -> Array(str.length).fill(str).map (rotation, index) -> while index-- rotation = rotation[-1..-1] + rotation[0..-2] rotation I liked my solution and wanted to share.

Happy early birthday to me

I enjoyed Magic: the Gathering, barbeque and a nightcap finger of whiskey.

Some shit you cannot make up

I mean, while David Zindell did make up this shit, I didn’t make up my telling of it. Before you lies a description of the mighty dick of a race of hermaphroditic transhuman seal-people.

Ella and Oisin

Taken at Eyre Square in Galway, May 1 2017.

Avoid N + 1 issues in Ruby on Rails when checking existance

How perfect and clear, hindsight! This was another “oh, duh” moment for me. Stupid means humble means another step closer to enlightenment, so that’s good. In our application a user may favourite content in a manner à la Facebook. When rendering views, the naive way (the Mark way before this post) is to test for […]

instasort 4.0

Another year, another version. My growth as a programmer strikes me when I compare previous versions with the latest code. Less code which works better. You may compare the last three versions together on GitHub. #!/usr/bin/env zsh # # Functions # # # Check if Photograph is (Approximately) Square # # While it was originally […]

Ow, my legs

17km there and back to Glencullen, but by Christ, I had the weather for it.

I met a doctor walking his horse

We chatted together for a while along the road to Glencullen, then went our ways.

Two-thirds sky

Days like today-skies like today, I miss Nevada something fierce.

Bray moonrise

It was lovely there tonight. <3

At Balscadden Bay

I spent an enjoyable evening in reflection on the beach. :)

The descent to Balscadden Bay

Taken at Howth, Co. Dublin.

LinkedIn, distilled

Someone with the job title Recruiter viewed your profile.

Convert PSD to flattened PNG file with Imagemagick

This turned out to be quite useful at work today: for PSD in *.psd; do convert "${PSD}[0]" "${PSD/psd/png}"; done

Moate, Co. Westmeath

This was the best of a set of panoramas I captured from the bus as it went through town. More than the rest, this one shows Moate’s character.

The family Grealish

On the occasion of Ella’s religious thingy.

Slieve Gullion and the Mountains of Mourne from Leopardstown

Taken while I leant out my bedroom window, of all places!

A (glitchy) Irish country home

Taken from a bus somewhere in Westmeath.

So she took my glasses and called herself a dumb nerd

This is the cross I bear. My niece is the worst. Woe is me. Life is pain.

I triggered a tickle fight at 3am

I find nothing to complain about in such a crazy turn of events.

The Summer Day

The Summer Day Who made the world? Who made the swan, and the black bear? Who made the grasshopper? This grasshopper, I mean- the one who has flung herself out of the grass, the one who is eating sugar out of my hand, who is moving her jaws back and forth instead of up and […]

Pretty Stack Overflow-style resource URLs in Rails 5

Stack Overflow uses routes with the format /:id/:title for questions like this one, which I find to be more memorable than simply a terse ID. I’ve decided that I want this for my new project, a rewrite of this blog in Ruby on Rails 5. Small changes to a model and its routes are required […]