Skip to content

Instantly share code, notes, and snippets.

@willlma
willlma / crucial-conversations.md
Last active November 14, 2017 18:44
My notes from the book Crucial Conversations by Al Switzler, Joseph Grenny, and Ron McMillan

Crucial Conversations notes

This is not meant as an exhaustive summary of the book, but rather what points interested me as a reader.

1 What?

Effective communication can mean the difference between long healthy relationships and a breakup.
Holding things in can result in detriments to your health.
Effective communication > snide remarks > silence
When stakes are high, we get defensive and get into fight or flight mode.

@willlma
willlma / beginning.md
Last active August 29, 2015 14:20
A better way to refresh oauth tokens for Google API JavaScript Client Library (gapi)

When using the Google API Client Library for JavaScript, none of the code samples demonstrate how to get a new token after the previous one has expired. Tokens expire after an hour, so it can't be assumed that the initial token will suffice for every user's stay on your site. The part of the FAQ that deals with refreshing tokens suggests to

refresh the auth token after 45 minutes

Which implies that one should set an interval for 45 minutes and refresh the tokens. The problem with that approach is that when your computer goes to sleep, javascript timers are put on hold, and sometimes take some time to fire after resuming the page. Unfortunately, the first thing your user may want to do when they resume using their computer is to check if there are any updates to your site, and when you make an api call for them, it will fail. So we need to check if ou