Wednesday, July 30, 2014

Fixing jQuery Animate Flickering

I just spent over a hour wrestling with this bug, and I'm hoping this post will help spare someone else the same pain.

The problem that I ran into was an annoying flicker when using the jQuery .animate() function to change the opacity of a DOM node.  I did a bunch of Googling, but none of the solutions worked for me. I tried:


What ended up working for me was removing a CSS transition from the element being animated.  

The code in question (simplified):

listing.animate({opacity: 0}, function() {
    // some code
});


The listing element had the following CSS rules applied (simplified by removing vendor prefixes):
.listing-card {
        background: #fff;
        position: relative;
        border: 1px solid #ececec;
        border-radius: 3px;
        box-sizing: border-box;
        transition: all .1s;
        margin-bottom: 26px;
}

I deleted the transition and the flickering went away completely.

If none of these solutions work for you, I suggest doing the following to troubleshoot your specific issue:

  • Make a button on the page that toggles your animation back and forth.
  • Open up Chrome DevTools, and start deleting HTML, testing the animation with the button after each deletion until you have a minimal test case.
  • Now start turning off CSS rules in DevTools until the animation works smoothly without flickering

Hopefully this helps someone else avoid a few hours of debugging!

Monday, July 7, 2014

The Road to 100 Consecutive Push-ups

In addition to my goal of doing one million push-ups by the age of 50, I always wanted to be able to do 100 consecutive push-ups.  I started training heavily towards this goal on February 1st of this year, and hit that milestone on May 18th.  It took a bit of experimentation to find out what worked to increase my push-up max, and there’s a lot of misinformation around this particular goal on the web, so I’m hoping that this post can serve as a useful resource for people tackling this challenge.

A Quick Word of Warning

If you search for recommendations on how to do 100 consecutive push-ups, you will without a doubt stumble upon http://hundredpushups.com. This site, in a word, is unrealistic. On two separate occasions I’ve attempted to follow their program, and haven’t come anywhere near 100 push-ups in the final attempt. The site doesn’t even make sense…anyone should be able to go from ~10 push-ups to 100 in 6 weeks? That’s a little aggressive. Also they jump people who can do 50+ push-ups to week 3, so they are supposed to go from 50 push-ups to 100 in 4 weeks. This means increasing your push-up maximum by 12 per week, which I would imagine is impossible for most people (it certainly was for me).

What Worked For Me 

The workout that I ended up with was a Monday/Wednesday/Friday schedule with an exhaustion test every other Sunday. Each workout consisted of 10 exhaustion sets with a one minute break between each one, alternating between the following kinds of push-ups:
  1. Arms at a 45 degree angle
  2. Military style (picture, video).
  3. Diamond
  4. Wide angle
Incorporating a variety of push-ups is important, because it exercises different muscle groups and builds overall strength and stability in your core and shoulders. This is what ultimately allows you to increase your push-up max in a healthy and sustainable way.

I would do sets in this order twice, and then finish with another set of #1 and #4 to close out the 10 sets. Every push-up was done on the “Perfect Pushup” rotating handles. This was primarily to preserve my wrists, and also to add a little difficulty by engaging stabilizer muscles and allowing me to go down further.

As with any workout plan where the goal is to build muscle and increase strength, the rest of your health has to be at the top of your mind as well. This means:

  • Getting enough high quality sleep
  • Eating enough, and eating well (minimal sugar intake, minimal processed foods, enough protein, etc.). This is especially important post-workout
  • Doing mobility work - stretching/yoga/massage/foam rolling/etc.  

One thing that came up during my research was doing pulling exercises to balance out all of the push-ups.  This could be pull-ups, rowing, reverse push-ups, or a similar exercise.  Unfortunately I don’t have any of the necessary equipment to do those kinds of exercises at home, so I skipped that recommendation. It’s possible that it would have accelerated my path to 100 push-ups, and it makes sense if you have the ability to do that.

With the plan outlined above, I was able to increase my push-up max by around 5 push-ups every two weeks, and in about 15 weeks I went from a starting maximum of 62 to finishing my goal of 100 consecutive push-ups. The full details of my training are in my master push-up spreadsheet.

Next Steps

I still have ~920,000 push-ups left in my goal of doing a million by the age of 50, so I had to find a sustainable training program going forward.  After I did the hundred I took some time off, and as a result I have fallen a bit behind on my overall goal. My current approach is a “race to 300” workout, where I do the exact same workout detailed above, but instead of doing 10 sets I try to get to 300 push-ups in as few sets as possible (with a one minute break between sets). On the off days I try to do around 100 push-ups throughout the course of the day in sets of 25, just to keep making progress towards my goal.  With summer schedules and a bunch of travel I haven’t been as consistent with this approach as I would like, but will be focusing on it throughout July and try to catch up.

Reaching this goal was a satisfying milestone on my way to one million push-ups, but it also reminded me how far I have to go. This year has definitely been more of a grind than the first two, and I'm contemplating raising my daily average so I can finish the challenge earlier.  I'll talk more about that in my 2014 update, sometime in November or December.