Skip to content

Instantly share code, notes, and snippets.

View ShivrajRath's full-sized avatar

Shivraj Rath ShivrajRath

View GitHub Profile
@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);
@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 / 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 / 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 / FlatUI.md
Created July 16, 2014 08:50
Flat UI resources and examples
@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 / 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 / argumentsAsArray.js
Last active August 29, 2015 14:13
Curious case of JavaScript function arguments
/**
* Running the array reverse function on arguments object
*/
function reverseArgs(){
return Array.prototype.reverse.call(arguments);
}
reverseArgs(12,34,55);
// OUTPUT
// [55, 34, 12]
@ShivrajRath
ShivrajRath / codeInMarkdown.md
Last active August 29, 2015 14:23
Code in Markdown
(function(){
  var message = 'Hello Javascript';
  console.log(message);
})();
{
    "11": {
 "value": [3, 6, 8],
@ShivrajRath
ShivrajRath / clone.js
Last active August 29, 2015 14:23
Object Cloning
/**
* Clones an object and retains the prototype chain
* @param {Object} fromObj Object to be cloned
* @returns {Object} Cloned Object
*/
function cloneObj(fromObj) {
var toObj, i;
if (fromObj && typeof fromObj === 'object') {