Cleanup on line 351

The things I have learned while noodling on a single-page app with my husband over winter vacation have been both illuminating and… well. I’m sorry. I’m so, so sorry.

[code language=”diff”]
Index: js/app.js
===================================================================
— js/app.js (revision 43)
+++ js/app.js (working copy)
@@ -224,6 +224,7 @@
div.className = "uiMessage sent-message";
} else {
div.className = "uiMessage";
+ div.style.backgroundColor = getColorFromString(msg.sender);
}
sender.className = "uiMessageSender";
message.className = "uiMessageContent";
@@ -344,3 +345,8 @@
break;
}
}
+
+function getColorFromString(str) {
+ // I am become Death, the destroyer of worlds.
+ return [ str.slice(0,4), str.slice(4,8), str.slice(8,12) ].map( x => (255 – (Math.floor((x.split(”).reduce((r,c) => { return r + c.charCodeAt(0) }, 0)) / 8))).toString(16)).reduce((r,c) => { return r + c }, ‘#’);
+}
[/code]

Adulting win-slash-lifehack for vaccinations

My family has seen the same family practice for the last twenty years and I love that we have a good relationship with our doctors. However, we moved about five years ago. Since then, we’ve seen them once or twice a year for annual physicals and followups but usually go to a local doc-in-the-box for smaller things because it is an hour-long drive to get to the office.

The kids were all due for their second shot in various series and I was kind of dreading trying to find a school vacation day when we could make the drive out. It turns out that our family doctor was happy to fax a prescription for the vaccines to our local grocery store pharmacy. We have gotten flu shots there in the past; the pharmacist is very helpful and the store is super clean. Best part: I could do this on a Saturday morning, no appointment, just a few phone calls to make sure that they’d received the prescription and had the vaccine in stock. I’ll bring in the paperwork from the shots to their next physical so that their medical records are complete.

One thing that was confusing was that the grocery store was not on the online list of providers for some of these vaccines. I ended up making three phone calls — one to the pharmacy to confirm that they had or could obtain the vaccine, one to our doctor to request the prescription, and one last call to the pharmacy to confirm they’d received it.

Bonus: the store had a Starbucks for the obligatory after-shot treat.