Skip to content

Instantly share code, notes, and snippets.

View pvamshi's full-sized avatar

Vamshi Krishna pvamshi

View GitHub Profile
console.log('test');
<b>Hello World</b>
@pvamshi
pvamshi / app.module.ts
Created January 3, 2019 05:59 — forked from mrister/app.module.ts
Global UI error handler
import {BrowserModule} from '@angular/platform-browser';
import {ErrorHandler, NgModule, Injectable} from '@angular/core';
import {AppComponent} from './app.component';
@Injectable()
class UIErrorHandler extends ErrorHandler {
constructor() {
super();
}
handleError(error) {
{
"name": "newtenant",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
(()=>{
let name = 'hello';
let name2 = `hello`;
let x = 0;
console.time('single quote: equals');
for (let i = 0; i < 100000000; i++) {
if (name === 'hello') {
x++;
}
}
var a = 2;
function abc(b) {
var c = 6;
return [function (e) {
var d = 7;
return a + b + c + d + e;
},
function (k) {
c = k;
}
var a = 2;
function abc(b) {
var c = 6;
return function (e) {
var d = 7;
return a + b + c + d + e;
}
}
var f = 3;
var g = 9;
@pvamshi
pvamshi / scope2.js
Created May 3, 2015 17:27
Scope -2
var a = 5;
function abc(){
var b = 6;
function def(){
console.log(b);
console.log(a);
}
def();
}
abc();
@pvamshi
pvamshi / scope1.js
Created May 3, 2015 17:21
Scope - I
var a = 5;
function abc(){
a = 7;
console.log(a);
}
console.log(a);
abc();
console.log(a);
var myAlerts = [];
for (var i = 0; i < 5; i++) {
myAlerts.push(
function inner() {
console.log(i);
}
);
}