Skip to content

Instantly share code, notes, and snippets.

View gokulkrishh's full-sized avatar

Gokulakrishnan Kalaikovan gokulkrishh

View GitHub Profile
{
"always_show_minimap_viewport": true,
"auto_complete": true,
"bold_folder_labels": false,
"caret_extra_width": 2,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"folder_exclude_patterns":
[
".svn",
".git",
@gokulkrishh
gokulkrishh / serviceWorker.js
Created November 18, 2016 03:01
Lifecycle of service worker
//First, check if service worker is supported or not
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("./serviceWorker.js", {scope: "./"}) //Passing serviceWorker file and scope
.then(function (event) {
console.log("Service Worker is registered ", event);
})
.catch(function (error) {
console.error("Service Worker is failed to register ", error);
});
}
@gokulkrishh
gokulkrishh / gh-pages-deploy.md
Created February 6, 2017 10:01 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@gokulkrishh
gokulkrishh / pull_format.md
Last active September 27, 2017 09:15
Pull request format

Done:

In Progress:

Browser Tested:

@gokulkrishh
gokulkrishh / basicServiceWorker.js
Created January 14, 2016 03:57 — forked from adactio/basicServiceWorker.js
A basic Service Worker, for use on, say, a blog.
'use strict';
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
(function() {
// Update 'version' if you need to refresh the cache
var staticCacheName = 'static';
var version = 'v1::';
@gokulkrishh
gokulkrishh / Singly Linked List.js
Created February 27, 2016 04:25
Implementation of linked list in javascript
function singlyLinkedList() {
this.length = 0; //Default value
this.head = null;
}
//To store in a new node
function storeNode(data) {
this.data = data;
this.next = null;
};

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@gokulkrishh
gokulkrishh / Sublime Settings - User
Last active July 19, 2018 11:52
Sublime Settings
{
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme",
"disable_formatted_linebreak": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
"node_modules",
@gokulkrishh
gokulkrishh / index.html
Created April 9, 2015 11:58
Simple Inheritance in JS // source http://jsbin.com/botoqozude
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Simple Inheritance in JS</title>
</head>
<body>
<script id="jsbin-javascript">
//Class A
#GOKULKRISHH
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
#WORK
Host github.com
HostName github.com
User git