Skip to content

Instantly share code, notes, and snippets.

import * as React from 'react';
interface IAddressDetails {
address1: string;
address2: string;
address3: string;
city: string;
postcode: string;
country: string;
id: number;
{
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true,
"prettier.eslintIntegration": true,
"autoimport.filesToScan": "**/*.{ts,tsx}",
"tslint.enable": true,
"tslint.autoFixOnSave": true,
"typescript.updateImportsOnFileMove.enabled": "always",
"window.zoomLevel": 0,
"editor.rulers": [120],
[user]
name = Vishal Sakaria
email = vsakaria@gmail.com
[credential]
helper = osxkeychain
[color]
ui = true
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
@vsakaria
vsakaria / Angular 2 - Testing RxJS Observable with MockBackend and HTTP
Last active August 21, 2017 15:22
Angular 2 Testing RxJS Observable with MockBackend and HTTP
import { async, inject, TestBed } from "@angular/core/testing";
import { Http, HttpModule, BaseRequestOptions, RequestMethod, Response, ResponseOptions } from "@angular/http";
import { MockBackend } from "@angular/http/testing";
import { Observable } from "rxjs";
import { MockSessionService } from "../../mocks/session.service.mock";
import { QMSService } from "./qms.service";
import { SessionService } from "../session/session.service";
.hidden-for-sr {
position: absolute;
overflow: hidden;
clip: rect(0 0 0 0);
height: 1px; width: 1px;
margin: -1px; padding: 0; border: 0;
}
import { Component, Input, OnInit} from "@angular/core";
import { TooltipService } from "./tooltip.service";
import { Sanitizer } from "../../../utils/eh.sanitizer.util.service";
import { SafeHtml } from "@angular/platform-browser";
@Component({
selector: "tooltip",
templateUrl: "./tooltip.component.html",
styles: [`
@vsakaria
vsakaria / JQuery for displaying an Popup warning based on different data.
Last active September 26, 2016 14:39
Work in the CMS using JQuery for display an International Popup warning
var Internationalisation = (function ($) {
var title, ctaText, ctaLink, continuteText, modalHTML, modalText;
var pageMask = $('#page-mask');
var init = function () {
makeRequest();
};
@vsakaria
vsakaria / Angular 2 Testing service examples using TestBed
Last active September 26, 2016 14:38
Examples of using Angular 2 TestBed
import { inject, TestBed } from "@angular/core/testing";
import { SessionService } from "./session.service";
describe("SessionService", () => {
let sessionService: SessionService;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [SessionService]
@vsakaria
vsakaria / Angular 2 - Component test using TestBed and Fixtures
Last active September 26, 2016 14:38
Angular 2 - Component test using TestBed and Fixtures
import { async, TestBed, fakeAsync, tick } from "@angular/core/testing";
import { Observable } from "rxjs";
import { TooltipComponent } from "./tooltip.component";
import { TooltipService } from "./tooltip.service";
import { Sanitizer } from "../../../utils/eh.sanitizer.util.service";
class MockToolTipService {