This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Element.Properties.store = { | |
set: function(props){ | |
for (var p in props) this.store(p, props[p]); | |
return this; | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ar APE_Handler_Base = new Class({ | |
Implements: [APE.Client, Options], | |
options: { | |
userEvents: [], | |
userProps: {} | |
}, | |
initialize: function(core, userClass, options){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEvent('domready', function(){ | |
var client = new APE.Move({'container':$('ape_master_container')}); | |
client.load({ | |
'domain':APE.Config.domain, | |
'server':APE.Config.server, | |
'identifier':'movedemo', | |
'channel':'move', | |
'complete':function(ape){ | |
ape.start([rand_chars()]); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APE.Move = new Class({ | |
Implements: [Options], | |
Extends: APE.UserClient, | |
options: { | |
container: document.body, | |
userEvents: [{cmd: 'send', raw: 'data'}, {cmd: 'setPos', raw: 'positions'}] | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Script: Keyboard.js | |
KeyboardEvents used to intercept events on a class for keyboard and format modifiers in a specific order so as to make | |
alt+shift+c the same as shift+alt+c. | |
License: | |
MIT-style license. | |
Authors: | |
Perrin Westrich |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('./getter').grabInto(['./docs'], GLOBAL); | |
var path = './'; | |
exports.generateDocs = function(out, files, format){ | |
files = (files instanceof Array ? files : [files]); | |
var output = require(format).output; | |
files.forEach(function(file) { | |
out('OUTPUTING ' + file + ' starting\n\n'); | |
require(path + file); | |
getDoced().forEach(function(item) { | |
output(out, item); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
this.Class = function(params){ | |
if (params instanceof Function) params = {initialize: params}; | |
var newClass = function(){ | |
this.Object.reset(this); | |
if (newClass._prototyping) return this; | |
this._current = $empty; | |
var value = (this.initialize) ? this.initialize.apply(this, arguments) : this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var path = require('path'); | |
var sys = require('sys') | |
, limit = 50 | |
, count = 0; | |
function copytree(src, dst) { | |
if(!path.existsSync(src)) { | |
throw new Error(src + ' does not exists. Nothing to be copied'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function.prototype.ac = (function(){ | |
return ac; | |
function ac(len, bind, args){ | |
var func = this | |
, args = args || []; | |
return function internal(){ | |
args = args.concat(Array.prototype.slice.call(arguments)); | |
len -= arguments.length; | |
if (len > 0) return internal; | |
else func.apply(bind, args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def items [:rock :paper :scissors]) | |
(defn winner [m1 m2] | |
(mod (- m1 m2 1) 3)) | |
(defn player-string [name symbol] | |
(str name (nth items symbol) " wins!")) | |
(defn player-wins [m1 m2] | |
(str (nth items m1) " vs. " (nth items m2) " !! " |
OlderNewer