Opinions are like assholes, every one has got one.
This one is mine.
Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.
weekday = (function() { | |
// Returns the weekday number for the given date relative to January 1, 1970. | |
function weekday(date) { | |
var weekdays = weekdayOfYear(date), | |
year = date.getFullYear(); | |
while (--year >= 1970) weekdays += weekdaysInYear(year); | |
return weekdays; | |
} |
/* | |
One disadvantage of ajax is that the user does not see the browser’s progress UI. Typically this is | |
a spinner that takes the place of the favicon in the browser tab while waiting for assets to download. | |
I believe this to be an important piece of UI. The browser vendors think so, too, otherwise it wouldn’t | |
be there. | |
How to emulate it? By adding an element to the DOM that is waiting to download. Below, this is done | |
with an iframe. |
API credentials for read-access:
Project ID: 53f3eca97d8cb91b75000000
API Key (read-only): df6ff0ff414bc286b91e2661db4c691c45b6aea8d2c8cf2393169e9b9ef36a3d77e59c57b540febc8f328bf1f605782d9035c4a7072dc86c4f96ddbcce7dfe0b088ae51dd2ea36ad022290d1f3580e2d1ea202845ae7f79e7db6634ee627a26197dadf7eb2e5a46b16f04a4cae55955e
Sample dashboard here, JS source here