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
var NativeSuperizer = function () {
var method = arguments.callee.caller
this.meta.superizeMethod(method.name)
return this.SUPER.apply(this, arguments)
}
/* SomeClass.js */
Class("SomeClass", {
use : ["jquery.js", "OtherClass"],
after : {
initialize : function() {
new OtherClass();
}
}
methods : {
load : function() {
//load element: new source button
this.newSourceButton = new Interface.Button({buttonValue : "New Source"});
var me = this
this.newSourceButton.load(this.mid1Element, function () { me.onSourceButtonClick.apply(me, arguments })
},
Class('App', {
isa : 'Symbie.Application',
trait : 'JooseX.Class.Singleton',
does : [
'SymbieX.History',
'SymbieX.Tracker.GoogleAnalytics'
],
require('Task/Joose/NodeJS')
use('KiokuJS.Backend.CouchDB', function () {
// class declaration
Class('Person', {
has : {
self : null,
// Lets say we have a replica, already stored in the DB and in the live set (I call it - in the scope):
var rep = {
attrib : 'some_value'
}
// then user mutates it with rep.setAttrib('new_value')
var rep = {
attrib : 'new_value'
calc_hashes : function (strings_array) {
var cont = this.CONT
Joose.A.each(strings_array, function (string) {
cont.AND(function () {
var THROW = this.getTHROW()
var CONTINUE = this.getCONTINUE()
/**
* Module dependencies.
*/
var sys = require('sys')
var puts = sys.puts
var express = require('express'),
connect = require('connect');
Class('Some.Class', {
has : {
attr : {
meta : Vero.Attribute,
is : 'rw'
}
}
Class('My.Attribute', {
meta : Joose.Meta.Class,
isa : Joose.Managed.Attribute,
methods : {
getSetter : function () {
},