So I'm in the process of doing a big refactor at work.  I'm totally overhauling the front-end of my project.

Refactoring, especially large scale refactoring, is kind of like spring cleaning.  You rearrange the furniture, find the stuff under the couch, dust in the corners, look for ways to do better the things you're already doing.

So, not that you asked, but you're reading my blog, so you kind of did, I stumbled across something big today.  Something I thought I understood about Grails, but actually only barely grasped.  It has to do with how Grails renders a page, using a layout for stuff that repeats across multiple web pages.

<html>
    <head>
        <title>An Example Page</title>
        <meta name="layout" content="main" />
    </head>
    <body>This is my content!</body>
</html>

That little boldfaced line of text up there, that's one of the ways Grails tells a page to use a layout.  But it's not the only way.  I won't bore you with the details, if you really want to know, you can read it for yourself over at the Grails documentation.  

The big thing I figured out was that there was this resource, this layout in the project that wasn't being used at all.  I figured out it wasn't being referenced in any of the ways it could be, and that I could refactor that sucker right out of the project altogether.

On my own, by myself.

Man, that feels good.

Posted
AuthorMako Allen
Categories365 Gratitude

That's short for:

Crawl, Walk, Run, Fly

It's something I say often, and an attitude I practice, although I forget it sometimes, and have to remind myself about it.

In anything I do, I have to start somewhere.  Eventually I build on that somewhere, and go from new, shaky, awkward, and limited to gradually being more capable, until I reach a point of excellence.

It occurred to me this morning that I practice CWRF all over the place.  I practice it in my health, with how I eat, and exercise.  I practice it in my work, as I constantly am teaching myself how to do things, and refining things I've already done to work better.  I practice it in my polyamory, my writing, everywhere!

I suppose another way to state the truth of CWRF is There's always improvement that can be made.  You have to be careful there though, because that can sound negative, and perfectionist.  That's not it though.  It's not "This isn't good enough yet." but rather, "Awesome!  What can I do next?"  It's the forward movement that matters, not the milestone.

And the thing is, each of these stages is great in its own right.  When I'm in "crawl" on something, I get to move at my own pace, explore, make mistakes, and find value in the discovery.  There's something great about being in that newborn state, gently poking and exploring and figuring out not just what I'm doing, but what potential every choice even has.

Then when I move up to "walk", I trust some of what I have already done, and begin to build upon it.  For example, in writing I'll have demonstrated some aspect of a character's motivation previously, and now can artfully weave in the barest nod to it, almost like a background detail, and suddenly the reader knows them better.  Or in my coding, I'll take some long-handed way to do something, and refactor it to be simpler, more elegant.

When I get to "run" on something, I have great trust in myself, and I'm using what's worked for me in the past to really book it, get great chunks of productivity accomplished.  I love being in the run state.  

Eventually I get to "fly", which in its own way is eerily reminiscent of "crawl", because now I can really let my imagination go, and explore anything and everything, but now with a set of tools and competency supporting me.  I know my patterns and habits over a thing, and can rely upon them.

There's so much that goes into this paradigm, that's part of the recipe for using it:

  • Mindful attention to the moment
  • The Taoist concept of the soft overcomes the hard, like how rainwater carves valleys
  • The Taoist concept of 'u, the un-carved block, inside every block of wood is the potential to be anything.
  • Maitri, the Tibetan Buddhist concept of loving-kindness for oneself
  • Shenpa, the Tibetan Buddhist concept of attachment.  By staying present, you transcend shenpa, to move forward.

I'm so grateful that I practice this, so grateful I can fall back to crawling in any aspect of my life, and know that there's value there.  

There's a Lao-tzu quote I really love, which I have just gained new insight about.  It goes like this:

If you do not change direction, you may wind up where you are heading.

When I first learned it, I used to take it as a gentle rebuke for being too obsessed with an end goal.  But I've since come to see while that's true, it's simultaneously an encouragement to move forward.

Time to get moving again.

Posted
AuthorMako Allen

So, Christmas is often tough for me, and lots of other folks too.  

One of the big reasons for this is dealing with family and friends, many of whom you don't see very often, but are more than happy just to let you know what they think about you, your life, and your choices.  This same thing works in reverse, too.

Even though I know better, I often find myself gritting my teeth at something someone says or does, an attitude they hold, a way they treat me or others, or best yet a disagreement in politics.

