Skip to content

Instantly share code, notes, and snippets.

Om Shankar OmShiv

Block or report user

Report or block OmShiv

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
@OmShiv
OmShiv / vm-array-functions-dump.js
Created Dec 28, 2013
Ran a "for ... in " on Array, VM8, Chrome 31.x
View vm-array-functions-dump.js
function (start,length){start=start||0;if(start<0)start=this.length+start;length=length||(this.length-start);var newArray=[];for(var i=0;i<length;i++)newArray[i]=this[start++];return newArray} VM2066:4
function (item){var i=0;var len=this.length;while(i<len){if(this[i]===item){this.splice(i,1);len--}else{i++}}return this} VM2066:4
function (item,from){return this.indexOf(item,from)!=-1} VM2066:4
function (keys){var obj={},length=Math.min(this.length,keys.length);for(var i=0;i<length;i++)obj[keys[i]]=this[i];return obj} VM2066:4
function (array){for(var i=0,j=array.length;i<j;i++)this.push(array[i]);return this} VM2066:4
function (array){for(var i=0,l=array.length;i<l;i++)this.include(array[i]);return this} VM2066:4
function include(object) {
if (Object.isFunction(this.indexOf))
if (this.indexOf(object) != -1) return true;
@OmShiv
OmShiv / components.component-five.js
Created Jun 9, 2018 — forked from neborn/components.component-five.js
Inheritance and Complex Types in Definitions
View components.component-five.js
import ComponentOne from './component-one';
import ComponentA from '../mixins/component-a';
export default ComponentOne.extend(ComponentA, {
type: 'Component Five',
description: 'Extends Component One and includes Component A. Overrides obj in definition.',
obj: {
val: 5
}
});
@OmShiv
OmShiv / components.component-five.js
Created Jun 11, 2018
Ember Components and Mixins data leak fix
View components.component-five.js
import ComponentOne from './component-one';
import ComponentA from '../mixins/component-a';
export default ComponentOne.extend(ComponentA, {
type: 'Component Five',
description: 'Extends Component One and includes Component A. Overrides obj in definition.',
obj: {
val: 5
}
});
@OmShiv
OmShiv / snow.html
Created Dec 24, 2012
Snow animation
View snow.html
<canvas id="canvas"></canvas>
View controllers.application.js
import Ember from 'ember';
import { set } from '@ember/object';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
someObj: { a: 1 },
init() {
this._super(...arguments);
this.someProp = this.someObj;
},
You can’t perform that action at this time.