Skip to content

Conflicting package-lock.json in Git?


Include package-lock.json in your git repository, but try to commit it alone (to avoid noise in diffs).

When encountering conflicts during merge:

npm install --package-lock-only

As running that command then suggests, you might also want to consider automating the process by installing npm-merge-driver (npx npm-merge-driver install -g).

Cancel Conflicting Git Merge (--ABORT)


Your keyword here isĀ abort.

git merge --abort

Install version of an NPM module: module-name@1.0.0-alpha


Installing specific version with npm by usingĀ npm install [--save-dev] module-name@1.0.0-alpha

New in JavaScript ES6


ES6 introduces new operators and concepts, like spread operator and Sets.

Introduction to ES6+

Disable autocomplete automatically for all forms in AngularJS


When developing CRMs autocomplete is often useless or altogether detrimental. If you end up having a case where no element will ever need autocomplete, one of the fastest ways to achieve this is hooking an AngularJS directive to the form element:

(function() {
  'use strict';

    .directive('form', htmlFormDirective);

  function htmlFormDirective() {
    return {
      restrict: 'E',
      compile: function(elem, attrs) {
        elem[0].setAttribute('autocomplete', 'off');