Thursday, December 27, 2018

Linux: Prevent SSH timeout

https://bjornjohansen.no/ssh-timeout

In ~/.ssh/config add the following line:

     ServerAliveInterval 30

This will send a “null packet” every 30 seconds on your SSH connections to keep them alive.




Monday, December 17, 2018

ES6 - list of some of the new things

Some of the new things in ES6: 
destructuring, default parameter values, symbols, concise methods, computed properties, arrow functions, block scoping, promises, generators, iterators, modules, proxies, weakmaps, etc

Friday, December 14, 2018

Javascript - this, bind, call

// this , bind, call

var msg = "global";

function f(x){
  console.log(this.msg + "," + x);
}

var obj1 = {
  msg: "obj1",
  f: f
}

var obj2 = {
  msg: "obj2"
}

f(10);
obj1.f(10);
f.call(obj2, 10);

// f.call(window, 10);
// f.call(obj1, 10);
// f.call(obj2, 10);

// f.bind(obj1)(10)
// f.bind(obj2)(10)
// f.bind(window)(10)

Sunday, December 9, 2018

Config in Elixir projects

Excerpt from Elixir Cookbook -
The configuration from the imported files will override any existing configuration (with the same key) in the config.exs file. In fact, Configuration values are merged recursively. See the example at https://github.com/alco/mix-config-example.
To access configuration values, we use Application.get_env(:app, :key)

Followers

Blog Archive