Saying Good-Bye to a Reluctant Superstar

Neil Peart, 1952 - 2020
Neil Peart, 1952 – 2020. Photo by Fin Costello/Redferns.

I awoke this morning to the incredibly sad news that , drummer & lyricist for Canadian progressive rock band Rush, had died at the far-too-young age of only 67.

As a drummer, Neil was my second God, right after another drummer who died far too young, Clive Burr.  And that statement would have sent shivers up and down Neil’s spine…

Neil Peart was famously allergic to his own stardom, internally conflicted by being so worshipped and loved by people he has never met.  One of his most poignant lyrics is the song Limelight, which includes the following line, speaking explicitly to his internal turmoil:

“Living in a fish eye lens, Caught in the camera eye, I have no heart to lie, I can’t pretend a stranger, Is a long-awaited friend…”

Certainly most renowned for his drumming, Neil’s lyrics were equally impressive.  Thanks to his voracious reading habits, with topics spanning from the well-know Tom Sawyer to Xanadu to Hobbits and Lord of the Rings to Ayn Rand to hash and well beyond.

I think no other quote could sum up Neil than this one, from the band’s website:

“What is a master but a master student? And if that’s true, then there’s a responsibility on you to keep getting better and to explore avenues of your profession.”

I will close with a few of my favorite Rush songs below.

Good-bye for now my unknown friend.  Thanks for the inspiration, travel safely…

Related:

Good-bye AdvantiPro, Hello AdvantiPro!

Wait, what?

As of , just a few days shy of one full year of employment at AdvantiPro GmbH, I am extremely proud to announce that I, along with two partners, have purchased the company! (And yes, a new website is already on the way…)

My role now changes from Director of Internet Technologies to Chief Technology Officer, bringing with it far greater challenges and opportunities.

While we plan to continue publishing our collection of print products and maintaining our suite of online products, we also have a collection of new, innovative ideas that will start to surface just as soon as we can them ready for public consumption.

See the official press release for additional details.

I will try to keep you posted, and try to update this site more regularly again, but life and work just keep getting in the way! :-)

Happy living and working,
Atg

Good-bye Netbiscuits, Hello AdvantiPro!

