Skip to content

Instantly share code, notes, and snippets.

Element.Properties.store = {
set: function(props){
for (var p in props) this.store(p, props[p]);
return this;
}
};
ar APE_Handler_Base = new Class({
Implements: [APE.Client, Options],
options: {
userEvents: [],
userProps: {}
},
initialize: function(core, userClass, options){
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()]);
},
APE.Move = new Class({
Implements: [Options],
Extends: APE.UserClient,
options: {
container: document.body,
userEvents: [{cmd: 'send', raw: 'data'}, {cmd: 'setPos', raw: 'positions'}]
},
/*
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
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);
(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;
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');
}
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);
(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) " !! "