Skip to content

Instantly share code, notes, and snippets.

Vishal Sakaria vsakaria

Block or report user

Report or block vsakaria

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .gitconfig
[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
View .git-completion.bash
# 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 Aug 21, 2017
Angular 2 Testing RxJS Observable with MockBackend and HTTP
View 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";
View VisuallyHiddenForScreenReaders
.hidden-for-sr {
position: absolute;
overflow: hidden;
clip: rect(0 0 0 0);
height: 1px; width: 1px;
margin: -1px; padding: 0; border: 0;
}
View Angular 2 - Simple Component Example
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 Sep 26, 2016
Work in the CMS using JQuery for display an International Popup warning
View JQuery for displaying an Popup warning based on different data.
var Internationalisation = (function ($) {
var title, ctaText, ctaLink, continuteText, modalHTML, modalText;
var pageMask = $('#page-mask');
var init = function () {
makeRequest();
};
View Angular 2 Testing service examples using 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 Sep 26, 2016
Angular 2 - Component test using TestBed and Fixtures
View 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 {
@vsakaria
vsakaria / DRY this code up using Function.prototype.call
Last active Sep 26, 2016
Demonstrating my understanding of call and apply
View DRY this code up using Function.prototype.call
var ComparisonTable = (function ($) {
var init = function () {
$("td, th").on('mouseenter',function() {
var col = $(this).parent().children().index($(this));
$('.eh-column').each(function () {
$(this).removeClass();
});
$('#column-' col).attr('class', 'column-boarder');
View Preferences.sublime-settings
{
// This is the ruby default
"tab_size": 2,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true,
// This shows all your whitespace, including spaces and tabs
// helps keep code clean and properly indented!
"draw_white_space": "all",
You can’t perform that action at this time.