Don’t be the gorilla

Photo from Stu pendousmat

Many of us starting or running businesses often have a problem — no one cares

It’s the same problem high school seniors have competing to get into a good college. It’s hard. The ivy league? Yale’s acceptance rate is 6.3%. Stanford? Fogettaboutit. 4.7%

About a month ago news broke that a high school senior, Brittany Stinson, wrote an incredibly original essay that helped get her accepted not just into the university of her choice, but into 5 ivy league schools including Stanford. And oddly enough, it was about Costco.

But, something I feel that has gone overlooked is that this essay didn’t just help her with college applications; it’s brought her national fame.

She’s been covered by dozens of major publications. Business Insider wrote the first piece on it. Then NBC News, MTV, Cosmopolitan, Inc Magazine, Quartz, and I’ve given up counting at this point, have all chimed in or interviewed Brittany. Now how do we tap into that?

And here’s the thing, her essay is original. It’s unique. But I think there’s another component that if missed in our original work, we’d also miss the effect Brittany created.


Are original advertisements effective?

Most of us have seen an ad where on the next day we can’t even remember what it was for. That seems like a failure. Effective ads get attention but they also stick the ad’s brand into the memory of consumers.

Rik Pieters is a professor at the Tilburg School of Economics and Management where he specializes in marketing and consumer behavior. He realized that a great deal of money is spent making original advertising, but there’s not much research to see if it actually works. So he set out to measure it.

His hypothesis, was that, intuitively, original ads would perform better. So he took 119 participants and used infrared corneal reflection eye tracking to measure what folks look at when they scan through magazines. After the eye tracking study, he also gave them a test on what they remembered. A separate group of judges rated ads in those magazines on how “original” they were.

His hypothesis was confirmed. Folks do pay more attention and have more brand memory of original ads.

But Pieters also wanted to study the effect of “familiarity” of an ad. For example, an ad for a minivan might feel familiar no matter how original it is because we’ve all seen minivans and ads for them. Or an incredibly original ad like Dos Equis’ “most interesting man in the world” becomes familiar because we’ve seen it a hundred times.

The problem for advertisers is that we tend to pay less attention to things that even seem “familiar”. Pieters wanted to know: does originality get people to pay more attention and remember familiar ads? So he also had judges rate ads in magazines as familiar or not familiar.

Again, Pieters hypothesis was confirmed. Original ads did help people pay more attention and remember familiar ads.

But, you might figure original + unfamiliar ads get the most attention and are remembered the most.

Here’s the surprise. Original and familiar ads did better than all other types of ads (original + unfamiliar, unoriginal + familiar, unoriginal + unfamiliar).

It wasn’t just that original and familiar ads were more effective; they were the MOST effective.


Going back to Brittany’s essay, you’ll see already in the first couple lines it’s original. Brittany was asked to share a story about her background, identity, interest or talent. She starts with:

Managing to break free from my mother’s grasp, I charged. With arms flailing and chubby legs fluttering beneath me, I was the ferocious two­ year old rampaging through Costco on a Saturday morning.

That’s original. It doesn’t read like a college essay. It reads like humorous fiction. But it’s not just original, it’s familiar.

She made a bet that folks reading this would know what Costco was. Costco has 81 million customers who are extremely loyal. And they tend to be college educated and make over $100k. Odds are the folks reading her essay know exactly what she’s talking about when she writes:

I contemplated the philosophical: If there exists a thirty­three ounce jar of Nutella, do we really have free will?

Same familiar thought has probably crossed your mind. What’s up with giant tubs of Nutella? 🙂

Imagine how much success her essay would have had if it was written in this same original style, but about her experience with something unfamiliar to you, like an african thumb piano.

It’s Brittany’s ability to be original and familiar that gets our attention, and helps folks remember her when they have thousands of essays to go through.

So why did she also elevate to the point of national stardom? Well that’s another interesting benefit of surprise.

Research also shows that surprising events greatly improve the Word of Mouth of those events. By creating an original and familiar story, she not only elicits the most surprise from her readers, but readers want to pass it on. And they did. In droves.


As I look at what I’ve been the most successful at spreading, I can confirm Brittany’s technique is a useful one. I took a writing class at Gotham Writer’s Workshop. One of the instructor’s key tenets was to be original, but hook into a familiar topic. Use the news. What is everyone talking about?

So now my news reader is filled with pop-culture magazines like People and Vanity Fair. The essay I wrote for that class, Why are some people so much luckier than others, went viral. It has some original elements, but its success is also from the familiar story at the time of James Garner’s passing.

Since then, I’ve written a number of original pieces that have spread successfully, again I think due to a big effort to make them familiar. They’re about Ramen noodles, stolen cars, and even Ben Affleck — I bet no one else has compared Ben Affleck to an open source module, but you know who Ben Affleck is.


Here’s one last thing you might already be familiar with: The famous invisible gorilla experiment. Researchers had participants count how many passes a “white shirted” team made with a basketball, and participants completely missed the gorilla who took 9 seconds to cross the court.

Analysis of the experiment spends a lot of time talking about how it represents our selective blindness to the world. We only see what’s important to us. But I think there’s another incredibly interesting perspective to the experiment.

We’re often the ones in the gorilla suit. We try and get folks attention but they don’t see us; they’re engrossed in something else — the familiar. What would have happened instead if the basketballs changed colors or one of the players in white shirts disappeared from the game? I bet you would have noticed them. Those would have been surprising events, but would have also fit inside the familiarity of the task you were working on.

Don’t be the gorilla.

P.S. If you enjoyed this article, you should follow my YouTube channel, where I share more about how history, psychology, and science can help us make better decisions. And if you find yourself needing to better organize your small business, check out how Highrise can help!

Choking under pressure — What we can learn from those who have and how to avoid it

Golden Bell at Augusta National by Jason Denaro

We were bleeding customers and needed to fix it. But where were we screwing up?

Highrise launched in 2007 as simple contact management and CRM software for the web. It was created by a company named 37signals. In 2014, 37signals decided they wanted to focus on their core product, Basecamp, but also wanted to get Highrise the resources it deserved. So they announced they were selling or spinning off Highrise and renaming themselves Basecamp.

Immediately rumors spread that Highrise was sunsetting. Even though Basecamp doesn’t sunset their products — old versions of Basecamp still run today — our competitors fueled the news of a shut down. It just wasn’t true.

But those rumors led to Highrise bleeding customers. Week after week, another net loss. The final decision was to spinoff the company instead of sell it, and they brought me in as the CEO on August 14, 2014 and we got to work. We brought in a brand new team, and aggressively improved the product. Every few weeks another email was sent out to customers that a bunch of things had gotten better.

We saw that rate of customer loss immediately start to slow. Each week was better. But then in 2015, things got bad again. What happened?

I choked.