It is with an extremely heavy heart that I bid farewell to my employer of the past 4+ years, Netbiscuits. I started, fresh off the plane from `murica, as a fresh-faced 40-something-year-old, learning new proprietary code bases, new technologies, and new names, faces and cultures (though, stupidly, not the new national language…).

After a couple of company make-overs and re-focusings, I leave having worked on several challenging and at-times fascinating products, and most recently having led a small team to try to reinvent a solid product, Netbiscuits Device Detection, in order to make it easier for companies and developers to build the perfect user experience for every user, on any device.

I will certainly miss the staff more than anything. A fantastic group of human beings. I wish them all, and the company, the best of luck, and will continue to help them in any way I possibly can.

Yet it is with an equally exhilarated heart that I announce my new position, as the Director of Internet Technologies, with AdvantiPro. As daunting as that title sounds, the position, created newly for me, will surely live up to it.

With a collection of media products, ranging from print to online to design, and with a newly-rebranded flagship website, The Find-It Guide, having just launched, I will have more than my fair share of work to dive straight into once I get settled into the office!

And I cannot wait to meet all of the new team there, learn from their experiences, share some of mine, and find new and exciting ways of making what they have already done even better, however and wherever I can.

So, I find myself feeling both excited and sad. But that’s the way change feels: longing for the old, and excitement for the new.

Now I plan to enjoy my last day at Netbiscuits, then enjoy the weekend, and one in-between-jobs week, before embarking on my new adventure. Wish me luck. :-)

Happy Friday,
Atg

Help kids play like we used to play

A good friend of mine, , and a group of his friends are running a Kickstarter campaign to provide NYC kids with an open, free and creative playground environment, aptly called play:ground.

Please watch their video and consider contributing to their project.

I had an entire world around me like play:ground as a child, and I know that it had a lot to do with my enthusiasm for creating and willingness to explore new possibilities and options. Let’s try to give more kids that opportunity!

Thanks for any help you can offer Alex, his friends, and the kids that will benefit from play:ground. In the end, we all benefit from more creative, open-minded children becoming more creative, open-minded adults…

Happy playing to you all!

Atg

How to use dynamic variables in a Grunt config file

I had an issue the other day where I needed my Gruntfile.js to “know” what environment I was deploying to so it could use choose the correct parameter values.

Specifically, my Critical CSS Task needed to know whether it should use my Local, Dev, or Prod server to determine what CSS is critical.

TL;DR

Adding this to my Gruntfile.js…

grunt.config('environment', (function(){
    var env = grunt.option('env') || 'local',
        domain;
    if (grunt.option('env') === 'prod') {
        domain = 'http://www.netbiscuits.com/';
    } else if (grunt.option('env') === 'dev') {
        domain = 'http://dev.www.netbiscuits.com/';
    } else {
        domain = 'http://netbiscuits-com:1234/';
    }
    return domain;
})());

… allows me to pass the environment to Grunt via the command line, like this…

grunt --env=dev

… and then tell my Critical CSS Task which environment I am deploying to, like this…

criticalcss : {
    'home' : {
        options:  {
            outputfile : 'css/critical/home.css',
            filename : 'css/style.min.css',
            url : grunt.config('environment')
        }
    },

Say What?

Okay, let’s break that down a bit…

Starting at the Start

Starting with the second block of code above, because that’s how the code actually flows:

grunt --env=dev

This is how you tell Grunt to get off its lazy butt and get to work. This can happen via command line, or, in the case of this project, via command line locally, but via DeployBot for Dev and Prod.

Typically you would start Grunt by simply typing grunt and hitting Enter. You might also be familiar with something like grunt svgmin which will start Grunt, but only run the svgmin Task. But in our case we’re adding this --env=dev at the end…

What’s happening here is we are essentially passing a variable called env and setting a value to that variable, and in the above case that value is dev.

Retrieving the Option

Next, we jump to the first code block from above:

grunt.config('environment', (function(){
    var env = grunt.option('env') || 'local',
        domain;
    if (grunt.option('env') === 'prod') {
        domain = 'http://www.example.com/';
    } else if (grunt.option('env') === 'dev') {
        domain = 'http://dev.example.com/';
    } else {
        domain = 'http://www.example.local/';
    }
    return domain;
})());

This gets inserted just after the opening:

module.exports = function (grunt) { ...

So what’s happening?

  1. The first line creates a new Grunt config variable, called environment, and sets, as the value of that variable, a SIAF.
  2. The SIAF checks to see if any command line options were passed along with the grunt command, specifically if there was one called env (grunt.option('env')).
  3. If the env option was passed, it’s value is set as a local variable (also called env); if not, it’s value is set as local (thus giving us a default, so I don’t have to pass the option when working locally!).
  4. The function then checks a couple possible values of the env variable, specifically prod and dev, setting the appropriate value for the domain variable, and again, defaulting to local.
  5. And finally returns the value of domain, thus setting the value of the Grunt config variable environment.

Putting it into Play

Finally, we make use of the env variable by sending it to the Critical CSS Task:

criticalcss : {
    'home' : {
        options:  {
            outputfile : 'css/critical/home.css',
            filename : 'css/style.min.css',
            url : grunt.config('environment')
        }
    },

This is pretty standard Critical CSS stuff here, except for the url parameter value, which is set using grunt.config('environment').

This grabs whatever value we set in that environment config variable and passes it to the Critical CSS Task.

All the Options

So, for my three environments, I use one of these Grunt commands to get the correct Critical CSS for my site:

  1. Local: grunt
  2. Dev: grunt --env=dev
  3. Prod: grunt --env=prod

Again, local is the default, so no options need to be passed there, making local development, where I manually start Grunt, the easiest. And Dev and Prod are both DeployBot-driven, so I just paste that command into the configuration page and save it.

Summation

This kind of dynamic variable passing could be really useful for all kinds of situations, including testing new methods or trying any different parameter values really easily, without having to keep editing and saving your Gruntfile.js.

Happy Grunting,
Atg