Skip to content

Instantly share code, notes, and snippets.

View nsisodiya's full-sized avatar

Narendra Sisodiya nsisodiya

View GitHub Profile
/* Author : Narendra Sisodiya
* Date : Thu Jul 19 18:16:38 IST 2012
* Licence : Public Code
* Purpose : Inheritance
*
* Function.prototype.inheritFrom & NewClass.prototype._super
* It will not work for Manager Class
* Run in Chrome ---
*/
@nsisodiya
nsisodiya / JS-Inheritance.js
Created August 23, 2012 11:18
JavaScript Prototypal Inheritance
/* Author : Narendra Sisodiya
* Date : Thu Jul 19 18:16:38 IST 2012
* Licence : Public Code
* Purpose : Inheritance
* Multilevel JavaScript Prototypal Inheritance
*/
function inherit(Child){
return {
"from": function(Parent){
@nsisodiya
nsisodiya / JS-Inheritance-5.js
Created August 23, 2012 11:49
JavaScript Prototypal Inheritance with Private function and Private-Static properties
/* Author : Narendra Sisodiya
* Date : Thu Jul 19 18:16:38 IST 2012
* Licence : Public Code
* Purpose : Inheritance
* Multilevel JavaScript Prototypal Inheritance
*/
function inherit(Child){
return {
"from": function(Parent){
@nsisodiya
nsisodiya / iframe.js
Last active December 16, 2020 14:45
Dynamic IFRAME Using Dynamic Document Fragment when html & css are provided as Strings
var html = '<h1 class="nar">Narendra</div>';
var css = '.nar { color: red; background: url("http://google.com/images/google_favicon_128.png") repeat scroll 0 0 transparent;}';
var nodeWhereToAppend = document.body;
//var nodeWhereToAppend = document.getElementById("container");
function CreateIframe(html, css, nodeWhereToAppend){
var fragment = document.createDocumentFragment();
var iframe = document.createElement('iframe');
iframe.onload = function(){
var doc = this.contentWindow.document;
@nsisodiya
nsisodiya / color1.scss
Created April 17, 2013 11:18
Manage Theme with SASS
$boxwidth: 300px;
$boxheight: 200px;
$boxbackgroundcolor: #456343;
$whiteFontColor:#E3E1E1;
$bigFontsSize: 30px;
var console = console || {};
console.log = function(msg){
$("body").append('<p>'+msg+'</p>');
};
<button title="Save this File">
{{LanguageService.Data.common.actions.SAVE}}
</button>
@nsisodiya
nsisodiya / gitpush.sh
Created September 4, 2013 08:05
git push your commits , the proper way to do it from branch !
#!/bin/bash
git checkout narendra
echo "On Narendra Branch now"
echo "== Fetch"
git fetch;
echo "== Rebasing now"
git stash && git rebase origin/master && git stash pop
@nsisodiya
nsisodiya / a.js
Created September 4, 2013 09:03
Temp file Compass and SCSS
var resourceFiles = grunt.file.readJSON('src/resource/resource.json');
grunt.initConfig({
concat: {
options: {
separator: ';',
},
js: {
src: resourceFiles.js.dev.map(function(v, i) {
@nsisodiya
nsisodiya / OtherFiles.txt
Created September 18, 2013 09:36
Two Way Data binding using Rivet and Watch.js + Concept of Model Class !!
https://rawgithub.com/mikeric/rivets/master/dist/rivets.min.js
https://rawgithub.com/melanke/Watch.JS/master/src/watch.js
https://rawgithub.com/nsisodiya/watchjs-adapter-for-rivetsjs/master/watchjs-adapter-for-rivetsjs.js
See demo @ http://jsfiddle.net/nsisodiya/y3gDP/3/