This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from underscore.js | |
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// [wait] milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
function debounceOG(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { |
https://support.google.com/mail/answer/6594?co=GENIE.Platform%3DDesktop&hl=en
- navigate arrows
- open thread RETURN
- new e-mail c
- search /
Meaures from fast.com
$ npm i -g fast-cli
$ fast [> file]
Meaures from speedtest.net
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.indexOff = function(x) { | |
if (this.length === 0) { | |
return -1 | |
} | |
for (var i = 0; i < this.length; i++) { | |
if (this[i] === x) { | |
return i | |
} | |
} | |
return -1 |
- Place errorHandler after all routes and before
.listen
- Forget
process.env.NODE_ENV
- Use knas when raising errors if you need to produce http status codes
function errorHandler(err, req, res, next) {
// err is either obj or string