The Masters golf tournament occurred a few weeks ago.

You don’t need to know anything about golf or even be a fan to recognize what transpired.

Going into it, a young phenom named Jordan Spieth was a favorite to win the tournament. He was runner-up in 2014 and won the Masters in 2015. And he’s been winning other tournaments all year long.

Jordan was leading the pack of competitors by 5 strokes going into the last 9 holes.

But then, he choked.

Some folks consider it the worst meltdown they’ve ever seen in golf. Jordan was on the 12th hole, known as the Golden Bell. It’s the shortest hole on the course. A par 3. But it’s shortness hides its difficulty. The wind is unpredictable. The green is tiny. And there is a creek in front that loves to eat golf balls.

But “everyone” knows you don’t go for the pin, you just aim for the middle of the green and get the damn ball over that creek and front bunker. Nothing fancy.

Don’t take my word for it. Just do a quick search for advice on playing No. 12 and it’s all the same:

I prefer the play the ball over the bunker no matter where the pin is, except if it’s front-left. I never shoot at the right pin placement on purpose.

Jack Nicklaus

There are two rules on the 12th hole at Augusta… One, is you never aim at the flag at Augusta on the 12th hole. You always aim in the middle of the bunker, and try to carry the bunker, and take your 20-footer left or right. … That’s what you do there. Never go at that flag.

Lee Trevino

And on.

But Jordan “hit a little cut to the hole” and ended up in the creek. And then he dropped another ball for his penalty shot, and that ended up in the creek too! His next shot finally made it over, but he finished the hole with a quadruple bogey. A 5 stroke lead was now a 3 stroke deficit. He lost the tournament.

But why? What made him choke?


Sian Beilock is a psychology professor at The University of Chicago. She wrote the book on Choking.

Beilock offers interesting insight into what choking is psychologically as well as methods to help us avoid it.

One of the key things to understand about choking is that it’s actually two different phenomenon that we often confuse as just one.

Choking can occur when people think too much about activities that are usually automatic. This is called “paralysis by analysis.” By contrast, people also choke when they are not devoting enough attention to what they are doing and rely on simple or incorrect routines.

Let’s look at Jordan again and you’ll see what Beilock means.

Jordan hit a poor golf shot that is usually automatic for him. Right club; just came up short. But you’ll also see the other type of choke Beilock is describing. Jordan shouldn’t have been shooting for the pin to begin with. That was a poor decision, not a poor golf shot. As Trevino said: Everyone knows the best decision is to aim right for the middle of the green, not the pin. But Jordan made a poor decision.

And Jordan continued to make poor decisions and poor golf shots on this hole. When his penalty shot also ended up in the creek, he hit a poor golf shot, but he shouldn’t have been down by the creek to begin with.

According to Trevino:

Rule No. 2: If you do hit it in the water, you never, ever go down to the creek and drop a ball. You always re-tee it. And the reason for it is because when you go down to drop your ball, you’re dropping it in a wet area with a downslope trying to hit the ball up over a creek.

Beilock goes into the biomechanics of why both of these types of choking transpire. They both take place at the prefrontal cortex of our brain, the part where we spend a lot of time making conscious decisions. When the prefrontal cortex is making decisions when it’s not supposed to be, bad things happen.

Let’s look at Jordan again. Jordan’s making poor golf shots. Things that should be automatic for him aren’t anymore. If you go back here’s what he said about that first shot he made:

“I remember getting over the ball thinking I’m going to go ahead and hit a little cut to the hole.”

That’s a problem. He’s “thinking” over the ball. At this point he shouldn’t be thinking at all. Beilock and her research team found that golfers can actually improve their shot performance if they stop thinking.

Having a golfer count backwards by threes, or even having a golfer sing a song to himself uses up working-memory that might otherwise fuel overthinking and a flubbed performance.

You’ll hear athletes when they do their best mention things like they are in the zone and almost unconscious. “I don’t know how I did it. I just hit the ball and it went good.” Which is what Kimberly Kim said after she won the US Women’s Amateur Golf tournament.

But instead, we hear Jordan’s thinking.

So that explains the poor shots he’s making. But what explains the poor decisions? Beilock also explains:

The ability to perform difficult tasks declines over time — much in the same way that a muscle tires after exercise. In fact, glucose (which is a primary source of energy for the body’s cells, including brain cells) becomes depleted when you continuously exert effort on a difficult thinking and reasoning task. If you don’t take time to recoup your resources, your performance on whatever you do next can suffer.

Which is interesting because a couple days before, Jordan was hit with a “slow play warning”. And a few months before that, he was hit with another one, at the Abu Dhabi HSBC Championship. Nick Faldo commented: “He doesn’t like to be rushed, does he?”

Jordan is slow.

And he’s slow because he spends an inordinate amount of time thinking and worrying about every single golf shot. It’s no wonder that by Sunday, when the pressure’s on, Jordan doesn’t have anything left to make important decisions when they really count.

Perhaps if Jordan kept his cognitive horsepower in reserve for when it matters, and learned to shut down his brain when he’s already made a decision, the tournament would have ended differently.


I can see now how both of these types of poor performance showed up in how we started losing customers at Highrise again in 2015. We called in Noah Lorang, the data scientist at Basecamp, to help us analyze what happened to what seemed like an originally improving situation at Highrise.

What he found was pretty shocking. All the work we had done had indeed been pulling up our retention numbers, but in November 2015, we had deployed a marketing site redesign that altered how people were signing up for our paid plans. In short: people just weren’t signing up for our paid plans as much anymore.

So we tested a change that took just 3 hours and returned our pricing page back to what it resembled pre-our redesign.

Immediately we saw our numbers improve. In a very short time, we had a statistically significant result that showed us we now improved our paid conversion rate by 70%!

Just like that, Highrise was growing again.

Why did I not see this? First, I can see how what should have been an automatic decision wasn’t.

When I first saw the redesign we were planning, I immediately felt like we had bitten off too much. From years of running businesses, I have realized over and over again how important it is to bite off small projects. It’s too risky to do large things, and too hard to measure. So increment everywhere you possibly can.

But the redesign became a huge project. Instead of focusing on improving a single page, we scrapped the entire site and started every single page design with brand new content over again.

Immediately, my gut said: this isn’t right. But my head said well we could see what happens and let our split testing decide. I should have just trusted that gut reaction. I’ve done this enough times to know that wasn’t a smart way to go.

Because… I got the split test wrong. The second way I choked was in my decision making. When we deployed this new marketing site, we put an A/B test in place. We measured how many people converted to accounts. But we measured the wrong thing. We were measuring total accounts Free AND Paid. We neglected to see that fewer paid accounts were converting. That was mistake number one “off the tee”. My second poor decision was not involving Noah from the start. Here was a guy who had a ton of experience with Basecamp and Highrise conversion rates, traffic and previous experiments. I should have spent 5 minutes running this stuff by him and following up when things weren’t improving. But I didn’t.

Why? Well, to be honest, I think my mind was a bit worn. The experience of running Highrise has had my brain in continuous overdrive. I find myself worrying too much. I see a parallel in Jordan. I’ve spent too many cycles on things I can’t control, not reserving enough, or rejuvenating enough, to make better decisions on things I can control.

So what now? Now, I listen to my gut. I try to let that instinctual reaction out, even if it might get changed, at least I don’t bury it in other thoughts. And I try to work on projects that get my head out of worrying about things I can’t control. If I’m worried about March traffic during spring break, well I can’t do much about that. Our typical customer is on vacation. Instead I use this time to work on something I can control. I can get another project done, write another article, open source another thing we’ve done. And honestly, meditation has helped. At night when I find my mind racing, I’ve been practicing some simple meditation techniques you can pick up anywhere. (I highly recommend the Headspace App. Do the SOS drill they have on there to see what I mean. That should help immediately.)

It’s easy to choke when you’re in the moment and the pressure is on, but if you understand what to autopilot and what to reserve brain power for, you’ll overcome a huge part of the battle.


P.S. It would be awesome to meet you on Twitter, or check out all the great new things we’ve added to Highrise and see why people are so excited about our improvements.

And please help this post spread by clicking on that Heart below. It helps a lot.

Lufo, Last Used First Out — An easy way to drastically improve the user experience of long select…

Lufo is a jQuery plugin to track the most recent options chosen on a <select> element and display them at the top of the list.

Source on Github.


“Stop being regionally biased”

That’s the subject of an email we received recently at Highrise.

Well that got our intention. What are we doing wrong?

The message explained:

Your current drop down menu for country locations is not very Asia friendly — all those listed at the top of the list are in North America, Europe + Japan. My most frequent country selections are Hong Kong, Singapore, Indonesia, Vietnam, China, etc…

They were right. Our menu is 200 countries long, and we highlight a few, but it’s clearly biased towards that few.

But that got us thinking… this isn’t just a problem for Countries, we have this problem all over our app. We have a bunch of menus, many with more than a few choices, where it’s hard to repeatedly pick things that aren’t at the top of the list.

Sure, browsers try and give you the ability to type some letters to find things faster in the menu, but they fail at anything but rudimentary searches.

What we really need is a solution to have HTML select menus remember what the user last picked and make those easier to pick next time.

Something like:

Last Used First Out

LUFO!!!


Long <select> menus with many options can be a pain. States/territories, countries, currency lists, etc. have so many options it’s cumbersome to scroll through them to find the ones you use often.

Lufo tracks the most recent selections on a long <select> menu and stores them in a browser’s localStorage (it falls back to a tracking cookie if the browser doesn’t support localStorage). When someone revisits a page with that same long menu, their most-recently selected options will be copied to the top of the list for their convenience. No bias on your part. Super-convenient for the people using your site.

You can add Lufo to just about any <select> form control, choose to group the recent selects, customize (or hide) the labels and divider text, and even enable/disable Lufo based on how many options are in a dynamically-generated <select>.

http://i.imgur.com/PQd8JUq.gifv

Usage

  1. Include jQuery in your project
  2. Include the Lufo plugin code:
http://jquery.lufo.js

3. Call the Lufo plugin on a <select> element:

$(‘select’).lufo();

If you are using the plugin with multiple, different, <select> menus, you will want to specify a unique storage name for each menu:

$('select.some-select').lufo({
listStoreName: 'someSelectValues'
});

See below for other available options.

Options

Unless otherwise noted, all option examples below are Lufo defaults.

Check for Initial Placeholder Values

If your <select> menu has a built-in placeholder (for example: “Select a country…”) that resides at the top of the list and has no value, Lufo will check for it, and if found, move it to the very top of the list after adding in the most-recently selected options.

checkInitialValue: true

Set to false to turn off this check.

Strip “selected” from Cloned Values

If a recent option has the selected attribute set (selected=”selected”) it will remain when that <option> is copied to the top of the list.

stripSelected: false

Set stripSelected to true if you want the selected attribute removed from the copy.

A Title for the Recently Selected List

By default, Lufo will place a disabled <option> at the beginning of the most-recently selected options list with the text: “Recently selected:”.

recentsListTitleEnabled: true,
recentsListTitle: 'Recently selected:'

Turn the title off by setting recentsListTitleEnabled to false or change the title text by setting recentsListTitle to something else.

List Divider

Lufo will place a disabled <option> at the end of the most-recently selected options list to use as a divider.

dividerEnabled: true
dividerText: '––––––––––––––––––––––––'

You may disable the divider by setting dividerEnabled to false or modify the divider by setting dividerText to something else.

Recently Selected List Memory

By default, Lufo will remember the 5 most-recently selected items in a <select> menu.

recentsListLength: 5

You may change this number to any positive integer.

Conditionally Enabling Lufo

A <select> list must have at least 5 items in it to enable the tracking and display of recently selected items. This is especially useful for dynamic lists in an app that may need to grow over time before it becomes useful to track recent selects.

listMinimumLength: 5

You may change this number to any positive integer to enable Lufo sooner, or to wait until a list grows beyond five options.

Using <optgroup>

By default, Lufo adds the list of recent selects to the top-level of a <select> menu.

groupList: false

If you wish to group the options into an <optgroup> set groupList to true.

Ignoring Certain Values

Lufo will track clicks on all available <option> in a <select>.

If you wish to ignore a few options in the list, you may create an array of the values (value=) that you do not want Lufo to track.

Example:

ignoredValues: ['dog', 'cat', 'cow']

Setting the above option would not track clicks on any options in a <select> that contain the values of dog, cat, or cow.

Storage & Tracking Cookie Preferences

If you will be using Lufo on a single <select> menu on your site, you don’t need to change any of the storage preferences. Lufo will use a browser’s localStorage (or if that isn’t available, set a tracking cookie) to remember the most recent selections.

Default:

listStoreName: 'recentOptionValues',
cookieAge: 30 // only relevante for browsers without `localStorage`

However, if you are using Lufo on multiple menus with different values, you need to set a unique storage item name for each of the menus.

Example:

$('select.some-select').lufo({
listStoreName: 'someSelectValues'
});
$('select.other-select').lufo({
listStoreName: 'otherSelectValues'
});

You may also increase or decrease the amount of time the tracking cookie persists on your site (for browsers withoutlocalStorage). The default cookie age is 30 days. You may change it by setting cookieAge to another positive integer to represent a number of days.

Example:

cookieAge: 90

The example above would remember the recently selected options for 90 days instead of the default 30.

Examples

Example #1

Set Lufo to track a <select> with the class name countries and set a unique storage item name based on that class name.

