iTerm3 and docker startup

If you open iTerm2 and try to run docker ps you’ll probably receive below error:

Cannot connect to the Docker daemon. Is the docker daemon running on this host?

The solution to use iTerm2 instead of Docker QuickStart Terminal is relatively simple:

That will generate below output:

You then need to run:

The output of it is:

All you need to do now is to run:

That’s all 😉


Node.JS Module Patterns

1. The simplest module

2.Module Patterns
2.1. Define a global

Node: Don’t pollute the global space

2.2. Export an anonymous function

2.3. Export a named function

2.4. Export an anonymous object

2.5. Export a named object

2.6. Export an anonymous prototype

2.7. Export a named prototype


  • Named exports – allow you to export multiple ‘things’ from a single module
  • Anonymous exports – simpler client interface