Skip to content

Instantly share code, notes, and snippets.

View hafeez-syed's full-sized avatar
:octocat:
dont stop learning

Hafeez Syed hafeez-syed

:octocat:
dont stop learning
  • Melbourne, Australia
View GitHub Profile
@hafeez-syed
hafeez-syed / NVM - Node LTS
Last active October 22, 2019 11:01
Install Node LTS via NVM and move global packages along
1. # LIST node versions remote
```
$ nvm ls-remote
```
2a. # OPTION1 - INSTALL new version of node via NVM
```
$ nvm install v1.1.1
```
@hafeez-syed
hafeez-syed / typescript-user-settings
Created May 29, 2017 14:20
Typescript user settings
{
"typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib",
//"editor.fontFamily": "Roboto Mono",
"editor.fontSize": 16,
"editor.quickSuggestions": true,
"editor.parameterHints": true,
"editor.wordBasedSuggestions": true,
"editor.selectionHighlight": false,
"editor.suggestOnTriggerCharacters": true,
Edit '/etc/sysconfig/jenkins' and add 'prefix=/jenkins' to 'JENKINS_ARGS'
**************************************************************************
JENKINS_ARGS="--prefix=/jenkins"
Comment out the default server config in '/etc/nginx/nginx.conf'
and create following file
'/etc/nginx/conf.d/domain.conf'
*************************************************
{
/*
* Possible values:
* - the name of a built-in config
* - the name of an NPM module which has a "main" file that exports a config object
* - a relative path to a JSON file
*/
"extends": "tslint:latest",
"rules": {
"class-name": true,
var phonePattern = /^(\+61|0061|0)[1|2|3|7|8]|1[3|8](\d{8})$/;
var mobilePattern = /^(\+61|0061|0)[4](\d{8})$/;
var regex1 = /(\+61+\s+[4]+\s)((\d{4})+\s+(\d{4}))/; // +61 4 0000 0000
var regex2 = /(\+61+\s+[4]+(\d{2})+\s)((\d{3})+\s+(\d{3}))/; // +61 400 000 000
var regex3 = /(0061+\s+[4]+\s)((\d{4})+\s+(\d{4}))/; // 0061 4 0000 0000
var regex4 = /(\+61+\s+[4]+(\d{2})+\s)((\d{3})+\s+(\d{3}))/; // 0061 400 000 000
var regex5 = /(04+\s)((\d{4})+\s+(\d{4}))/; // 04 0000 0000
'use strict';
function Person(first_name, last_name) {
this.first_name = first_name;
this.last_name = last_name;
};
Person.prototype.full_name = function() {
return this.first_name + ' ' + this.last_name;
};
"use strict";
var animal = {
kind: 'human'
};
console.log(animal);
var hafeez = {};
/**
*********************************
*********************************
*********************************
module exports
*********************************
*********************************
*********************************
*/
function strictPerson() {
'use strict';
console.log(this); // undefined
}
strictPerson();
function linientPerson() {
console.log(this); // window
}
linientPerson();
console.log(this); // window (global scope)
console.log('\n\n ****************************** \n\n');
this.hafeez = 'Hafeez Syed'; // `this.hafeez` will be `window.hafeez` because this -> window
console.log(this.hafeez); // Hafeez Syed
console.log(window.hafeez); // Hafeez Syed
console.log(hafeez); // Hafeez Syed