$('select.countries').lufo({
listStoreName: 'countriesSelectValues'
});

Example #2

Set Lufo to track a <select> with the ID author_id, and a unique storage item name. Only enable Lufo if the list grows to10 items. Only show 3 of the most recently selected items. Ignore a value of none. Finally, turn off the divider, shorten the recent list title, and move the recent selects into an <optgroup>.

$('#author_id').lufo({
groupList: true,
recentsListTitle: 'Recent',
dividerEnabled: false,
recentsListLength: 3,
listMinimumLength: 10,
ignoredValues: ['none'],
listStoreName: 'authorIdSelectValues'
});

Contributing

We would love to see your contributions to Lufo! Check CONTRIBUTING.md for more information.

License

MIT License

Credit

A ton of thanks to Grant Blakeman doing the vast majority of the work putting this together.

P.S.

You should follow us on Twitter: here, or see how we can help you with contact management using Highrise — a handy tool to help you remove anxiety around tracking who to follow up with and what to do next.

Everything Good Has Already Been Invented: How Michael Cera’s Phone Can Teach Us To Compete

We want to create important, impressive, new things, but as we look around everything seems so crowded. So competitive.

Highrise, the company I run, was originally a software product created in 2007. It was one of the first web based CRM tools around. Now, the market is littered with competition. I took on a daunting task when Highrise spun off from Basecamp last year. So what do I do?


Michael Cera was staring at me through the reflection on the elevator doors

NEW YORK, NY — AUGUST 14: Actor Michael Cera attends the ‘This Is Our Youth’ Cast Photo Call at Cort Theatre on August 14, 2014 in New York City. (Photo by Cindy Ord/Getty Images)

A couple years ago, after my daughter was born, my wife had a followup visit with her doctor. As we were coming out of the office, we found ourselves waiting for an elevator with another guy. At a sideways glance, he looked oddly like Michael Cera (Juno, Arrested Development). Instead of making an overt gesture to look, I glanced at the shiny surface of the elevator doors, and saw him staring at me 🙂 Confirmed; it was him. There was a television production company on the same floor. When the elevator opened it was packed with people. So my wife, Michael, and I crammed in shoulder to shoulder. It was an odd bonding moment with this complete stranger and celebrity. As we neared the lobby he pulled out his cell phone and I noticed it was probably what you’d expect from Michael Cera… an old-school flip phone.

At first I would tell friends a quirky story of me “meeting” Michael Cera and his unusual choice of phones, but I realized the phone is also an important reminder of how to compete…

Read the rest of the article at Forbes.com

Mickey D’s

McDonald’s museum. Photo by Bruce Marlin

What startups and small business owners can learn from the giant’s struggles

McDonald’s just reported a 35% bump in profits this quarter. That makes three consecutive quarters of positive financial results. As some speculate, after years of slumping, it seems like they’ve finally turned the business around.

Here’s a few interesting takeaways about this news that might also be useful for those of us running small companies, even ones struggling to get started.


First, let’s look at what turned this company around.

Everyone is obsessed today with disruption and trying to use technology and innovation to create the next new big thing.

But if you listen to McDonald’s explain what’s working for them, it isn’t a new product at all.

Of course they try their hand at new things. New burgers, new health foods trends, even new items they’ve never tried before like mozzarella sticks. But none of those things are behind the turnaround.

So what worked? All-day-breakfast. Simply delivering a current product that people already enjoy more often.

That’s not to say it didn’t take some innovation and deep thought. The reason McDonald’s hadn’t released all-day-breakfast in the past was space. There’s only so much room in the kitchen and on the grill for burgers and other lunch items. If you look at what all-day-breakfast means, it’s actually a very limited menu. They had to figure out how to pull this off without crowding out the rest of the space in the kitchen.

But compared to inventing a brand new product whose market demand you can hardly predict, figuring out a way to deliver what your customers are already demanding is so much easier.

I’ve been involved with my own turnaround here at Highrise. Highrise is a CRM for small business that Basecamp created and spun off in 2014. As soon as it was announced that Basecamp wanted to focus on Basecamp and find someone to buy or spin-off Highrise, folks thought Highrise was shutting down, resulting in an exodus of customers. When I took over in August of 2014, we had to get this company turned around.

And finally, now, we’ve been seeing weeks and weeks of customer growth.

How’d we do it? Not a disruptive new technology. Sure I felt the urge to try to create something new and BIG, but the thing that’s worked has simply been regularly updating the product with what users have asked for and a website change to our pricing plans.

That change to our pricing plans took 3 hours. That’s right. 3 hours to make the change. Of course it took months of experiments, mistakes and working with Basecamp’s data scientist to analyze what we were doing right and wrong.

But without even touching the product, that 3 hour change improved our conversion rate of new paid customers by 70%. A huge improvement to our business simply because we changed how we communicate about the product.

When your business is going in the wrong direction, you may not need to throw out the product and reinvent everything. But that’s what many feel like they need to do in the middle of the storm. Instead, there are other, easier levers, to experiment with first.


The second thing that stands out is McDonald’s dollar menu. McDonald’s CEO claims they finally figured out a new version of their value menu.

Value is extremely important to McDonalds.

Stephen Dubner of Freakonomics fame asked on his podcast: What’s the cheapest, most nutritious, and bountiful food that has ever existed in history. It’s got 390 calories, 23 grams of protein, substantial portions of calcium and iron, and it costs only a buck or two. This was a question a fan wrote in. And the fan’s answer: the McDonald’s McDouble hamburger.

According to McDonald’s, 1/4 of it’s customers walk in the door looking for that value.

But the $1 menu that’s over a decade old just wasn’t serving McDonald’s well anymore. How can these items remain $1 when costs of everything else are going up each year? Something had to change.

Various experiments with a new value menu have failed over the years. Until now with McDonald’s new McPick 2 idea. Steve Easterbrook, the new CEO, told investors last week:

We tested two versions of the platform in the first quarter: McPick 2 for $2 in January, and McPick 2 for $5 in March. The offerings were designed to target different customers, and both resonated well.

I think the effort is a great reminder about what can be important to shoppers. They don’t always want the best product. They don’t always want the cheapest product. Often, they want the best for what they can afford. That’s a subtle but important difference, and we should strive to better understand if that lever is important in our products.

Personally, I think that’s very important to Highrise users who tend to be small business owners just getting started and with a tight budget. Over the last year we’ve added multiple features to help people get more value from using our tool (now you get a group inbox and bulk email all for the same price you were paying before). But given how much success McDonald’s has establishing value with their products, this seems like something we need to keep understanding and communicating better with our own marketing at Highrise. And I think it’s an area most entrepreneurs rarely explore.


A third thing that stands out from McDonald’s turnaround news is the fact that they’ve been in slumps before. In 2002 sales had fallen 1.5% in the US. And in 1997 McDonald’s was facing the same thing.

