Skip to content

Instantly share code, notes, and snippets.

View canonic-epicure's full-sized avatar
💭
Well-typed API for the world

Nickolay Platonov canonic-epicure

💭
Well-typed API for the world
View GitHub Profile
View gist:227342
Class('Test.Run.Harness.Browser.UI.Viewport', {
xtype : 'my-viewport',
isa : Ext.Viewport,
have : {
title : null,
harness : null
View gist:227345
Ext.ns('Test.Run.Harness.Browser.UI')
Test.Run.Harness.Browser.UI.Viewport = Ext.extend(Ext.Viewport, {
title : null,
harness : null,
initComponent : function () {
View gist:241770
Class('Symbie.Application', {
isa : Ext.util.Observable,
meta : JooseX.Bridge.Ext,
trait : 'JooseX.CPS',
does : [ 'Symbie.ID' ],
View Class methods & Singletons
Class('Name', {
//usual methods
does : {},
has : {}
methods : {},
//class methods/attributes
my : {
does : {},
View gist:299549
Class('Some.Class', {
customBuilder : { <-- info
something here
}
})
View gist:300508
Role('JooseX.Class.Triggered', {
stem : {
have : {
attributesMC : Class({
isa : Joose.Managed.StemElement.Attributes,
propertyMetaClass : Class({
isa : Joose.Managed.Attribute,
does : JooseX.Attribute.Trigger
})
View gist:304824
var x = {}
typeof x == 'Object' //true
x === Object //false
View gist:355591
Module('Some.Module', {
VERSION : 0.01,
use : {
'Some.Another.Module' : 0.01,
'Yet.Another.Module' : 0.03
},
EXPORT : [ 'func1', 'func2' ],
View gist:375198
var a = function (Joose, glob) {
eval("console.log(Joose)")
eval("console.log(glob())")
}
a('KindaJoose', function () { return 'exported glob' })
console.log(window.glob, window.Joose)
View Using Joose in CommonJS modules
// ================================================
// Using Joose in CommonJS modules
var Class = require('Task/Joose/Core').Class
exports.Circle = Class({
has : {
radius : {
is : 'rw',
init : '123'