Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
| function nextPushId () { | |
| // Modeled after base64 web-safe chars, but ordered by ASCII. | |
| var PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz' | |
| // Timestamp of last push, used to prevent local collisions if you push twice | |
| // in one ms. | |
| var lastPushTime = 0 | |
| // We generate 72-bits of randomness which get turned into 12 characters and | |
| // appended to the timestamp to prevent collisions with other clients. We | |
| // store the last characters we generated because in the event of a collision, | |
| // we'll use those same characters except "incremented" by one. |