Skip to content

Instantly share code, notes, and snippets.

View ShivrajRath's full-sized avatar

Shivraj Rath ShivrajRath

View GitHub Profile
@ShivrajRath
ShivrajRath / arrayIterator.js
Created January 14, 2015 20:10
Array Iterator in Javascript
/*************************************************************
* Adds iterator to javascript Arrays
*************************************************************/
/**
* Returns previous element in the iteration
* @return {[object]} [Returns null if iteration has not started or if limit has reached]
*/
Array.prototype.prev = function(){
if(isNaN(this.index) || this.index <=0){
@ShivrajRath
ShivrajRath / quickcssreference.md
Last active August 29, 2015 14:04
Quick CSS Reference

CSS Concepts

 ### Box Model
      * http://www.w3schools.com/css/css_boxmodel.asp
 ### Positioning of CSS:
      * http://www.barelyfitz.com/screencast/html-training/css/positioning/
 ### Display of CSS
      * http://quirksmode.org/css/css2/display.html
 ### Overflow
      * http://css-tricks.com/the-css-overflow-property/

Z-Index

@ShivrajRath
ShivrajRath / FlatUI.md
Created July 16, 2014 08:50
Flat UI resources and examples
@ShivrajRath
ShivrajRath / ng-localstorageService.js
Created July 16, 2014 02:52
An angular service to do basic local storage operations
angular.module('service', []).service('localstorageservice', [
function() {
/**
* This module contains all library function for localstorage usage
*/
this.methods = {
/**
* Checks if localstorage is supported on the current browser
*/
@ShivrajRath
ShivrajRath / LocalStorageEvent.js
Last active August 29, 2015 14:03
'Storage' Event on localstorage
/**
* This is called when setItem(), removeItem(), or clear() changes something on localstorage
* This event not triggered for the tab/window where the event is initiated. It is triggered in other tabs
*/
localStorage.setItem('locKey', '1');
var fn = function (event) {
if (event.key == 'locKey') {
console.log("Old Value : " + event.oldValue);
console.log("New Value : " + event.newValue);
@ShivrajRath
ShivrajRath / spacing.css
Last active August 29, 2015 14:03
Common Classes Used for margin and padding
/*
////////////////////////////////////////////
============================
Spacing Adjusting Classes:
===========================*/
/*margin-top 0-50*/
.mt0 {margin-top: 0;}
@ShivrajRath
ShivrajRath / fullscreen-blur-background-image.css
Last active April 9, 2017 17:47
Full screen blurred background in CSS
.cls{
position: fixed;
top: 0;
right: 0;
bottom: 0;
background-image: url("home.jpg");
min-width: 100%;
min-height: 100%;
-webkit-filter: blur(18px);
-o-filter: blur(18px);
/**
* Workaround to make defining and retrieving angular modules easier and more intuitive.
*/
(function(angular) {
var origMethod = angular.module;
var alreadyRegistered = {};
/**
@ShivrajRath
ShivrajRath / gist:adcadbc091097c85d7c1
Last active August 29, 2015 14:02
HTTP Status Codes
var httpStatusCode = {
"100": "Continue",
"101": "SwitchingProtocols",
"102": "Processing",
"200": "OK",
"201": "Created",
"202": "Accepted",
"203": "Non-AuthoritativeInformation",
"204": "NoContent",
"205": "ResetContent",
@ShivrajRath
ShivrajRath / handlebarutilities.js
Created April 21, 2014 23:00
Handlebar Utilities
/**
* Returns a template object from an external template file
* @param {[string]} templateURL [URL from the workspace from where the template file has to be read]
* @return {[string]} [Returns the template file content]
*/
function readTemplate(templateURL) {
if ( !! templateURL) {
var templateFile;
var templateAjax;