The lesson: if you plan on making a lasting business, plan on a constant flow of setbacks.

When I look at entrepreneurs around me, I see many of them planning as if the startup period of their business is all the pain they’ll have to endure. If they can just get to profit or funding, it’ll be worth all the sacrifice.

I’ve started my share of businesses and now realize how silly that feeling is. I remember getting my second business started. I hadn’t slept much in days, and just put down a 5 hour energy to keep the coding alive. My heart was racing. I called my wife thinking I was having a heart attack (I was living in California for a few months to be near my investors).

How ridiculous. We can’t make these enormous sacrifices of our health and family just because we think they’re temporary. Because the race doesn’t stop. It’s not actually a race.

We need to build our business and manage ourselves in a way that can keep going for the long term. McDonald’s knows this. The only constant is change.

Interestingly this week, Edy’s ice cream just announced that sales of it’s Slow Churned-lower fat ice cream has been slumping. Why? Because people have changed their attitude about fat. Now people aren’t as afraid of saturated fat. Bulletproof coffee is the new fad. It’s coffee without sugar but a couple tablespoons of fat and oil. Edy’s low fat ice cream is slumping, meanwhile this year, Edy’s full fat ice cream surged 10.8%.

Attitudes and tastes shift.

Jason Fried has mentioned some of the best advice he’s gotten from Jeff Bezos is to “Focus on the things that don’t change.” While that is certainly true with McDonald’s recent problems and solution, I think the example is also a reminder to be ready for the things that do change. Because they always will.


P.S. It would be awesome to meet you on Twitter, and check out what we’re up to at Highrise. It’s a fantastic way to help start or run your business: track conversations with new customers, manage relationships with investors, market new promotions with our bulk email tool, and a whole lot more.

And please help this post spread by clicking on that Heart below. It helps a lot.

Feature Flags


Highrise has been around since 2007 and we have many loyal customers who have stuck with us from the beginning. So you can imagine how delicate it can be to change something. We try our hardest to improve the product without interrupting current product flow, but we can’t always predict the impact of a change we make. There’s an unbelievable number of creative ways our customers use Highrise. But we try.

One thing Michael Dwan added to our bag of tricks is a Feature Flagging library we use on everything we can. Feature Flagging is the process of wrapping a new feature or change in logic that turns the feature on or off given some data on the user or the account accessing the app.

It’s a great way to test acceptance of something before everyone gets it. And can also be used for features that are difficult to test in environments other than Production. Maybe you aren’t completely sure what the performance impact might be, but you have a tough time replicating the performance load in development or staging. A slow rollout using flags might help soften the deployment as you measure the impact.

Here’s a basic setup below that we used for awhile. It did the trick. We have a fancier tool now called Bellhop (more on that later) that we use to turn things on and off in our app without redeploying anything.

But before you can run you should walk and we thought this might be worth sharing… Here’s the Feature Flags library we used. I’ll break out what each thing does below.

https://gist.github.com/n8/509f000552291c1943fe5d87018bae81

BETA_ACCOUNTS are subdomains of accounts that always get our new features turned on.

FLAGS is a hash of feature names. They list percentages (as integers: 10% = 10, 66% = 66) of accounts that should have the feature on like “10% of accounts should get this” or they list explicit account subdomains that should get the feature.

The real magic is here:

