Skip to content

Instantly share code, notes, and snippets.

View monsur's full-sized avatar

Monsur Hossain monsur

View GitHub Profile
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active July 5, 2024 10:02
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@nemtsov
nemtsov / connect-use-many.js
Created August 4, 2013 01:44
Connect middleware used when you need to combine multiple other middleware into one.
/**
* @param {Array} list of middleware to combine
*/
module.exports = function (list) {
return function (req, res, next) {
(function iter(i) {
var mid = list[i]
if (!mid) return next()
mid(req, res, function (err) {