javascript multiple binds

In javascript, if we bind multiple times, only the first bind takes in the provided this value. That is because the bind function returns a new function which doesn’t have this anymore. Subsequent binds won’t have any effect on the original this.

// NOT the real bind; just an example
Function.prototype.bind = function(ctxt) {
    var fn = this;
    return function bound_fn() {
        return fn.apply(ctxt, arguments);
    };
}
// no more 'this' in my_bound_fn
my_bound_fn = original_fn.bind(obj);

ref:
https://stackoverflow.com/questions/33832384/in-javascript-the-first-bind-determines-who-this-is-binding-it-twice-or-a-s
https://stackoverflow.com/questions/26545549/chaining-bind-calls-in-javascript-unexpected-result

How https works

Here is a nice cartoon to demonstrate how https works.

http://sudhakar.online/programming/2015/08/09/https.html

The Secret to Learning

That is the way to learn the most, that when you are doing something with such enjoyment that you don’t notice that the time passes.

ref: https://www.brainpickings.org/2013/06/14/einstein-letter-to-son/

Cheat Sheet of Machine Learning and Python (and Math) Cheat Sheets

Get them at this link:

https://unsupervisedmethods.com/cheat-sheet-of-machine-learning-and-python-and-math-cheat-sheets-a4afe4e791b6

Photo realistic surrealism

Check out these photos from Erik Johansson, I am speechless.

Erik Johansson Photo

Javascript function call/apply

function Person(name) {
    this.name = name; 
}
Person.prototype.getName = function() {
  return this.name;
}
name = 'global';
let peter = new Person('peter');
let john = new Person('john');
// what are the outputs?
john.getName();
john.getName.call(john);
john.getName.call(peter);
john.getName.call(null);

You should get:

john
john
peter
global

Implicit structure

Every company has a structure. If you don’t explicitly define your structure, then you are left with an implicit one, and that can stifle productivity. We had hoped that being flat would let us move faster and be more creative, but as we grew, we ended up with an unspoken hierarchy that actually slowed down our ability to execute.

ref: https://wistia.com/blog/ditching-flat