How to search bash command history in Emacs multi term

Mar 31, 2017

C-r in Emacs multi term invokes (isearch-backward) command. To search bash command history we can use M-r instead.

  • Reference https://www.emacswiki.org/emacs/MultiTerm
Categories : Emacs

How to configure multi term in Emacs to allow login shell

Mar 31, 2017

To configure multi term in Emacs to allow login shell

(setq multi-term-program-switches "--login")
  • Reference

http://stackoverflow.com/questions/19750218/emacs-multi-term-as-a-login-shell

Categories : Emacs

Responsive vs Adaptive Design

Mar 29, 2017

  • Responsive Design - Responsive websites respond to the browser size at any given point. No matter the browser width, the site adjusts its layout.

  • Adaptive Design - Adaptive websites adapt to the browser size at specific points.

  • Reference - https://css-tricks.com/the-difference-between-responsive-and-adaptive-design/

Categories : CSS   Design

Difference between CSS reset and normalize

Mar 26, 2017

Normalize.css

  • Preserves useful defaults rather than “unstyling” everything.
  • Corrects some common bugs that are out of scope for reset.css.
  • Doesn’t clutter your dev tools.
  • Is more modular.
  • Has better documentation.
  • Reference http://stackoverflow.com/questions/6887336/what-is-the-difference-between-normalize-css-and-reset-css http://nicolasgallagher.com/about-normalize-css/
Categories : CSS

Different ways of creating Objects in JavaScript

Mar 25, 2017

Explained below are some of the different ways of creating Objects in JavaScript.

  • Objects created with syntax constructs (Object Literal Notation)
var o = {a: 1};
  • With Function (New Objects with Constructor function)

A constructor is a function that contains instructions about the properties of an object when that object is created and assigned. Advantage over object literal is you can create many instances of objects that have the same properties.

function Car() {
    this.make = 'Honda';
    this.model = 'Civic';
}

var c = new Car();
  • With Object.create

ECMAScript 5 introduced a new method Object.create.

var a = {a: 1};

var b = Object.create(a);

console.log(b.a); // 1 (inherited)
  • With Class

JavaScript classes were introduced in ECAMScript 2015 (ES6)

Class Car {
    constructor(make, model) {
        this.make = make;
        this.model = model;
    }
}

var c = new Car();

Reference

Categories : JavaScript