return true if Zlib.crc32(“#{feature}:#{account.id}”) % 100 < config[:percentage]

What’s up with that?

We want our features to get rolled out to percentages of people. So we combine their account’s id with the name of the feature and turn it into an integer. The Zlib library has a crc32 utility that will convert our combined string into an integer checksum that’s constant for that string.

Since these integers should be fairly randomly distributed they should also have their last two digits evenly distributed between 0 and 99.

In other words, 10% of our account ids + feature names will end with a digit between 00–10, 20% of our account ids + feature names will end with 00–20, 30% 00–30, you get the idea. All we have to do is look at the last two digits of an (account ids + feature name converted to an integer) and compare it with the percentage of accounts that should get this feature.

If we just used account id’s and didn’t include a feature name, accounts would always get pinned to the bucket their last two digits were in. An account that ended in xxxxx01 would always end up in the 10% rollout group and would always see possibly experimental features. Adding the feature name randomizes the bucket these folks fall into. (Thanks for the feedback @michaelmelanson! He caught the error in an original version of this post.)

And there’s an easy way to get the last two digits of any number. Just “mod” it by 100.

I won’t go into an in depth discussion about what a modulo operation is. It’s really just the remainder of a number when it’s divided by another number.

In Ruby the modulus operator is the percent sign. So 5 % 2, is the remainder when you divide 2 into 5. 2 goes into 5 two whole times, and then there is a remainder of 1. In other words:

5/2 = 2.5 
The remainder or modulo is 2.5’s decimal * 2 = 0.5 * 2 = 1
So 5 % 2 = 1

Well let’s look at what happens when we divide numbers by 100.

9837364/100 = 98373.64 
0.64 * 100 = 64
64 is the modulus

Ah, the modulus of a number with 100 gets us the last two digits of that number.

So in pseudo code, here’s what we’re doing:

if last two digits of (feature name + account id converted to an integer) < percentage 
they they get the feature

And so using our library we’ve been able to add blocks of code like this around important things we don’t want everyone to have right away:

if FeatureFlags.enabled_for_account?(account, :cool_new_thing) 
# do something new and cool
end

Need more people to get your cool feature? Just up the percentage in your flags to a higher number and redeploy your code.


Hope this helps if you need a quick and dirty library to start doing some feature flagging. Stay tuned though. We’ve got a really nice system we use today that we’ll open source soon that makes this much more flexible.

P.S. It would be awesome to meet you on Twitter, and check out what we’re up to at Highrise. Lots of great open source projects from us on their way.

What “Sad Affleck” and an open source debacle teach us about success

Adapted from Gage Skidmore

A few weeks ago, two seemingly unrelated events took over our news feeds — Sad Affleck and the “left-pad” fiasco.

Sad Affleck exploded on YouTube with over 22 million plays, having a little fun with critic feedback on the new Superman vs. Batman movie.

And the “left pad” fiasco was about an “npm module”. Npm is a package manager for Javascript, which is a way for developers to list web “dependencies” to include in their application. These might be files they’ve written, but often they’re open source contributions from someone else.

Well, left-pad’s developer, Azer Koçulu, was upset by a trademark dispute with another company, so he decided to pull all the modules he had made from npm. Not a big deal if no one besides you uses those modules. But left-pad is depended on by many apps and developers. And when it disappeared, it crippled apps all over the web.

These two events don’t look related, but what they share in common is more important than most of the lessons I’ve seen taken from them so far.


We at Highrise recently open sourced a project of our own called Snapback Cache.

This was a piece of software we built to help make our activity feeds more user friendly. But eventually I also saw it as something we could spend a few hours polishing up into a open source script.

I didn’t expect much.

But, Snapback Cache turned out to be my most trafficked blog posts in all of March with tens of thousands of readers. It’s generated some very nice new attention to Highrise — a very high return for a tiny investment.

Is this an uncommon experience? Not at all.

“Sad Affleck” looks like it took only a few hours to produce as well. But a few hours turned into millions of viewers. Their next video was another riff on the same Affleck interview, and it racked up almost 74,000 views. Not the same impact, but a nice spillover.

And left-pad is only 11 lines of code. So of course the left-pad disaster generated questions like: Have we forgotten to code? Why do we introduce such potentially destructive dependencies for something so simple? Valid questions.

But I think the more important thing we can take away is that left-pad is downloaded 25 million times… A MONTH!

I doubt Koçulu, could have predicted the impact his module was going to have on the web when he put in the little bit of time open sourcing a simple method. And I couldn’t predict the success we were going to have with our Snapback Cache.

But the great thing is, we don’t have to. For such a small investment of time, we can afford to publish hundreds of things and maybe some of them will add real value (or entertainment).

There are big things of course that we want to make. The Batman vs. Superman movie itself took years and 250 million dollars to produce. But everything doesn’t always have to be so big. We can produce small things that can often have a huge amount of impact.

Keep publishing simple lessons you’ve learned. Don’t feel like you need to predict their success. Don’t feel like you need to spend inordinate amount of time polishing everything you put out there to the public. Even 11 lines of code can be something incredibly useful to so many people.


P.S. It would be awesome to meet you on Twitter, and check out the things, big and small, we’re up to with Highrise.

One Day on Earth


Every day we hear surprising stories and helpful advice from our users at Highrise in every kind and size of business and we want to spread some of that to the rest of the community too! Brandon uses Highrise to organize thousands of people at his business One Day on Earth, but this story isn’t about Highrise…

Over the years we have shipped more than 1000 cameras to 150+ countries

Wait. What? Does Amazon even ship to that many countries? Here’s a quote from Amazon Global: The majority of items in Amazon’s product catalog can be shipped to over 75 countries.

So, how do you do this?

There is no way that would be possible without our partnership at the United Nations.

🙂 But really, why is Brandon Litman, shipping cameras to so many places?

One Day on Earth is exactly what it sounds like. People from all over the world are showing you what the entire planet looks like through their eyes, all at the same time. It takes a herculean effort, and the results are impressive. You can see a teaser of their latest example here:

Let’s learn a bit from Brandon on how he even got started.


If you really want something, you should work to get it.

Brandon Litman

From renting out his Game Boy in elementary school to handling a global film screening in over 160 countries, Brandon Litman has been running businesses for quite awhile. “Doing business was something that always excited me,” he says. Litman started early, and his entrepreneurial drive continued through high school, when he made ramps for fellow skateboarders, and into college.

“The college environment is so primed for young entrepreneurs,” he says. Litman was a licensed skydiver by his freshman year, which brought about his most significant college project. After making a deal with a local drop zone to get volume pricing, Litman coordinated groups of students to do their first jumps, making “a killing on the margins.” Litman organized up to 80 students to do tandem jumps in a single weekend.

To grow his business, Litman looked further afield than college students:

I even momentarily joined the Army officer training program because I thought they would be good to recruit. That didn’t last long — I quit when they asked me to jog with a log on my shoulder.

Though he enrolled in an architecture major initially, Litman quickly decided it wasn’t for him:

I arrived at my first class at USC where, within 10 minutes, I learned architecture was a 5-year program with a starting salary of 35k. I immediately left and changed my major to “undecided”.

Unsurprisingly, Litman says he naturally fell into his school’s business program. After college, he continued growing his business acumen. He worked on plans for a dry cleaning business, and managed new business efforts for an ad agency in LA before starting a video production company in NYC where Litman worked for 8 years.

These days Litman is co-founder and Executive Producer at One Day on Earth — a company started in 2008 with a lofty goal — to have thousands of participants around the world film simultaneously over a 24-hour period. From this initial project idea, One Day on Earth has grown into a foundation that aims to build and support a global community of media creators.

The initial project idea came from Litman’s business partner, Kyle Ruddick.

Kyle edited a brilliant trailer and asked me to take a look. I immediately fell in love with the project and came on board as an investor and advisor. Within months it snowballed into something much bigger and I was obsessed with the project and all it had to offer. It didn’t take long for it to become my fulltime focus.

Several years on, Litman’s responsibilities include fundraising, partnership building and business development. He says producing the initial film concept has been the highlight of the One Day journey so far:

In 2010, when we said we were going to film in every country in the world on the same day, people thought we were nuts. So there was nothing more magical than sharing the film, which was done via a global screening premiere involving 220 locations in over 160 countries, with the flagship screening at the General Assembly of the United Nations (1700+ guests). It was one of the best days of my life.

Mission accomplished. Now what?

With a global focus, Litman’s day is almost always full of meetings and calls. One Day on Earth has community managers to help them coordinate with people around the world, but Litman says international partners and their existing networks have also been an important part of scaling the company.

Looking forward, Litman’s focus in on fundraising. So far the company has been mainly funded with grants, but with new ideas in the pipeline, Litman’s looking for the right investors to help take One Day to the next level. The company is working on a platform to help independent filmmakers and producers organize their own large filming events, similar to One Day’s successful past events.

“We uncovered a great model of engaging people with media creation and we want others to be able to use that model in a turnkey way,” says Litman.

And personally? Litman wants to get away from the computer and work with his hands more.

Working with my hands is very important. It is meditative. It makes you appreciate not just craftsmanship, but also the mechanics and thought put into the everyday things we use.

Litman used to rent space in a wood shop, and says he hopes to find more time to get back to woodworking in the future.

I try to have a project in the works at all times. A few hours a week is all I need to remain sane. You know you are doing something you love when you get to that Flow State and you suddenly realize the sun is coming up.

Though the younger Litman didn’t have any firm expectations of where he might end up, he’s surprised at how small the world seems these days.

“The biggest difference is perspective and the feeling of accessibility,” he says. “I’m lucky to have broadened my personal scope of international affairs and have built a much greater appreciation for the complexities associated with topics we hear debated in the media.”

With such a wealth of experience behind him, the biggest lesson Litman keeps in mind when working on something new. “If you really want something, you should work to get it.” And that’s what he continues to do.

He also says “I probably talk about Highrise too much at parties.” Thanks Brandon! Couldn’t help but throw that one in! 🙂


P.S. If you need help organizing anyone from yourself to thousands of people, you should take a look at Highrise. It’s a utility knife for anyone who needs to communicate online. And you should follow us on Twitter: here.

And thanks to Belle Beth Cooper for doing the interview and write up of Brandon’s story!

Junior


Why do some families seem so good at passing down success, while others fail?

Today, dog sleds are a bit of an anachronism — a reminder of travel that was important many years ago. In 1925 a diphtheria outbreak occurred in Nome, Alaska. Diphtheria is a bacterial infection that was an extremely deadly disease for native Alaskan children who had no immunity.

There was an antidote, but the town’s doctor was out of it. And it was winter. The ports were blocked with ice. Planes couldn’t fly.

Their only hope was to fly 300,000 units of the antidote found at a hospital in Anchorage as far as it could go to Nenana, Alaska which was still 674 miles away.

Dog sleds would have to take it the rest of the way.

So 25 riders, or mushers as they’re called, and 150 dogs relayed across the Iditarod Trail for 6 days of brutal weather to keep the outbreak at bay. Several dogs lost their lives on the way.

Today, the “Iditarod” race helps commemorate that event. A hundred or so mushers take their dogs across 1000 miles. It takes a 1–2 weeks for everyone to complete the race.

And this year on March 15, 2016, Dallas Seavey won the Iditarod. For the fourth time.

Dallas is an interesting specimen of a winner. Not only is he a repeat champion, he also holds the record for being the youngest winner at 25 when he won in 2012. And he set a new record time this year by beating his own previous record from last year! The guy knows how to win.

Even more interesting, Mitch Seavey, Dallas’ father also has two Iditarod wins under his belt and has set his own records. Dallas’ grandfather was a veteran racer too.

Looking at Dallas and Mitch I wonder why is this family so good at racing? Is it luck? Is it something hereditary? Or is there something important we can take from this to help our own kids, students and employees to be more successful?

Or was Dallas Seavey just born to win?


In other news this March, Frank Sinatra Jr. sadly passed away. You probably don’t know much about Frank Sinatra Jr. but you’ve heard his dad’s music. Perhaps the thing Frank Sinatra Jr. is most famous for? Being kidnapped.

Frank Jr. was kidnapped at 19. Some drug fueled kids envisioned kidnapping Frank Jr. as a “business deal” with Frank Sr. They planned on “borrowing” Jr., investing the ransom money and paying back the family. They even refused to take a million dollars from Frank Sr. when he offered it, and stuck to the odd number of $240,000, which was their original ask.

The ransom was paid, and Jr. was returned safely. The kidnappers were caught and sentenced to prison soon afterwards. Rumors however came from another bizarre turn when the kidnappers argued that Frank Jr. had orchestrated the kidnapping himself. Barry Keenan, the mastermind behind the kidnapping, now a wealthy real estate tycoon, has since apologized profusely for what he did and has admitted that Frank Jr. was innocent of the whole thing.

So apart from being one of the most famous celebrity kidnappings, who was was Frank Jr.?

Frank Jr. was a talented piano player, a trained musician, and a gifted vocalist like his dad. But in contrast to Dallas, here’s Frank Jr.’s words about himself:

I was never a success. Never had a hit movie or hit TV show or hit record. I just had visions of doing the best quality of music. Now there is a place for me because Frank Sinatra is dead. They want me to play the music. If it wasn’t for that, I wouldn’t be noticed.

I think the disparity between Frank Jr. and Dallas offers an opportunity to learn some interesting things that parents and mentors can use to influence success.


Suniya Luthar is a Professor of Psychology at Arizona State University. She set out to deeply understand how poverty affects children. In study after study she has looked at the differences between groups of affluent, white, upper-class students and their poor, inner city counterparts. The results were unexpected.

As Suniya peered into their lives, she found that the affluent high schoolers actually suffered from higher levels of anxiety, depression and substance abuse. One argument you might make is that the affluent kids are spoiled and have money to blow on junk like drugs. But as Suniya found, it was more troubling than that. She kept finding evidence of self-medication. These kids weren’t blowing excess money out of boredom, they were using drugs to try to deal with that depression and anxiety. Why is this happening?

One theory that Suniya believes ties it all together is that the affluent kids are simply more alone. From her paper, The Culture of Affluence: Psychological Costs of Material Wealth

Sociological research has shown that junior high students from upper-income families are often alone at home for several hours a week. At an emotional level, similarly, isolation may often derive from the erosion of family time together because of the demands of affluent parents’ career obligations and the children’s many after-school activities

Parents just aren’t around. They’re working hard to improve the careers that brought the affluence in the first place.

I didn’t have a lot of money growing up. But my parents were around a ton. I was in a bunch of activities, and my parents were actively involved even coaching the teams themselves. It was lessons on the field with my dad, or working with my mom at 2am on a science project that helped me learn and achieve.

But now that I feel like I have a pretty affluent peer group, I see different decisions being made. Folks needing to travel to a job or conference, or another late night at the office to make these important careers work. Is the sacrifice worth it?

It wasn’t for Frank Jr.

When Frank Jr. was a teenager Frank Sr.’s career became prolific, on average performing in 2 movies and creating 4 albums every year through the 50s and 60s. As you can imagine, Jr. didn’t see much of Sr.

Jr. would say at some of his shows, “I am now going to devote five minutes to the music of Frank Sinatra because that is exactly how long Frank Sinatra devoted to me.

That’s a big contrast to Dallas’ relationship with Mitch.

Win or lose the race or not doesn’t change the fundamentals of our relationship — that as family and friends. It’s an interesting dynamic to be the biggest competitors and best friends at the same time

Mitch on his son’s accomplishments

Mitch and Dallas spend a great deal of time on family and being friends. As you read Dallas’s own biography,

He grew up under the tutelage of his grandfather Dan and father Mitch

Frank Jr. barely saw his father. Dallas was taught by his.

The hunger for love is much more difficult to remove than the hunger for bread. -Mother Theresa


A second key point stands out when you read about Dallas vs. Frank Jr. Frank Jr. wasn’t really a Junior. His name was Franklin. His dad was Francis. But at some point, Franklin obtained his dad’s nickname. That’s a tough act to inherit. And inheriting your parent’s legacy isn’t a sure fire plan for success, in fact, it often goes the other way.

Morten Bennedsen, a Professor of Economics and Political Science at Insead Business School, found that firms who pass along leadership to a family member on their departure suffer a 4% drop in value. A drop that’s even more severe for businesses in rapidly growing or highly technical industries.

And not only did Frank Jr. inherit his father’s name. He sang the same type of music. His first professional start was even with the members of the Tommy Dorsey orchestra which had launched his Dad’s career. Instead of Frank Jr. taking a new path, he tried to take the same steps his dad did.

Frank Sr. even had Frank Jr. sing on his Duets 2 album, which backfired for Frank Jr.:

It was the wrong thing to do. The premise of the Duets album was to have Frank Sinatra sing with young artists who were big successful record sellers. I never was. It was nothing but nepotism and it always embarrassed me. I did not belong on those records. I was delighted to do it, but I didn’t belong there.

Frank Sr. also gave Frank Jr. a job. His dad made Frank Jr. the leader of his band when Frank Sr. was aging and couldn’t find a band leader who would work for him any more. “This is my son — his mom told me to give him a job,” Frank Sr. would tell his audience as a ‘joke’. But in the end it was still keeping Frank Jr. under his shadow. Frank Jr. would even wear a dull suit during his dad’s performances and lead the band with his back to the audience all so that he wouldn’t dare outshine his dad.

If you look at Dallas’s career it reads very differently.

When Dallas wanted to finally race competitively he didn’t inherit anything. Instead he spent his own money buying dogs from his father. And his father sold him the b-squad. The “scrubs”. These were dogs that were sized wrong, too big or too little. Dogs who were scared to race, or some that were past their peak or had even been injured. Dogs that Mitch didn’t even want.

It wasn’t easy. It took 4 years before that Scrub squad became competitive and won their first race. And now, Dallas is racing the pups of the Scrubs.

Mitch isn’t giving Dallas handouts, and Dallas isn’t trying to become Mitch or inherit anything from him. He’s trying to beat him using his own unique set of tools.

And that’s an important difference when you think about helping our children succeed. Do you give them opportunities, or do you let them struggle and fight to find their own way?


In the end, Frank Jr. was still a talented musician who eventually found a path and peace with his life. But I still can’t help comparing the differences in how Frank Jr. and Dallas were raised and educated.

And I am by no means an expert of parenting. That’s why I’ll refer to these lessons as I make my decisions and sacrifices around my own career and family, and what my child needs to succeed.

But these same principles can also be applied in companies. It’s easy to get lost in our own focus and priorities. We don’t want to micromanage. But are we really just the absent parent who swoops in every now and then with advice that turns out to be an unhelpful handout? Or do we regularly give our teammates our time and ears, but still room to work out their own ways of succeeding.

Because here’s the thing. Often we think we need to sacrifice time with others in order to keep our own thing going. But I left something out about Mitch.

Dallas may have won 4 times, but he didn’t win them all in a row. He won in 2012, but lost in 2013. Who’d he lose to? His own father. And this year, guess who came in second? Mitch. Mitch even beat Dallas’s record from last year.

By being a teacher and a friend, and helping his son compete on his own, Mitch himself has gotten better. Maybe the student became a master. And the other master got even better.


P.S. It would be awesome to meet you on Twitter, or check out what our team is doing with Highrise.

Snapback Cache — What we use to make our infinite scrolling feeds at Highrise awesome.

Many apps today have some concept of an infinite scrolling feed: Facebook, Twitter, LinkedIn and many more. Almost all of them suffer from the same problem. If you click on something in the feed that brings you to a new page, when you hit the back button or try to return to that original feed, your place is lost. All the scrolling is gone.

At Highrise we had that same problem. So this is the library we use to fix that. We call it our Snapback Cache, and it’s made a big improvement to how people can use infinite scroll in our app and still get a lot of work done without losing their place.


Another great thing about this is it operates on the URL, so you can have multiple infinite scrolling feeds to cache. At Highrise we have a “main activity” and then activities for a Contact, etc. They each get their separate cache. To keep a manageable memory footprint for your browser, we keep 10 caches as a maximum.

The basics of how it works

Using this small javascript library, you hook it up to the click events on things in your infinite scrolling feed. For example:

https://gist.github.com/n8/96475a20b36e87973671

Now when people click the links inside our “recordings” container, the stuff inside the current recordings container is cached locally using the browser’s session storage.

Then the javascript library watches the load event of any pages being browsed. If the library sees that that browser’s URL is a url we’ve already cached, and it’s not “too old” (15 minutes), we replace the contents of our container (#recordings in our example) with the cached version, and scroll the browser to the place where it had been cached.

This sounds easy, but there are certain things we bumped into that the library also helps with. Things like disabling autofocus events that mess up scrolling and making sure things in the cache can actually be more granularly ignored or even refreshed.

Syntax and how to use it

var snapbackCache = SnapbackCache({ options });

Here are some example options:

https://gist.github.com/n8/b7036e96761a98709ca7

bodySelector is mandatory. It tells us what on the page you want to cache.

finish is a function of things that you’d like to happen before the page is cached to get the page to get cleaned up. For example, we already try to get jQuery animations to finish, but if there’s anything else on the page that might be animated or dynamically changing when someone is trying to navigate your site, you probably don’t want those “transitional” things cached. In our case we have a search bar that we want cleared up before things are cached.

removeAutofocus is a function that removes any auto focus behavior from your page. autoFocus events can mess with the browsers ability to scroll to the right place. So we want to nip that in this function. In our case we have multiple autofocus things going on, so we clear all that up.

refreshItems is a function to help refresh anything that might have gone stale from the cache. You can use that in conjunction with a method available on snpachbackCache called markDirty.

So in our case, we cache a note or comment or email in our feed. But if someone at some point edits/deletes one of those notes, comments or emails, we have javascript call

snapbackCache.markDirty(id_of_dirty_thing);

Then when the snapbackCache replaces the cached contents it’s saving for us, it makes sure to call the refreshItems function you specify along with an array of “dirty items” you can do something with. In our case, we take all those dirty ids, and issue an ajax call that does all the work to refresh bits of the cached page.

nextPageOffset is a function that the Snapback cache can use to figure out what “page” your user is on. We take that page and store it along the cached contents of the page. That way when the cached page is restored you have the page number the user was on and get pick up infinite paging at the appropriate place. See the page-cache:loaded event below to do that.

Events

There are a couple of events we send out that are useful.

snapback-cache:cached is an event emitted as soon as the contents of the page have been cached into session storage

snapback-cache:loaded is an event emitted as soon as the contents of the page have been replaced. We use this at Highrise to set the appropriate offset for our infinite scrolling:

https://gist.github.com/n8/625c218e7ac8b79fdacb

nextPageOffset was calculated because we had setup a “nextPageOffset” function on the page cache.

Installation

1) Add the snapback_cache.js to your javascript stack.

2) Add a cache variable with the options set:

var snapbackCache = SnapbackCache({ bodySelector: "#recordings", });

3) Call snapbackCache.cacheCurrentPage() whenever you need to, and magically when people return to that url, the cache will do the rest.

Feedback

Source code available on Github. Feedback and pull requests are greatly appreciated. Let me know how we can improve this.

A ton of thanks to everyone at Highrise for helping get this into our stack. Especially Jon Phenow, Grant Blakeman and Michael Dwan for the edits and help getting it open sourced.

P.S.

You should follow us on Twitter: here, or see how we can help you with contact management using Highrise — a handy tool to help you remove anxiety around tracking who to follow up with and what to do next.