Short-circuits conditionals

If you have to execute a function only if condition is true, you can use short-circuit.

// Instead of this
if (condition) {
    doSomething();
}

// You can use short-circuit
condition && doSomething();

Logical AND

In JavaScript, the logical AND operator will return true if both operands are true. It returns false in any other scenario. Here are a few simple examples:

true && true
// true
true && false
// false
false && false
// false

You can also read this

Simple Nodejs watcher

I built a simple Nodejs watcher that is syncing changes...

const dataCsv = './sample_data.csv';
const mongodb = require("mongodb").MongoClient;
const csvtojson = require("csvtojson");
const fs = require('fs');
let url = "mongodb://yoururl";

Bulker – Face recognition script

Imagine that we have thousands of images inside of a...

def get_ref_face(self, ref_image_path):
        try: