Skip to content

Instantly share code, notes, and snippets.

View moduscreate's full-sized avatar

Modus Create moduscreate

View GitHub Profile
@moduscreate
moduscreate / gist:1126280
Created August 4, 2011 21:05
Override Ext jS 4.0 form panel
Ext.override(Ext.form.Panel, {
loadRecord: function(rec) {
this.callOverridden(arguments);
this.fireEvent('load', this, rec);
}
});
Ext.ns('IbwUi.controls');
IbwUi.controls.ComboBoxJSON = Ext.extend(Ext.form.ComboBox, {
url: '',
root: '',
valueField: 'id',
displayField: 'name',
listWidth: 200,
width: 200,
Ext.define('MyApp.MainContainer', {
extend : 'Ext.Container',
requires : [
'MyApp.PersonList',
'MyApp.PersonDetail'
],
config : {
layout : {
type : 'hbox',
align : 'stretch'
Ext.define('MyApp.PersonDetail', {
extend : 'Ext.form.Panel',
xtype : 'persondetail',
config : {
items: [
{
xtype : 'toolbar',
title : 'Person Details',
docked : 'top'
},
Ext.define('MyApp.PersonDetail', {
extend : 'Ext.form.Panel',
xtype : 'persondetail',
config : {
items: [
{
xtype : 'fieldset',
items : [
{
label : 'First',
Ext.setup({
onReady : function() {
var instance = Ext.create('MyModel', {
id : 'test'
});
console.log('onReady model instance', instance);
}
});
@moduscreate
moduscreate / gist:2001549
Created March 8, 2012 15:39
Rvrsit simple AI
nextMove : function() {
var me = this,
app = Rvrsit.app,
currentTurn = me.turn,
computerColor = me.computerColor,
nextMoves = me.findNextMoves(currentTurn),
nextMoveIndex = -1,
numVisibleChips = Object.keys(me.visChips).length,
nextMove;
@moduscreate
moduscreate / gist:2287453
Created April 2, 2012 21:44
HTML5-iOS/ImpactJS Sound Effect sprite (Prototype)
var SoundSprite = function(src, schedule) {
var me = this;
me.src = src;
me.schedule = schedule;
me.init();
};
SoundSprite.prototype = {
currentIndex : 0,
console = require('console');
v8 = require('builtin/v8');
var test = function() {
console.log('test executed');
return new Date().getTime();
}
__code = 'test();';
{
"meta" : {
"limit" : 20,
"next" : null,
"offset" : 0,
"previous" : null,
"total_count" : 16
},
"objects" : [
{