Mark Grealish

Cats and wizardry.


2017

January


2016

Listos version: Lots happened, more yet to come. Stay tuned.

You can’t go home again

Time’s an arrow, one way, here to there, that you can’t turn back. Because that’d be nonsensical, to undo what makes you, you.

Winter tree, winter sky

Taken at Blackrock Park.

Rails 5 join table naming conventions

This is a stupid fucking thing, but here we are. My underling and I wasted 40 minutes today re-figuring this out. Migration: class PluralSingular < ActiveRecord::Migration[5.0] create_join_table :plural, :plural end Model: app/model/foo.rb class Foo < ApplicationRecord has_many :plural_singular has_many :plural, through: :plural_singular end Join model: app/model/plural_singular.rb class PluralSingular < ApplicationRecord belongs_to :foo belongs_to :bar end

Clearly a sushi lover

The grimmest grim view that ever grimmed a grim

Taken from the shore at Blackrock.

The hard life of a vim multitasker

No respite.

Hear me roar!

Simple and dumb MOC theme

MOC <3 background = white default current_time = white default bold directory = white default disabled = white default empty_mixer_bar = white default empty_time_bar = white default enabled = white default bold entry = white default entry_title = white default error = white default bold,underline file = white default filled_mixer_bar = white default reverse filled_time_bar […]

Add sub-controller modules to Rails 5 routing concerns

Routing concerns have been a thing since Rails 4, but this morning I ran into a real annoyance: the documentation doesn’t adequately explain how to pass a module, in cases where you use separate sub-controllers. More than that, even-what if I want to pass any other options? Here’s what I came up with, using splats […]

Oh, Cookie

“No Cookie! Feet are friends, not food! Feet are not for teeth!”

This is the unseen side of my professional working life

The struggle is real.

February


Kill puma

Grr, rage, annoyance, rabble. kill -9 $(lsof -wni tcp:3000 -t)

Caira and Garrett…with hens

Self-Referential “has_many :through” Relationships in Rails 5

A self-referential has_many :through relationship is one where a class interacts with itself through a join table. The classic use are followings: I follow another user. Another user follows me. So a Following is a two-way relationship between the User class and itself. There are a bunch of guides for this that are either outdated […]

Sometimes it’s not all that bad

Blackrock Dawn

Dublin Sunset, February 2017

Asshole

Never mind her surgery two weeks ago.

March


Garrett in Cliffoney, July 2012

July 7, 2012

Ella, Caira and Garrett at the park, June 2011

Taken at Lough Atalia, Galway.

Eadaoin, Brussels, October 2016

Unhappily Coned, February 2017

