• Zombie Crawl 2014 Video

    Jake VanDonge just released a compilation video from last year’s Zombie Crawl in Wichita Falls.

    Here’s the status that he posted:

    Get a bigger look of what our 5K is all about! Darkness, smoke bombs, zombies & more! Sign up at http://getinfected.org 10.25.2014 Huge thanks to Isaiah, Eric & Alex for helping me & Jeanette shoot video of the 5K last year! Killer job!

  • Sending Balloons to Scarlett

    Today marked one year since Scarlett was born, so we sang happy birthday to her and then released balloons.

  • Today my Daughter Would Have Turned One

    In my family, I’m known to be cold and calculating at times. But last night, that all faded as I silently cried while my girlfriend lay beside me.

    After a few minutes, I reached out for the first time in a year and told Sara, “I miss Scarlett.”

    It All Happened Very Suddenly

    Last October 10th started out like most other days, until Sara told me that she felt that something was wrong and wanted to go to the doctor. I was a bit irritated at this point because I thought she was just being panicky… After all, Hero’s mom had us go to the doctor at least 6 times for false labor. Surely, Sara was just overreacting?

    But once we got to the doctor, my tune changed very quickly. Within a short period of time, the doctor told us that we needed to go ahead and induce labor. All of a sudden, the fact that I was going to be a father (again) hit.

    I took Sara to the hospital, got her checked in to the delivery room, then ran home to pack a bag. We hadn’t prepared quite enough for this.

    Within 5-10 minutes of leaving the hospital, I got a call saying that there were complications and that they were going to do an emergency c-section within minutes. I immediately raced back to the hospital, put the surgery gear on, and waited nervously.

    Another few minutes and I was watching the doctor cut open Sara to deliver Scarlett. I tried calming Sara down by holding her hand, but I kept getting sidetracked by the sight of the surgery.

    After the doctor delivered Scarlett, they immediately began to work on her. We could feel that something was wrong, but I was certain that the doctors and nurses had everything under control.

    With every passing minute, Sara became much more irritated and anxious to hold Scarlett, which pushed me to check in with the doctors. “Why can’t I hold Scarlett yet? What’s wrong?”

    The Next Morning

    Nana with Scarlett
    Nana with Scarlett

    I can’t remember all of the steps that came next, but at some point I remember the doctors telling us that Scarlett would need to be flown to Cook Childrens Hospital in Fort Worth (about 2 hours away), because the local doctors couldn’t help her any more.

    At first the doctors told us that Sara was not going to be allowed to leave the hospital at the same time that Scarlett was air-evaced. While Sara complied with this for an hour or two, eventually she told us all that she would be leaving the hospital with or without approval.

    A few hours later, we found ourselves in Fort Worth and were racing to find where Scarlett is. Against my pleading, Sara insisted on speed walking, even though her abdomen had been cut open and stapled back just a few hours earlier.

    Eventually, we got to a nurses station and were briskly led to where Scarlett is being tested. At this point, we also managed to find a wheelchair and I began pushing Sara around. Probably a bit slower than she would’ve liked to go.

    We are taken to some room where we are not allowed any metallic objects, we had to put on earplugs, and we sat and watched as some loud recurring noise played. I can’t remember what this test was.

    Eventually, we make our way to Scarlett’s room, where we would be for the next few days. There was a chair and a pull out couch in the room and we were told that we could sleep in the room, and were likely expected to.

    Scarlett was subject to a ton of tests while Sara and I watched and waited, but one test hit Sara and I especially hard…

    Is She Brain Dead?

    I remember the doctor talking to us about Scarlett’s condition. She was using some very scientific and technical terms, but I could understand the undertone.

    After listening for a few minutes, I simply asked the doctor, “So, you’re essentially telling me that Scarlett is brain dead, right? You don’t have to sugar coat this.”

    The doctor replied with, “I think that you and Sara understand the situation, and are handling this well.”

    The doctor went on to clarify that Scarlett wasn’t technically brain dead, but that her brain was dying.

    Shortly after this, we began receiving more frequent visits from people other than Scarlett’s doctor. At one point, I can’t remember if some visitor had prompted us, Sara and I began to talk about quality of life and decided that if tests continued to show no brain activity, that we would choose to take Scarlett off of life support.

    Scarlett with breathing equipment
    Scarlett with breathing equipment

    One might think that choosing to let your daughter die was the hardest decision that Sara and I had to make. But, that was really just the start.

    All of the decisions came next. Should we donate her organs? Do we have a funeral? How do we pay for the after death costs?

    But, the hardest part was holding Scarlett in both of our arms and watching Scarlett slowly die.

    Still Dealing

    After taking Scarlett off of life support
    After taking Scarlett off of life support

    Now, one year later, I can, at times, see very clearly how Scarlett’s death has affected us.

    There are times that I see our friends’ children and wonder how it would have been to have a daughter.

    I have even more of a dislike towards all things religion.

    There have also been effects on my relationship with Sara. One of the biggest being that Sara and I deal with Scarlett’s death in very different ways.

    My particular approach was to shut it out, while Sara broke down often. Sara had a very hard time understanding, and probably still does, why I didn’t cry or hurt as much and like she did.

    Last year I remember breaking down and crying as I stood beside Scarlett’s bed. I sobbed in Sara’s arms, something I told her at the time would only ever happen that once. Maybe it’s a good thing I felt something last night.

    In the end, the thing I most want to impart is that we all deal with loss much differently. If you have a loved whose reactions and thoughts you don’t understand, I urge you to be patient with him or her.

  • Update Backbone Model with No Change Events

    I recently needed to update an array of models to add a “reflowed” attribute to a comment which would act as a flag to show that the comment had been reordered.

    Doing it Wrong

    When I was working through this issue, the first thing that came to mind was that I could update the model attributes myself.

    This is possible with the following syntax.

    [code lang=javascript]
    model.attributes.attribute = value;
    [/code]

    But, this isn’t good software development. So, I trashed that idea.

    The Backbone Way

    The Backbone way to update a model is:

    [code lang=javascript]
    model.set( { attribute: value } )
    [/code]

    But, by default, this will trigger a change event on every changed attribute. For my use case, triggering change events for several models wasn’t necessary.

    Looking into the annotated Backbone source code, I noticed that I could pass in an options array that set silent to true. This makes the model update look like this:

    [code lang=javascript]
    model.set( { attribute, value }, { silent: true } );
    [/code]

  • How American parenting is killing the American marriage

    Refreshing thoughts on parenting. I always find it interesting to see people’s reactions when I criticize my son.

  • Mend Walk 2014

    Sara, Hero, and I went to the MEND walk in Irving, Tx today. 

    Here is a picture I took of Hero writing a letter to Scarlett, which he planned to attach to a balloon so it reached her in heaven.

    IMG_1365-8.JPG

  • Get Most Visible Element on a Web Page

    Recently, I was working on updating keyboard shortcuts for o2 and came across a unique shortcut.

    When pressing r, we wanted to open the reply box for the most visible post. When I first started thinking about this requirement, I found myself thinking: “How the hell can I determine what the most visible post is?”

    Attaching to Scroll Event

    One of the first things that crossed my mind was that I could attach to the window scroll event and then update a mostVisiblePost variable as needed. For example, when a scroll event occurs:

    • Get all posts on the page
    • Check which posts are in the viewport
    • Get the offsets for each and try to determine which is most visible.

    I wasn’t quite fond of this method because it could make scrolling janky and seemed prone to error.

    An Alternative Surfaces

    While I was reading Javascript: The Definitive Guide I came across the JavaScript method elementFromPoint(x,y).

    As I thought more about getting the most visible element on the page, I came up with the idea of creating a grid of points that covered the page. I could then get the element at each point and traverse up the DOM to find which post was at that point.

    After thinking through this a bit more, I decided to go for it and came up with the following solution:

    [javascript]
    // Note that Underscores and Backbone are being used here.

    //Let’s create a grid of points in the top half of the viewport.
    var viewPortWidth = $( window ).width(),
    viewPortHeight = $( window ).height(),
    xCoords = _.map( [ .2 , .4, .6, .8 ], function( num, key ){ return num * viewPortWidth; } ),
    yCoords = _.map( [ 0, .1, .2, .3, .4 ], function( num, key ){ return num * viewPortHeight; } );

    /*
    * For each coordiante pair (x,y), get element at point,
    * traverse up to find a post, and add post ID to elems.
    */
    var elems = [];
    _.each( yCoords, function( y ){
    _.each( xCoords, function( x ){
    var element = $( document.elementFromPoint( x, y ) ),
    closest = element.closest( o2Keyboard.threadContainer + ‘.post’ );

    if ( closest.length > 0 ) {
    elems.push( closest.attr( ‘id’ ) );
    }
    });
    });

    // Find most frequent (mode) post ID in elems array.
    // Thanks Matthew Flaschen – http://stackoverflow.com/a/1053865
    if ( elems.length > 0 ) {
    var modeMap = {};

    var maxEl = elems[0],
    maxCount = 1;

    _.each( elems, function( el ){
    if ( modeMap[ el ] == null ) {
    modeMap[ el ] = 1;
    } else {
    modeMap[ el ]++;
    }

    if ( modeMap[ el ] > maxCount ) {
    maxEl = el;
    maxCount = modeMap[ el ];
    }
    });
    }
    [/javascript]

    For the purposes of O2, we defined the most visible post to be in the top 40% of the viewport. So, we created an array of y points from 0-.4 times the viewport height. We then created an array of x points that covered most of the viewport.

    Once we’ve created the xCoords and yCoords arrays, we then loop over these two arrays and get the element at each (x,y) coordinate pair. In this example, we will be creating 20 unique (x,y) coordinate pairs. You can fine tune that for your needs.

    Once we have the element at each point, we traverse up the DOM to see if there is a post. If there is, that post’s ID gets added to an array.

    We then take a mode, essentially finding the post with the most hits, on the elems array and that is the most visible post.

    Questions or Comments?

    If you have any questions or comments about this method, feel free to leave a comment below.

  • Why Concatenate Files in WordPress?

    One of the easiest things that you can do to increase the speed of your website is to concatenate the CSS and JavaScript files that are loaded on your site.

    This only takes a couple of minutes since all you need to do is install a plugin. For this, I have typically used WP Minify, but have also occasionally used Better WP Minify.

    What is Concatenation?

    Sure, I can tell you that concatenation will help speed up your site, and you can easily install a minification plugin… but why does concatenation help?

    First, to understand why concatenation helps, we need to understand what concatenation is.

    Simply, concatenation is the combining of files into one large file.

    For example: Instead of loading many CSS and JavaScript files for the many plugins that your site has enabled, these files would be combined into one large CSS and one large JavaScript file.

    How Does Concatenation Help?

    To understand why concatenating files is beneficial, let’s consider the act of having to bring in many grocery bags.

    Imagine that there are 12 bags in the trunk of your car. You have the option of taking all 12 bags in one trip or taking a trip for each bag.

    If you take all 12 bags in one trip, the trip will likely take a bit longer since you’re carrying more weight. But, if you take multiple trips, then you’re traveling the same distance many many times.

    Arguably, taking all 12 bags in one trip will require more effort but will be faster.

    This is very similar to why concatenation helps speed up your site. Instead of the browser having to take multiple trips to the server to download several JavaScript and CSS files, these files are packaged into just two larger files.

    While these larger files themselves will take a bit longer to download, the browser isn’t having to take multiple trips back to the server to download individual files.

  • Canyons Resort Property

    IMG_1334.JPG

    This picture of Canyons Resort as taken on Sunday while it was lightly sprinkling
  • Automattic Hot Dog Eating Competition

    IMG_1310-0.JPG

    At the Saturday evening grand meeting flash talks, there was a very unexpected hot dog eating competition. Rose killed the competition!

  • Automatticians Karting

    Part of meetups for Automattic are having fun with other Automatticians.
    Earlier in the week I got a tattoo and played paintball, but today was all about indoor go-karting

     

  • 9 Weeks at Automattic

    As of September 15th, I have been at Automatic for 9 weeks! The first three weeks were spent on support rotation and the last six weeks have been spent actually working on Team Mercury.

    The annual Grand Meetup is also currently happening, during my 10th week, and it’s been great to play paintball, learn some Android development, experiment with the Dvorak keyboard, and much more with my coworkers. I’ve added a coworker selfie with fellow Automatticians that played paintball as the featured image for this post.

    I’d like to share my thoughts about Automattic after actually being with the company and on my team for a small period of time.

    I Will Never Stop Learning

    This is currently the first statement of the Automattic creed. I believe that work at Automattic embodies this concept very much.

    For starters, we work on very exciting projects and are always pushing to make better software. Not only that, but there are so many different projects at our company that use exciting tools/frameworks/languages, that any person can truly learn whatever they want. In short, there is no shortage of things to learn.

    Further, the fact that Automattic allows employees to do rotations and temporarily work on other teams is great because it allows Automatticians to expand their knowledge as well as determine if they are on the correct them for themselves.

    I Will Never Pass Up an Opportunity to Help Out a Colleague

    Automatticians are generally very happy and helpful people. To all of the Happiness Engineers that answered my questions when getting familiar with the various support interfaces – Thank you for much for your help.

    To Team Mercury who has been so helpful, thanks for putting up with my general lack of knowledge in all things JavaScript.

    Enjoying the Hard Stuff

    My Mom often praises me for how “smart” I am, even though that I believe I am of average intelligence. That being said, I do think the one thing that sets me apart from many others is my general fearlessness in regards learning new things.

    I feel that the best opportunities for growth and learning are in doing the hard tasks.

    At Automattic, I feel that our company does a great job of embracing hard tasks. For example, taking P2 and making it better with O2 and Backbone. Or, the new Tinker team whose goal is to build new and exciting things (per my understanding).

    I also feel that Automatticians generally try to get things “right” as opposed to just getting things “working”. This is a key paradigm shift from working at a design agency where it was more important to just getting things working.

    Dream Job

    Overall, Automattic is a dream job and I enjoy working here!

  • My Boss is a Badass

    Beau Lebens the Badass

    As I flew to WordCamp NYC this weekend, I decided that I would re-read Year Without Pants and see what I took from the book now that I actually work at Automattic.

    First thing I took away… It’s very surreal to read about your company and/or your experiences in a published book.

    Second thing I took away… My team lead is a badass. Seriously, how many developers can you name that have been in a published book, know Krav Maga (or some other martial arts or self-defense), and been through survival training??

    Off of the top of my head, none.

    On a side note: If you’re interested in working at Automattic or interested in how distributed companies such as Automattic work, give Year Without Pants a read!

  • WordCamp NYC 2014

    This past weekend I had the opportunity to travel to WordCamp NYC.

    This was a great opportunity for several reasons because I was able to meet some of my coworkers for the first time and I was able to experience NYC.

    I even made some people happy by fixing their WordPress issues at the Happiness Bar.

    Meeting Automatticians

    Because Automattic is a distributed company, and I just started three weeks ago, WordCamp NYC was the first time I had met many of my coworkers in person.

    This was a real treat as Automattic is comprised of many interesting individuals.

    Spencer Berry

    Take Spencer Berry for example who can YoYo like a beast without while also holding a conversation.

    I also had the pleasure of meeting many other Automatticians such as:

    • Kevin Conboy
    • Alx Block
    • Erica Varlese
    • Richard Spees
    • Mel Choyce
    • Konstantin Obenland
    • JR Tashjian

    Experiencing NYC

    I feel like the conference worked out pretty well where there was plenty of work, social time, and exploring. Not only did I have the chance to experience some great BBQ, chicken, and local pizza…

    But, I was also able to see Times Square, the Statue of Liberty, and the 9/11 memorial.

    Here are some various pictures from around NYC.

  • My Son Had His First Fight Today…

    image

    Normally picking my son up from his karate classes/daycare is a fairly routine procedure. I walk in, tell him to put his shoes on, and then remind him to hurry up and put his shoes on for what seems like 5 minutes…

    But today, as soon as I walked in, I was told that I had to talk to the lady in charge before I left for the day.

    The first thought in my head was something along the lines of, “What the hell did my son do?”

    The Meeting

    After talking to the lady in charge, I was told that my son had jumped onto another kid and began wrestling him after the kid took my son’s money. The kid then punched my son in the face.

    My initial reaction was to agree with the karate instructors and chastise my son for wrestling with the kid.

    After all, my son could have just gone to a karate instructor and asked for him or her to mediate.

    Somewhat surprisingly, I wasn’t afraid or mad that my son had been punched in the face. In fact, I fully expect that he’ll take several more blows to the face over the next few years in his karate classes.

    Thinking Through The Actions

    As I drove home, with Hero in the back seat, I began to work through what exactly happened and I realized that I was proud of my son for getting in a little scuffle.

    I realized that had I been in the same situation, my reactions would have likely been similar.

    The more I thought about the situation, the more proud I was of my son that he had stuck up for himself and wrestled the boy.

    This doesn’t mean that fighting should be one’s first reaction. And Hero should have likely found another way of getting his money back.

    But in the end, I’m proud to see that my son has a backbone and he’s not afraid to use it when necessary.

  • #21 – In order to understand recursion, one must first understand recursion.

    Understand Recursion

    I found this amusing since recursion is definitely one of the computer science subjects that I struggled with the most in university.

    I remember having to manually draw stacks on paper to keep track of values and how deep in recursion I was.

    I might have to see how much it costs to print this on a poster!

  • Basic Authentication in WordPress

    About a month ago, I worked on a plugin to help retrieve a lawyer’s reviews from the AVVO API. One of the key aspects of connecting with the AVVO API was using basic authentication, which was a new method of connecting to an API for me.

    What is Basic Authentication?

    Basic authentication requires that an authorization header be sent that contains the following:

    [code lang=”php”]
    ‘Basic ‘ . base64_encode( "{$username}:{$password}" )
    [/code]

    That is the string Basic, followed by a base 64 encoded string comprised of a username, colon, and then password.

    Implementing Basic Authentication in WordPress

    One of my favorite tools in WordPress is the HTTP API. Not only does it handle different server configurations and simplify the process of making API calls, but it makes setting headers as simple as passing an array of arguments.

    Here is an example of how I implemented the basic authentication API call.

    [code lang=”php”]
    function make_basic_auth_request( $api_url, $username, $password ) {
    $request = wp_remote_get(
    $api_url,
    array(
    'headers' => array(
    'Authorization' => 'Basic ' . base64_encode( "{$username}:{$password}" )
    )
    )
    );

    if ( is_wp_error( $request ) ) {
    return $request;
    } else {
    return json_decode( wp_remove_retrieve_body( $request ) );
    }
    }
    [/code]

    The function above will return a WP_Error object if the API call fails or a JSON decoded string if the API call was successful.

    A Real Life Example

    I have published the WordPress plugin I built to get AVVO reviews on Github.

    Note: This plugin only implements the reviews portion of the AVVO API, and its purpose was solely to factor out code from a custom theme. As such, it should not be looked at as complete.

  • Becoming an Automattic Code Wrangler : Beginning to End

    Looking back, I remember how anxious I was throughout the whole process of applying, interviewing, and going through trial at Automattic… I also remember that while there are many stories of the process for Happiness Engineers, there were very few for Code Wranglers.

    Because of this, I’d like to share my experience from applying to accepting the job offer.

    Applying to Automattic

    Applying to Automattic is a pretty straight forward process. Go to Automattic’s Work With Us page, find your job, then send an email that follows the instructions at the bottom of the page.

    After that, sit back and relax. It took a little over 6 weeks to get a response back to my application.

    Interviewing and Code Test

    If you make it past the application stage, then the next step is interviewing, which will likely be with a Code Wrangler.

    While the content of the interview was similar to other tech interviews that I’ve had, the format was different … The interview was a text chat interview.

    Why, you ask?

    Well, since Automattic is a completely distributed company, meaning that people work all over the world, much of the communication takes place in the form of text chat. Thus, it makes sense to conduct interviews in the same format that most communication takes place.

    As a matter of fact, you can probably expect to communicate solely through text chat throughout the entire hiring process!

    If you make it past the interview, then you’ll be given a small coding problem to work on and a due date … This is the code test.

    Trial for Code Wranglers

    If you successfully make it past the code test, then the next step is the trial.

    For my trial, I built a message and error logging API called WP Logger.

    The thing that stands out the most about my trial is that there weren’t any hard requirements. My trial lead, Demitrious Kelly, told me to build a logging API, provided a bit of guidance, and set me loose. From there, I iterated quickly and gave him updates throughout the week to get feedback and guidance.

    Realizing that this was an audition of sorts, I made it a point to try to answer as many questions as possible by myself. This meant looking at documentation, reading core WordPress code, and more… All before asking a question.

    At points, Demitrious provided suggestions that completely changed the direction the project went in. Example: Where I provided a global instantiation of the WP_Logger class that developers could use to log messages… Demitrious suggested to use the WordPress hooks API, which made the code much simpler.

    In the end, my trial lasted about 4-5 weeks. After which I was told to get in touch with Matt Mullenweg, the founder of Automattic, via Skype.

    The Matt Talk for Code Wranglers

    The Matt Talk is the last step in the hiring process for Automattic. But, be forewarned, Matt is not an easy person to get in touch with. It took about 10 days before Matt responded to my initial Skype message.

    The talk lasted about 3.5 hours, the end of which was spent on setting a range on salary. Matt welcomed me aboard and I received my offer letter the next day.

    Questions?

    A lot has happened over the span of about 10 weeks, so there’s a good chance that I might have missed a few interesting details. So, if there’s something you’re curious about, leave a comment below, and I’ll attempt to answer your question.

  • I’m Joining the Automattic Family

    I’m extremely proud to announce that I’m joining Automattic as a Code Wrangler starting on July 14th, 2014.

    true == is_automattician()

    For those that don’t know, Automattic was founded by Matt Mullenweg (a founding WordPress developer) and is the force behind WordPress.com, a hosted version of WordPress, and many other services such as:

    The pay and benefits are amazing, but most important is that with WordPress.com serving over 409 Million people and more than 14.5 Billion pages per month… I’ll be working for a company that affects millions of people daily.

    Hello Team Mercury!

    After spending the initial 3 weeks on support rotation, I’ll be working with Team Mercury whose primary project is O2. O2 is a communication/project management tool built on top of WordPress.

    Here is a video where Beau Lebens, my team lead, discusses O2:

    I’m very excited for the rest of this year! I can’t wait to get started in a few weeks.

R.I.P. ERIC