The other day my brother Spacey sent me an article that offers another option: being Mindfully Free of Wanting People to Be a Certain Way.

I love this article.  I love my brother.  Many of the truths in this thing are things I already knew, had already sussed out for myself.

But I forgot.

What a gift to remember them again, and learn yet more reasons why that sort of wanting is an attachment I neither need nor want.

 

Posted
AuthorMako Allen
Categories365 Gratitude

Here's a first.  I don't think I've ever put a piece of code I've written into my blog.  This little gem below is for a side-project of mine.  It's a Grails custom tag.  You call it on a GSP, a groovy server page, similar to the way you call an HTML tag.

  def formattedPhone = {attrs, body ->
    def rawNumber = attrs.phoneNumber
    out << "("+rawNumber.take(3)+") "+rawNumber.drop(3).take(3)+"-"+rawNumber.drop(6)
}

That looks kind of like this:

<g:formattedPhone phoneNumber="${user.mobileNumber}"/>

(On an amusing side note, when you make a string with a ${} set in it on a GSP, the code inside the handlebars is treated like an expression, and evaluated prior to the page load.  That's not the funny part.  The funny part is that those are called gStrings.  Aren't programmers a riot?)

Why is this my gratitude today?  Several reasons.  

First, I've been working with Grails for several years now, and since I'm working on a side project of my own, I get to build it the way I want, not the way that's been dictated to me.  I've known about custom tags for a while, but never had the chance to really use them before.

Second, I taught myself how to do this.  I had a vague idea of how tags worked in general, and why they were a good idea.  So I hopped on the net, did a little googling, and after reading a few interesting tidbits, banged out a bunch of tags.

A friend of mine taught me the word for this sort of behavioral ability before - it's called auto didacticism.  It's being a student, and one's own teacher too.  I'm glad to have it.  It serves me well.

Posted
AuthorMako Allen
Categories365 Gratitude
IMG_2388.JPG

I keep bumping into examples today where advice I give other people is also good for me, and vice versa.  

First, this morning, on Unnamed Social Media Site, a friend of mine lamented about how she struggles to do everything she has to do in life, and can't seem to find time to even rest. 

I told her she was being way too hard on herself , and suggested that if she makes her own well-being a priority, maybe she would feel less overwhelmed. 

Cue irony in 3, 2, 1...  

I was telling my girlfriend Squee all about this, as I was driving to work this morning.  This was after the very good, very long day I had yesterday, when I got up around 4:30 in the morning, spent several hours coding at my side project, went to work, fought rain and traffic in a torturous commute, wolfed down way too much dinner, then proceeded to work until late on the side project again, then tossed and turned all night, still thinking of said side project.  This resulted in me: having trouble getting up, missing out on work on the project, missing out on going to the gym. 

By trying to do everything, I wound up not able to do much anything, beyond the minimums my day required of me today. 

But, giving my friend advice to be gentle to herself, combined with Squee's careful eye upon me, helps me see that what's good for others is also vital for me, too.  I need sleep.  I need to eat right.  I need to work out, and take care of myself, physically.  Bouncing back and forth between awesome supercapable day and terrible burnout day is no way to live. 

So, it's getting on towards the end of my work day, when I get an email from a podcast listener, as follows: 

Subject: Mindfulness

Hey!

I am working on practicing mindfulness as a way of decreasing anxiety. What's the phrase that you say on many of the podcast episodes? Something like "Where am I? What am I doing?"

Thanks,

**redacted listener**

 

So, here's what I told them.

Hiya!

You're talking about The Two Most Important Questions in the Universe™. They are:
"Where are you?"
And
"What time is it?"

The answers being that:
You are here.
It is now.

Which are actually the only time and place you can be, although we frequently lie to ourselves and pretend otherwise.

Thanks!
--mako

That's some damn good advice.   It's funny how as I give it to someone else, I'm kind of re-giving it to myself, all over again.  Sometimes I lament, for comic effect, what a pain in the ass the universe is, my ever-present, always-giving, provider-of-lessons.  And while sometimes the way these things jump out at me really is annoying, mostly it's a blessing that I'm grateful for every single time it happens.

So, I'm going to go home now, and take back roads, drive slowly, and listen to an audiobook I am enjoying.  Then I'm going to relax, and go to bed on-time for a healthy bed time.