Poor Cookie. :(

Pretty and red at Blackrock

Perfect and Blue and Empty

The day was too much, so I climbed a hill and decided to be for a while.

Hell of a week

I couldn’t get my head straight on Tuesday so I went to look at the sea instead.

Ballycorus Leadmines

Photographed on my hike today. I was surprised when this photograph came out, let alone perfectly, because the wind blew me flat on my ass as I finished the capture.

Always Grouchy

Taken at Blackrock, Dublin.

Ella and Oisin

I spent Saturday night with Jennifer in Loughrea, although I almost had to walk a chunk of the way. On Saturday I decided to work in the morning and leave at three. Problem is I forgot about the bloody Bus Éireann strike, so I barely made it onto the last bus out of town. It […]

Beautiful Mark, Beautiful Galway

:3 After last night spent with Jennifer, I had lunch with mum in Galway, then wandered the city for the evening. The weather was glorious. I miss Galway, I miss home.

The Ascent of Carrickgollogan

And by the title, what I mean is that I walked over the Scalp, summited the mighty Carrickgollogan, visited the ruined earthenworks of Ballycorus, and thence descended to Cherrywood. The walk was straightforward (some bits up, other bits down), the weather unpredictable, and my thoughts strange. Eadaoin and I are in the middle of a […]

April


New Home, New Life

:(

Annacrivey Woods

Taken while hiking the Wicklow Way.

The Kitter-ties

Geddit? Liberties?

Kilgobbin Church and Three Rock, Dublin

Snapshots from the Wicklow Way

Although by “Wicklow Way” I mostly mean “Cloghnagun” in this case.

Circular shift Roman letters in CoffeeScript

This Codewars problem annoyed the crap out of me. shift = (letter, amount) -> mod = if /[A-Z]/.test letter then 65 else 97 String.fromCharCode mod + (letter.charCodeAt(0) + amount) % mod % 26 The formula to constrain a number to a range is: (range_start + offset_here) % range_start % range_size

In Malahide with my Mammy

Mum came up for the day as a surprise visit!

Three Rock and Ticknock Forest

I went up the mountain for a wander this evening, a perfect followup to tea in Malahide with my mum yesterday.

(Simple!) Sass/Scss margin size management

Like, fuck it. After something like three years fucking with this problem, a realization has come upon me that the simplest solutions are the best solutions. The core of my problem was this: I wanted to manage a set of margin and padding sizes from a central point. I want to base sizes all sizes […]

No to everything

I did an online quiz. Rabble rabble, power to the people.

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 […]

June


The beauty of transience

I’ll be dead some day, dead and gone and left to decompose in a hole in the ground. Everyone has their time. But what’s more beautiful than transience? You have a summer day, and then it’s gone forever. It’ll never be again.

Sietch

Clarkian Magic

I live in somebody’s fictional future. Science fiction writers follow a process. First, they decide where their story will be on the spectrum of happiness-utopia or dystopia? Second, they construct a narrative history which links here and there. And finally, the writer exaggerate their made-up tomorrow for dramatic effect. The writer makes sure you know […]

UX Matters

We read left-to-right. We’re trained to click left-first. Worse, the fucking unhappy path is green. I clicked this “unhappy” three times on three orders before I realized their shit. Edit: On second thoughts, this is asshole design. Make it easy for customers to leave negative responses, then use the bogus data to upsell on services.

Glitchy Sandymount Strand

Taken from the number 47 bus on my way into town. :)

King Billy

No, not that Billy; the other one.

July


I asked for a smile

:(

Take a step…

Taken at Howth, Ireland.

Aunt Chrissie

Taken in Goldengrove pub at Stratford, London, June 2017.

One easy solution for all of life’s little problems

alias fuck='sudo !!'

Duckface Dynasty

August


Summer Rain

Sandymount Triptych

I know where he gets it, at least

2017 and 2009 respectively.

Last light over Phoenix Park

Taken August 2017.

Only Show Actual Work on a Git Branch

I find this useful at work when I need to review a pull request using git or tig. Who did the actual work on the branch, when? git log --author=[whomever] --first-parent --no-merges tig --author=[whomever] --no-merges --pretty=fuller --first-parent That said, we do need to rebase at some stage. :p

And in Temple Bar…

GirlCrew’s app launch made the Irish Times, Silicon Republic and TodayFM. Yeah, I wasn’t mentioned, and yeah, I’m happy to stay out of the limelight, but it’s surreal and wonderful to see an application I wrote in its entirety, promoted and discussed at a national level. Go me! o/*\o

Classiebawn Castle, Mullaghmore, Sligo

Wow. I last set foot in Cliffoney and almost exactly five years ago, when I stopped by to wrap up stuff with my former landlord. The area hasn’t changed a bit. Same people, same businesses. I never thought then that I’d miss Sligo, but with all my problems and busyness and stress in the past […]

Submerged Tree Stump at Doorly Park, Sligo

Sligo Town like Sligo County: I badly missed it. I remember all the walks I took up the river, over the hill, through the forest and around the lake.

Holywell Road, Sligo Town

I knowingly saturated the fuck out of this photograph because the colours of the day deserved to be shown. The Garavogue Valley was a cacophony of vibrant, verdant greens smothered out by the grey skies above.

September


The Wild Atlantic Way, Sligo

Splash of Red on the Garavogue

John Hinde would be proud.

Unound Serenity

Never the same, always the same.

Three Details from Kilmainham

Agency

Your sense of agency can be described as your perception of control in any given situation. Now, yeah, it varies. You feel less agency at work, for example, because someone else owns the product or project, or you need to consider other opinions. You get the idea. Most people have a robust sense of agency […]

Flogging Molly at the Olympia

What a fantastic gig, full of great craic! Mariah introduced me to Flogging Molly years ago when I lived in Las Vegas. They’ve stayed a firm favourite of mine since. Flogging Molly’s songs are of home and loss, of survival and endurance. About where you are and what family means. It meant a great deal […]

Invalid Authenticity Token Errors in Rails 5

Over the last while we had persistent CSRF token issues in our natively-wrapped application. ActionController::InvalidAuthenticityToken The error only appeared to occur under specific circumstances: Open app. Perform any action, then logout. Log back in again. All remote POST/PUT/DELETE requests will fail with token errors. Typical trace: Started POST "/events/147/attendances" for 127.0.0.1 at 2017-09-12 12:17:54 +0000 […]

Double Rainbow over School Street, Dublin

instasort 4.0.1

One bad programmer habit of mines is that I tend to duck type when there isn’t a strict need. I ask whether the object doesn’t fit conditions, or evaluate it against some rules, at times when I have the ability to check its actual type. I thusly duck typed images in the previous version of […]

Eight!

Gar looks so like me sometimes. <3 I hung out with Mariah, Caira and the rest of them on Friday for about thirty minutes. In the middle of dinner at Denny’s. It was fun!

Six Sunny Sunset Skies

Taken around Taylor’s Lane, Prospect Avenue and Smithfield this evening.

The Secret Life of Crows

Ricky Whelan (@rickywhelan) of Birdwatch Ireland hosted “The Secret Life of Crows” last night at the Botanic Gardens in Glasnevin. The lecture capped off my gorgeous Autumn evening walk across from the office after work. While in the line I struck up a conversation from a retired New Zealander couple who are out to cycle […]

Auto-ception

Today I clicked into a mainstream news website which had an autoplaying video frame. The autoplaying video wanted me to watch an autoplaying video advertisement before it’d show me the autoplaying video. There are men and women on this green Earth, brothers and sisters, who deserve to be taken outside and whipped with a chain, […]

Scratch Scratch

Neighborhood cat scratches are best cat scratches.

Liffey Sunset

Hell of a gorgeous evening!

March for Repeal

At least one hundred people attended the March for Repeal today in Dublin.

October


My Body is Ready

\\//

Ghetto Single-Instance Cron jobs on Elastic Beanstalk

Before you read this article, go and read about Elastic Beanstalk’s worker environments. A worker environment is a copy of your application which you configure to handle certain background tasks. In the case of Ruby on Rails, you can configure ActiveJob to interact with the worker tier through the active-elastic-job gem. If a worker tier […]

The Iveagh Trust, Dublin

Thorncastle Street Apartments, Ringsend

Menlo Skylight

Forcibly Set Counter Cache Columns to Zero in Rails 5

(Or any other value you like.) So it turns out that counter cache columns are marked as readonly because Rails handles increment/decrement internally through methods such as increment_counter. Rails does not want you to update the counters by hand. It really wants you to leave the integrity of those fields to the framework itself. Every […]

On Being Vulnerable (as a Good Thing)

We discus vulnerability as a negative because we need to protect vulnerable persons, which is that’s fair. One of the marks of society is in the way we treat our weak and helpless. What we overlook is being vulnerable as a positive. I mean, we’re vulnerable all the time. We’re vulnerable when we share with […]

Poolbeg in Silhouette from Bull Island

Phoenix Park, September 2017

Taken on September 24 on a wonderful warm autumn evening.

Ordinary Day

Taken at Bull Island, October 14.

Anarchy on the Streets of Dublin 8

They respect no law but the law of MIGHT MAKE RIGHT.

Better Version of Bash/ZSH Dependency Tester

Why test for one dependent executable when you can test for them all? It came in useful at work today. function _has { for PROGRAM in "$@"; do if [[ $(which $PROGRAM > /dev/null 2>&1; echo $?) != 0 ]]; then return 1 fi done return 0 }

Perspective

An eerie flat plain approaches a sharp clifftop.

The Littlest Nazgûl

Lil Khamûl.

Gaelcon 2017

Gaelcon runs again this October bank holiday, same as it always does, same as it always has. When I was a teenager, Gaelcon was the be-all of Irish gaming. The con was our annual pilgrimage, the weekend where gamers from around Ireland came to let their hair down. Card games like Magic and L5R dominated […]

November


The Glendalough Valley from Laragh

Taking while on a hike with a Meetup.com hillwalking group. Absolutely stunning day.

Go Party Team!

Holy heck, but one year at GirlCrew. We had an amazing night out at Tippenyaki in Rathmines

December


Menlo Castle in the Snow

What a fantastic start to my winter holidays!

#fastforwardfiveyears

Jesus fuck, but me then. It astounds me what diet, exercise, and a royal kick up the arse have done for my attitude and appearance. And in going farther out, I definitely no longer look like a cringy attic-dweller.

Wet Galway, December 2017

It’s pure fucking Leprechaun magic, how it rained in Galway for a straight fucking week. The fuck.

Still Young

Youngish? Far off may the day be that I can no longer balance on the wall at the Plots.

The Siblings Grealish

Miracle of miracles, I managed to get everyone together for breakfast in Loughrea!

December 26

My head hurts, but it doesn’t hurt. There’s pressure, not in my head but in my head, if you get me. Got an itch in my feet to get up and go, to run and scream and laugh and jump. I’m angry and happy and fucked up and tired and pissed off and content, and […]

Upper Lough Corrib Looking Toward the Maam Valley

Taken beside the Hill of Doon along the Western Way. What a day! What a view!

Madra augus Asal

Taken on the road from the Hill of Doon to Oughterard.

The Hill of Doon

Taken on the Western Way in early December 2017.

Goodbye, 2017

We make our own happiness.