Mark Grealish

Cats and wizardry.


2015

February


Center and size an absolutely positioned box with percentages only

I feel like I have been screwed over with lightheadedness lately, so let’s see if I can churn out something useful. There are times when you have to absolutely position a child element, and there are subset of those cases where the child has to be positioned absolutely in the center of the parent. The […]

I missed January

Well fuck, I missed a whole month. Long story short, I’ve been busy in real life and my iPhone is in pieces in my desk drawer. Back in August or September I dropped my phone into the toilet after a night drinking with Alanna and Casey. The dock module was fried and battery capacity seemed […]

Operation: Break the Site

The website’s appearance has bugged me badly over the past six months. I threw it together in my first fumblings with WordPress, and the sheer amount of things I have learned since on the topics of HTMl, CSS, PHP, UX and usability, Sass and JavaScript has made the site an ever-sharper embarrassment. Frankly, it looks […]

Sass mixins for placeholder styles

It took me like twenty minutes to figure the correct way to do this, so it’s worth a mention. I need to change the colour of unfilled or incomplete inputs in a form, including the placeholder style. Different browsers each have their own ways of handling placeholder styles. @mixin placeholder_style() { &::-webkit-input-placeholder { @content; } […]

Here is no water but only rock

There’s been a lot of uncertainty about where life will take me, but that’s been understandable. I mean, if you look back in to 2013 and 2014 I was mostly a fucked-up mess of a man who could barely get out of bed in the morning let alone say “this is where I want to […]

Operation: Break the Site II

It’s going pretty well; I’ve covered most of my initial goals, and now I am taking further steps to pad out content across the site by adding a list of related posts below each article: $related_posts = new WP_Query(array( 'post_status' => 'publish', 'cat' => $category[0]->cat_ID, 'posts_per_page' => 20, 'orderby' => 'rand', 'order' => 'DESC', 'post__not_in' […]

Garrett: Literally Romeo

March


The smilingest cat lover in all the land

So I saw an eclipse

Any personal blog-this blog-is run out of its controller’s own desire and creativity. Lately I’ve discovered that when people begin to depend on me to provide both of those on demand, on a daily basis, my spontaneous application of them to the blog goes out the window. I could blog snippets of code or talk […]

Automatically add vendor prefixes to properties and values in Sass

I came up with this myself and discovered after that other developers came to exactly the same solution for the problem of vendor prefixes. CSS3’s flexbox is the newest greatest thing in my life. It makes incredible sense and lets me do things like: Vertically center child elements and other content without having to use […]

Operation: Break the Site III

Between my last post and today I admittedly did piss-all with the site and left a good chunk of it in a woefully broken state. I sat down today and got a huge chunk of work done: I added a new comment layout (see here). Returned all meta content to post footers. Re-enabled comment input […]

The Ouro site doesn’t look too bad

Go check it out:

Garrett and Caira in the snow at Red Rock

‘I hate Internet Explorer’ and other pearls of freelance wisdom

I hate proverbial Internet Explorer-whatever the shit browser that happens to cross my path and raise my ire, because I am easily rankled. As of now, March, I have been self-employed for seven months. There have been ups and down. I have experienced all of the thrills and spills, the joy of the paycheque and […]

Day out in Dublin

I had a crap week, so I hopped on the bus to Eadaoin last night. Thanks for the magic of my new cellphone I photographed today’s wander around Dublin: We walked from Eadaoin’s house over to the UCD campus at Belfield, got trapped by heavy rain and took a bus into town to the Science […]

Operation: Break the Site IV

I’ve fixed yet more crap since part III in this series: Search works now. Side-by-side flexbox layout for multiple images. Tested the site in live Internet Explorer and across multiple devices. The site is getting less bad.

April


Create multiple folders at once

The Bash shell supports curly brackets to match groups of wildcards, and you can use this to quickly create multiple folders in one go without using a loop: [z][mark][journal] $ mkdir -p assets/{sass,js,images} [z][mark][journal] $ ls assets images js sass

All of you assholes need to stop punching me in the face

This is not a request. When I was 12, a neighbour’s kid punched me in the mouth while I was making faces at him. Ever make faces while blowing on glass? Punch. Then when I was 18 or 19 15* my sister threw a remote control into my face while we fought over control of […]

I think I just joined Team HTML5 Video Fad

It was remarkably easy to do once I came to grips with the plethora of browser-specific quirks and workarounds.

Garrett and Caira do Easter

Eadaoin and I did Easter too

It wasn’t just my kids who enjoyed Easter. Eadaoin and I are home at last after a weekend in Dublin and Tipperary. I went up to Dublin on Thursday night and stayed at her house ahead of my dentist’s appointment. I went home from the dentist in a fair bit of pain, so we chilled […]

Lenny

Ginger whore cat. Shocker.

I learned me some Illustrator

Dynamic-ish CSS spritesheets

CSS spritesheets are cool, even if their use is hacky as hell. You can drastically lower the load time of a site with a little prep work, but did I mention their use is hacky as hell? A sprite sheet works by showing a portion of a bigger image instead of downloading many smaller images. […]

Overly-dramatic Mark

Props to Eadaoin for the great shot. :D We went up to Dangan yesterday, but the weather was dull, the trees were barely in bloom and there was nothing neither of hadn’t photographed in better light. A shower caught us at Corrib Village, so we stopped in by the boat shed, and Eadaoin shot this […]

These are the things I do to trash talk my girlfriend

I couldn’t tell you how the crap this started, but suddenly trash talk about cupcakes is flying thick and fast on Facebook and I’ve been challenged to a cupcake-off at the Iveagh Gardens this summer. I am so fucked.

This is why I hate the WordPress community

I understand that GPL license gives you the permissions to modify the code and then do whatever you want with it, claiming as your own work, but we are not very OK with this, because this is a commercial theme and there are a lot of people who preferred to buy a premium theme rather […]

May


Font sizes

Good Christ above; I’ve been working with this stuff for literally years and didn’t realize how everything meshed together. It always struck me as complex, that there are many parallel paths up the same cliff, which tonight just confirmed. 1 foot = 12 inches 1 pica = 1/6 inch 1 point = 1/12 pica 1.25 […]

Killiney Hill

I was in Dublin two weeks ago. We were supposed to meet Jennifer and her kids for lunch in Dublin, but she cancelled. I took Eadaoin to the Liberties, we had lunch in some really kickass Korean restaurant and then Eadaoin took me out to Killiney Hill. It was gorgeous. The sun was out, the […]

A robin came fluttering, fluttering down…

Eadaoin submitted the robin photograph to /r/redditgetsdrawn on Reddit. I’m not going to link the thread because it would immediately give away the usernames of everyone involved, but thirty seconds of thought will find you them. But anyways: in the thread, artist Lizzy Zumbaugh replied with an absolutely gorgeous interpretation. I mean this seriously; it […]

Operation Break the Site V

AKA “Who’s left to care?” While the front-end appearance of the site hasn’t changed too much since the March update, the back-end appearance certainly has. I’ve pushed about eighty commits to Sheepie in the past few days with the goal of refactoring the code and bringing it to a higher standard: I renamed the theme […]

The Cliffs of Moher

True story: Eadaoin and I got on a bus to Kylemore the day after my birthday, except it was the bus to the Cliffs of Moher. Something YOLO fuck it. It was a lovely day outside of some awful nausea for the first hour. The weather was gorgeous, except when it was bad, and when […]

I found a folder of webcam snapshots

Images range in date from October 31 2010 to January 28 2012. Some photographs (2010 and 2011) were taken at Prospect Hill, Galway, while the remainder come from Cliffoney Co. Sligo with one or two from the library at I.T. Sligo.

Godspeed you magnificent ornery bastard

It is easy to be a fair-weather atheist. Anyone can do it with a tiny bit of laziness; you just don’t go to church, don’t pray and scoff at the notion Big Dude up above. But, inevitably, there comes a day when you have to face up to what it means to deny an eternal […]

Mostly CSS3 lightbox

I wanted a very simple and light lightbox for images on the blog, since my content has always been image-heavy: click on image, see image, close image. I hit Google yesterday for a CSS3 lightbox and found this remarkable codepen by Gregory Schier. It exploits the :target pesudoclass to create a modal box without JavaScript. […]

I had a code review

Nothing as in depth as a line-for-line pickapart, but I asked for feedback on boards.ie. The feedback was great and has led to a huge performance boost to the site: I moved all of my media content to a local subdomain; I added a DNS prefetch directed to the media subdomain; and I changed jQuery […]

You’re never too old to learn a basic lesson

So I shit you not, I have to learn to walk again. Story time: Back in the Prehistoric Time of May 2008, I used to catch a crosstown bus most of the way to work in Las Vegas, and then walk the rest of the three miles. I did this way because it was exercise, […]

CoderDojo Galway

David Kelly has started a CoderDojo with the support of the Bank of Ireland branch on Mainguard Street. A CoderDojo is a programming workshop aimed at children in the 9-15 age range. The idea is to give an introduction without overwhelming. A CoderDojo is there to convey the concepts in an accessible and inclusive manner. […]

Ireland votes yes!

On Friday, Ireland voted in favour of equal civil marriage for all people without regard to gender. This has not been without controversies. The movement for equal marriage has steadily gained traction in Ireland right from the moment that the country decriminalized homosexuality in 1994, and right here, now, it has reached the critical mass […]

I went to an award ceremony in a t-shirt

I am, in hindsight, rather mortified.

Lay off Roscommon

Okay so. As far as my data goes: Click either here, or on the image of Ireland, to see a bigger version of the SVG file.* The Google spreadsheet I used to compile the numbers can be found here: https://goo.gl/JwyeJf I pulled all of my raw data directly from this page at the referendum.ie website: […]

Random workstation photograph

I needed to test my upload script. :)

Blog statistics

I have begun to add back the missing archive functionality. To accomplish this I added several functions which display information about the content, along with a wrapper function which will print it all.

Yes-vote memorabilia

June


Raleigh Row triptych

I had pictures to use up, so why not?

And now I live in Dublin

It must be natural to divvy your adult life up into booklike chapters, because many people seem to do it. The chapter I’ve just turned a page on was lengthy, running from November 2009 to May 2015. Yes, six years is overlong for a Life Chapter, but life is one of those funny books with […]

So who decided code snippets had to be boring?

Behold my new workstation

Eadaoin helped out with a part of the cost. I’m indebted to her for the assistance!

Now what?

I’ve achieved all of my short- and mid-term goals and desires: career, relocation, home office, freelance career and awesome girlfriend. My code isn’t that bad and my graphic design has seen use in startup branding. I am still no closer to Caira or Garrett, but the Legalities Creep Slowly Onward. I have it all, and […]

Get an array of per-year and per-month counts of your WordPress posts

I had to research this for a client. Their project requires a list of posts per month and per year over the duration of the blog but, like mine, they have a lot of posts spread over an extended period of time. It would benefit me to have the same count, so I approached a […]

Hermes, from The Martian

The orbit is backward, the solar panels are pointless, and there are a whole boatload of other scientific errors in the first teaser for the film adaptation of Andy Weir’s The Martian, but damn, Hermes looks fine. MATTTTTTT DAMMMMMONNNNNNNN!!

There is no heartier sign of a day well spent

So this isn’t Lenny

This adorable ginger tom came mewing up to me after I called him. He’s definitely not Lenny, but what’s one more ginger, eh?

My glorious day at the District Court

Disclaimer: I am not a lawyer. Do not interpret this article as anything but an account of my personal experience. Do not interpret this article as legal advice. Speak to a solicitor if you have questions.

WordPress libraries for all the family

It’s been useful in the past to modularize portions of my WordPress theme, so here you go: https://github.com/bhalash/social-meta https://github.com/bhalash/article-images Social Meta generates Twitter Card and Open Graph meta tags that contain information about the blog, the post and its content. Clicky here for an example. Article Images is a more utilitarian script which gives you […]

Get the dimensions of any WordPress post image

I spent 12 hours writing these functions for two libraries, so I will take half of one to write about it. I have kept this blog for eleven inclusive years (2005–2015). I intend to continue to do so for so long as I am able and interested. To add to this, I was exposed to […]

Week 2 with Killer

LOOK AT THE PAWS

Adverts!

Ciaran at Tuairisc.ie is on holdiays so I have been handling adverts for the site in his absense: It’s been a different kind of challenge to do this (you try to track down vector branding for regional companies!), although quite fun.

All hail the glorious vim master race

OR: “Moving from Sublime Text 2 to vim.” Click here to revel in my glorious vim master race desktop. I have used Sublime Text since 2011. I don’t know when I first used it, beyond clear memories of it open in class during my first year at I.T. Sligo. I asked “suggest a prettier editor […]

SSL master race

Let the excitement…commence! I purchased SSL certificates through Namecheap.com for: https://www.bhalash.com/ https://ix.bhalash.com/ :D

I hate PHP

Gerry sent me a link to PHP: a fractal of bad design after I posted a Facebook rant. My problem is this: PHP has several functions that fetch date. Two “big” one are date() and strftime(), which have different date format syntax. WordPress uses the syntax for date(). I’m sure there are good historical reasons […]

Bray Head 2015

So holy shit, Eadaoin and I have been together for almost a year. We have completely failed to manage to kill one another, which is great; it’s a real step up from my marriage. Our first trip together was to Bray and Greystones in Co. Wicklow, where we walked the cliff trail from the former […]

12 kilometre Dublin death march

Eadaoin and I gave my life a lot of thought after my rant about goals in June. So my Quetelet Index is north of 30, and from there it only gets better. My measured cholesterol levels, if I told you them, would raise your eyebrows, and my levels of physical are low enough to describe […]

Eadaoin II

Well, one year and counting!

July


Make flexbox work in older versions of Internet Explorer

Spoiler: You can’t. Sniffing for browsers to determine available design or features is considered a Bad Idea. It increases the complexity of your project. It ties you to specific browser hacks that act as a wall against future progress. It is a bad habit, plain and simple. This rule applies to all modern browsers: every […]

It isn’t a trip to Galway without Lenny

Force WordPress to load /all/ JavaScript in footer

While this was not my own fix, it is useful enough to deserve more visibility than it has now. For the sake of performance I wanted to force all WordPress JavaScript to load in the site’s footer, not in the default header. Plugin and theme developers enjoy the freedom to load all scripts wherever they […]

Hail Satan \m/

I travelled to Galway on Saturday to memorialize Michael while Eadaoin was at her family’s summer barbeque in Tipperary. My sister came up with her kids to watch the cat and house, so something something mice played. As great as it would be to have a post about Saturday, it can be condensed to optician, […]

This happened last night

Somebody, somewhere caved in. I spoke with Caira and Garrett over Facetime for about forty-five minutes. :)

Feeding time at the zoo

All of you assholes need to stop trying to break into my site

Ralph Smith (@DoMyBooks) put out a tweet this morning about attempted logins on his WordPress site. My curiosity was piqued, because last week I wrote a two-thousand word article about parsing Apache log files. I used my own log file as the template for the article, and one thing that stood out were the high […]

And now it’s there

The second post ever published on this blog was written about New Horizons on January 18, 2006, one day before the space probe launched from Florida for Pluto. And now it’s there-literally there, because New Horizons is less than fifteen minutes from Pluto periapsis as I write this post. New Horizons has been in flight […]

Colour Dash 5k, Phoenix Park 2015

x to y of z search results II

The code snippet I posted last August hasn’t worked too well: It only works for the index.php loop of all posts. All other loops (search, taxonomy, archive, etc.) have weird counts. I changed it to use the global wp_query variable to determine post count, with an addendum for private posts if I am logged in. […]

The accidental 15k walk

Whoops. Eadaoin and I went for an accidental fifteen kilometre walk on Saturday. In inappropriate gear, no less. “…wait, what?” I hear you sputter in consternation. Yes, it was dumb — I was dumb, to not grasp the length. So, in short, we decided to walk from Blackrock to Poolbeg Lighthouse by way of Strandybeach […]

I updated Social Meta

Some dude made a request for an Open Graph plugin on the /r/wordpress subreddit. I gave a pointless link to a library I knew he can’t use, because his question was lazy: https://github.com/bhalash/social-meta I realized the library can be fiddly to use when I looked back over my post, so I refactored the script as […]

^([Kk]il+|me|[no]w)$

I spent today writing a two thousand word article on regular expressions. Symbols dance around when I close my eyes. Kill me now.

Pluto, full disc

I merged: https://solarsystem.nasa.gov/multimedia/display.cfm?Category=Planets&IM_ID=20311 https://solarsystem.nasa.gov/multimedia/display.cfm?Category=Planets&IM_ID=20312 It is a Friday night and I am too drunk for any remark beyond I’ve waited too long for this.

Recursive sass asset manager

I have a stack of assets that needed a minimum-fucking-around solution to manage and load on demand, so I came up with this function: Call it with a mandatory asset and optional variants, and it returns the path to the asset wrapped in url($foo);. @function asset($asset, $variants: null) { $asset: map-get($assets, $asset); @if ($variants) { […]

Porn, porn, porn

I’m at the bottom of kind of rabbit hole where you stand knee-deep in shit and wonder how the fuck you got here. So two of my last three articles were on the subjects of the Apache log file and regular expressions. Then this morning a plagiarized article popped up on Reddit. The plagiarism was […]

Mountebank Mark

When I was at my worst I had constant manic fits. Anything at all could bring it on — a photo of the kids, a chance meeting, or spontaneous flashbash could set off an anxiety attack. It would spread out over the course of up to a week and diffuse into my daily life. The […]

More Social Meta updates

I have never used crafted excerpts any more than I use the media library, but today that became a problem. WordPress expects an excerpt when you call get_the_excerpt(). If it doesn’t, it calls wp_trim_excerpt(), which generates a dynamic excerpt from post content. wp_trim_excerpt() doesn’t accept arguments, nor can it be called outside of the main […]

August


This is procrastination

Right now, at this exact moment in time, I have work to do. Before me I have a spread of code open in vim, a small JavaScript library that I have to refactor into a jQuery plugin. It is open, but I have made a willful choice to dally here instead. I have #ubuntu on […]

Mullingar is miserable

This is tongue-in-cheek, so put down your (miserable) Midlands pitchforks.

How well my girlfriend knows me!

Split up columns evenly with flexbox

I need to split up children elements on a regular basis (like here), and I realized that it was a waste to do it piecemeal. So: $separation is the percentage separation between columns. $separation: 2 is a 2% separation between columns, after they are sized. So, with this and two columns, each column would be […]

Mostly CSS3 lightbox II

…now with 480% more JavaScript! I rewrote the lightbox I put together in May. Wikipedia added a cool feature a while back: it you click on an image, the lightbox image is added to the URL hash. Later, if you follow the hash link directly, the image will open in the lightbox. Click through to […]

Back at an Almost-likeable Place

Aafke kindly invited Eadaoin and I to visit and stay with her on her farm in the first week of August. Kinda funny, the timing, because then there was a background miasma of drama with my ex-wife, and now there is is a background miasma of drama with my ex-wife. Some things endure. Eadaoin was […]

Holy shit, we climbed the Great Sugar Loaf

It was a scary, sobering experience. First scariness: our paper map was outdated. The trailhead I wanted to use doesn’t exist anymore. The trail seems to be still there, but access isn’t, and we didn’t discover this wonderful fact until after we’d walked for a mile along a narrow main road for twenty minutes. Thanks […]

(Better) dynamic CSS columns through sass

I spent an hour on Google after my last post on dynamic columns. I wanted an idea of everyone else’s solutions to the problem of “how can I generate dynamic columns with Scss?” I found: Seb Kay, who doesn’t attempt dynamic generation, and instead pre-generates column classes; Steve Hickey who modifies pre-existing bourbon code; Luke […]

:w saves decals arrived :D

The decals came courtesy of Reddit. All glory to the vim master race!

WordPressish Beholding

I floated the idea of these articles to enthusiastic approval on /r/wordpress/, so here we are. My name is Mark, and I’m a jack of all trades: I write, code, design and admin for a living. Sometimes the write, code, design, and admin has a happy intersection with WordPress. The site precedes the recent backlash […]

Hirsute #5, by Sean McCormack

Hirsute is a new portrait project from Sean McCormack which comprises Handsome Bearded Males Galway photographed in 2014 and 2015. Sean photographed me (I think) last Autumn at his Tuam Road studio.

One month of Killer

Killer was, and remains, a huge asshole, but we still love her.

Sheepie update!

I ran Sheepie through Theme Check and discovered some awful, shocking things about the theme’s compliance with WordPress standards. The awful, shocking things seem a tad hypocritical in light of a post series about WordPress, so uhm, I cleaned up the theme: Functions are now correctly prefixed with sheepie_. Textdomain tags are now correctly ‘sheepie.’ […]

September


My cat’s vet name is hardcore

Goddammit, Past Mark

I gave such an efficient answer that this post was the top Google result for “wall of photographs css.” I wanted to take another crack at the problem from a different angle, but no, I already have it solved. Jerk.

Sandymount sunset

So I wrote a jQuery plugin

JavaScript does my head in, always. The language does any number of cool things, but the sheer variety of ways in which we can do the cool things makes my head hurt. I came up with this date checker plugin for a client piece. Take in element, element prefix name and optional millisecond epoch time. […]

I went to a job fair

I am now eligible for admission to the hallowed chambers of White Guys Wearin’ Oculus Rifts. Career Zoo is a biannual(?) job fair held at the Convention Centre Dublin over by Spencer Dock in Dublin. Career Zoo was scary, reaffirming and humbling all at once. I don’t expect any callbacks because: my resume is mediocreeeee; […]

How much would I weigh on…?

I have a morbid interest in how much I would weigh on various celestial bodies. This isn’t for everyone, but visualization of weight helps me quantify extrasolar worlds and weirdos like neutron stars. I played around with a spreadsheet yesterday to start off. I came up with a couple of functions to calculate equatorial surface […]

Pluto, spherical mosaic

This mosaic of Pluto, centered on Sputnik Planum, was released on Thursday as part of the new data downlinked from New Horizons. It’s a gorgeous stitch of a gorgeous planet. I don’t think anyone expected a carbon monoxide glaciers and pristine new ice plains at the equator of Pluto, and I for one am glad […]

WordPressish Beholding II

Work and illness had the best of me last week. I was busy all the way through to the weekend, and at the weekend I crashed hard. In the first part of WordPressish Beholding I used a waterfall analogy: I started at the top of the stream with servers. From there I descend into WordPress […]

Happy sixth birthday Garrett!

http://poorlydrawnlines.com/comic/the-time/ / CC BY-NC 3.0

Kaleidoscopic Eadaoin

Taken at the Science Gallery in Dublin on Saturday. Eadaoin’s aunt Trish and cousin Emer came down from Sligo for an event at the Tiger Dublin Fringe Festival, and stayed with us for the night. In the end Trish and Emer (and I; I was at home writing) arrived late and missed the Gaeilge Tamagotchi […]

An Klondike

You know what? It’s been a year and the production company have yet to pay me for my day of extra-ing, and I have a scar on my foot from the godless misshapen boots I wore. I retroactively withdraw permission to use my likeness and heretofore demand one million dollars of compensation. I am, in […]

Variable sass self/child selector

I had a problem: I had a mixin. This mixin had a payload of rules that I wanted to pass to the selector that called the mixin. Sometimes, however, I wanted to send the code to a given child selector instead. I played around with variations on Sassmeister until I came up with a mixin […]

My neighbour’s whore-cat

She’s even sweeter (and noisier) than Lenny.

Pluto, backlit panorama

I have a raging space boner. https://www.nasa.gov/feature/pluto-wows-in-spectacular-new-backlit-panorama This is the most gorgeous photograph I have ever seen from space, and for once this isn’t even hyperbole. New Horizons took this panorama fifteen minutes after closest approach to Pluto (source). It was taken at a low, oblique angle backlit by the sun. I’m not a planetary […]

Dumb jQuery menu state plugin

It’s dumb in the savant sense – there’s nothing more complex than a class toggle to hide other menu items when a button is clicked. The state manager links a button a button or hyperlink with a target element. When the button is clicked, classes are added to both the button and the target element. […]

I’m proud of my son

I love my two kids to death, even if I have to do this from halfway around the world and despite adversity. Caira is wild, smart, shy and her own person. She has her birth dad’s wit and grotesque humor, and her mum’s love of the natural world. Garrett is a stubborn sweetheart, full of […]

Court: anticlimactic

See My glorious day at the District Court if you want a recap of my first appearance. It was depressingly mundane: I arrived, I identified myself and then I sat in a hall for three hours before my ninety seconds in front of a judge. Maintenance for Garrett was agreed and I went home to […]

Here’s a hypnotic spinning cyber oyster

Shit got weird this morning on Twitter.

Sheepie and scss-helpers v1.0

Cleganebowl has nothing on this hype train: https://github.com/bhalash/sheepie-theme/releases/tag/1.0 https://github.com/bhalash/scss-helpers/releases/tag/v1.0 Sheepie I have used Sheepie as a testbed, sandbox and ongoing learning exercise for the entire while that I’ve worked in web development. 943 commits is well enough for me to put up draw a line across versions and make a formal release of 1.0. Sure, […]

Tags: is either empty or missing in style.css header.

Theme Check will sometimes throw up a confusing warning about how the style.css file is missing proper information: RECOMMENDED: Tags: is either empty or missing in style.css header. It took me a while to figure out that it was caused by more than one file named style.css in the theme directory. Theme Check applies the […]

Pluto, full disc in high resolution

I thought we had the best photograph of Pluto until we got better: NASA released this photograph of Pluto’s disc on Thursday. Giddy me then spent an hour of my afternoon cooing over surface features. The full-sized version is a 68 MB, 8000 x 8000 pixel PNG version packed with glorious detail. So what’s my […]

Crazy cat lady diptych

We spotted this adorable and friendly tortie in Churchtown.

Rethinking Sass media queries

A look around told me that most Sass media query solutions fall into the pattern of a mixin that either calls a mixin, or from a list of preset variables. Mine looks like this: @mixin media($args) { $type: nth($args, 1); $start: null; $end: null; @if $type == max { // Can't interpolate a mixin, so […]

October


SO in love

This a souvenir of our holiday arrived in my inbox this morning from Aafke. :)

Friday at Powerscourt

It’s past 11. I’ll tag these in the morning.

Caira and Garrett, October 2015

Sass mixin to generate pure CSS hexagon

I had an interview test which in part involved a CSS hexagon, so I wrote a mixin to generate one on the fly. The mixin in turn requires several other functions (such as to fetch the square root of a number), and because of this I added a math function library to scss-helpers. You can […]

Sass modular scale function

A mixin for modular scale sizes popped up on Reddit. It wasn’t written well – it tied a bunch of unit measurements together, and was fixed to use the em unit. Wait – just what the heck is modular scale? It’s a ratio which you set, and each increment of font-size (or whatever) equates to […]

Hacktoberfest: won

I put through a bunch of improvements to scss-helpers (MIT license, go grab it!) and a friend’s fork of an old theme.

Sass power function

This was fun to write. Raise or lower a number to any power, although you are limited to five digits of precision. Any number of greater precision is rounded off to the nearest whole number, so you couldn’t have an rem font-size equal to the gravitational constant (not that I’d want to do this): #gravitationally-awesome […]

Lightbox test

This test doubles as a pretty photograph of Poolbeg taken from Blackrock.

Knockout lightbox

That’s enough Sass posts for now. I am on an MVC model-and-framework crash course prompted by the pressures of the job market and a project. For the time being I’m using Knockout, because Knockout has jQuery-ish DOM event bindings. The needs of the project required me to watch for DOM scroll and resize events, then […]

Srcset test

I have wanted to play with srcset, but the effort involved to apply it backward to all of my prior posts was scary. I’ve settled on this configuration: <img src="https://ix.bhalash.com/13544805697/m/1-840w.jpg" srcset=" https://ix.bhalash.com/13544805697/m/1-414w.jpg 414w, https://ix.bhalash.com/13544805697/m/1-768w.jpg 768w https://ix.bhalash.com/13544805697/m/1-640w.jpg 640w, https://ix.bhalash.com/13544805697/m/1-840w.jpg 840w, " alt="Srcset image test (and Killer hijacking my seat)" />

No more jQuery

Here’s a change: your Sheepie experience is now free of jQuery unless you are a dirty IE9 peasant. This morning I removed the last piece of jQuery-dependent code, a preprocessor for highlight.js. highlight.js operates on <pre> tags with a <code> child element. Since I have a few hundred older posts without code that I didn’t […]

Fetch the raw WordPress menu associated with a menu location, and add attributes to a menu item’s HTML

Today I signed the contract on a frontend developer position here in Dublin, so with any luck this might be my last post on WordPress, ever. The menus users create in the WordPress backend are stored in the wp_posts database table as discrete post objects, and the usual method to access the menus is through […]

November


prep 6.0

I took three hours out of tonight to add srcset capability to my image upload script. https://github.com/bhalash/prep The srcset test was hand-everything: hand-copied, hand-mogrified, hand-uploaded and the HTML assembled by hand. The updated script: Copies images to the thumbnail folder. Shrinks thumbnail images and resizes them into each size in the srcset array. Generates link […]

Three random narcissistic selfies

I’m testing a script, ignore.

Caira and Garrett, Hallowe’en 2015

Project Euler Problem #1

I’m on a Ruby refresher through Project Euler. I’ve come a long way since my brute force C# solution in 2012. def sum_to(multiples, end_num) multiples.map! do |number| number = number.to_f max = end_num - (end_num % number) number = (max / number / 2) * (max + number) end end three, five, fifteen = sum_to([3, […]

Project Euler Problem #2

This is again less brute-forcey than my original C# solution because I used an algorithm to find the next Fibonacci number in line. def fib(n) # fib(n) = round(ϕ^n / √5) phi = 1.618033988749894 sqrt_5 = 2.23606797749979 (phi ** n / sqrt_5).round end fib_n = 0 fib_val = 0 fib_sum = 0 while true do […]

Project Euler #3

Problem #3 in C#. require 'prime' p 600851475143.prime_division.map { |f| f[0] if Prime.prime?(f[0]) }.max

Project Euler Problem #4

Still bruteforcey, just less so compared to my original C# solution. def palindrome?(str) str == str.reverse end def largest_palindrome(range) palindromes = [] range.each { |x| range.each { |y| xy = x * y palindromes << xy if palindrome?(xy.to_s) } } palindromes.max end p largest_palindrome 100..999

Project Euler Problem #20

Problem #20 is probably the easiest problem. Hurray for builtin functions! Original C# solution. p (1..100).reduce(:*).to_s.split(//).map(&:to_i).reduce(:+)

Project Euler Problem #13

My previous C# solution was…actually a Bourne shell script, because C# made this problem a pain in the ass: Add System.IO namespace. Add System.Numerics namespace. Walk through all of the pain-in-the-ass steps to read the text file and work with BigInteger. Shell? Read file, add lines. Ruby was even easier: p File.read("13.txt").split(/\n/).map(&:to_i).reduce(:+).to_s[0,10].to_i

Project Euler Problem #19

Holy shit. Here is how far I’ve come: Dat C#. Dat leap year function. Dem lack of braces. I remember the Wikipedia articles and blog posts I read to figure out leap years, and the hours of trials to get function right. Here’s my 2015 leap year function: return year % 400 === 0 || […]

Fibonacci’s method to find Pythagorean triples (in Ruby)

When I made my first run through the Project Euler problems I: did not care so much for algorithms, as I did about the solution; and wrote my code such that its function wouldn’t be obvious. There was an unspoken rule about Project Euler: “don’t give away the answer.” You can paste my code into […]

This is my life now

Hell of a week

This blog post came about because I needed to practice my typing. On monday last I began my new job as a Ruby on Rails developer in Dublin, 9-5 Monday to Friday and probably overtime as I advance in the position. And what does a developer do but type? My WPM is an okay 80 […]

Mmm…sacrilegious coffee

There was a bunch of taff on Twitter about coffee cups…so why not?

Rails is hard

I’ve spent the past week learning Ruby on Rails by way of a crappy Twitter clone named nttr, which I bill as “the world’s first vowelless microblogging service.” I now have an appreciation for how hard it is to make a shitty web app, let alone a good web app.

December


Wexford

Bit soft, like, thanks to Storm Desmond. I was in town for the work Christmas party.

cd to root git repository folder

I have lately done much work inside of git repositories, and cooked up this to make navigation of deep trees a little easier: git-root() { if $(git rev-parse 2> /dev/null); then builtin cd "$(git rev-parse --show-toplevel)" else echo "cd: not a git project: ${PWD}" fi } alias gr='git-root' I added the function to my zshrc […]

Killer, 2005-2015

Killer was put to sleep today after several months of illness. I wasn’t there, but I was told she had a can of tuna before the end. Godspeed you magnificent asshole.

STAR WARS GET HYPE

Eadaoin and I took in The Force Awakens last night at the IMAX on Parnell Street. The 3D fucked with my eyes (heterotropia and most of the film was a smear as a result, but the film was incredible. Beautiful and wonderful.

2015

Angst is the wellspring of all creativity. You drive yourself, rage against whomever for whatever and fruitfully Cool Artsy Stuff as a byproduct. Most creatives I know are depressives. There’re posts about it from someone every other week and it comes up in everything we have drinks in a pub. This is relevant because I […]

Dun Laoghaire before Christmas

prep 7.0

I fixed a bunch of brokenness in prep: Script will exit if config doesn’t exist. Script will exit if files aren’t passed to the script. Script will exit if necessary executables (mogrify) aren’t found in $PATH. Script will gracefully fall back if a suitable clipboard program is not found. Script now correctly uses temp folders. […]

Biannual scrape of photographs of the kids

Their family and I are back on talking terms for at least the next week. I spoke to them last night and had the opportunity to see and share photographs on Facebook.

Wherein I spoke to Garrett on FaceTime

So Caira is Caira is Caira, as you should know if you know Caira, and Caira was being Caira. Garrett: “Caira stop being such a dipshit!” Me: “Garrett, don’t use words like that! She’s your sister!” Garrett: “Yeah well I wouldn’t if she wasn’t a dickbag.” He’s his father’s son.

Hi! :)

Some neighbourly smiles from Eadaoin and I. :)

instasort 3.0

The last time I tackled this script it was way more fucking complex, what with per-OS checks, multiple loops and regex globs. Oh my. Single loop. find regex replaced by case structure. Streamlined image check and ratio functions-I only care if the image is square. Safer handling of false positives and non-image files (they get […]

Second round of photographs

Anarchy

Eadaoin and I took in Dublin’s Natural History Museum this morning after a lovely walk in from Ranelagh with coffee in hand.

Zshell send-to-clipboard function

I thought it would be fun to share, because I use a slightly different version of this in my image upload script. The function: Scans the system via which to find the first installed “send to clipboard” program. Fall back upon cat if none are found (from there you can copy and paste). Redirect the […]