Skip to content

Instantly share code, notes, and snippets.

@lazybean
lazybean / machine.js
Last active May 12, 2021 09:44
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@lazybean
lazybean / controller.server.js
Created May 22, 2013 15:57
mojit config is 'lost' after a refreshView. mojito create mojit testConfig then modify the following file. The 'foo' property of the config will be lost when you click on the mojit.
/*jslint anon:true, sloppy:true, nomen:true*/
YUI.add('clickMojit', function(Y, NAME) {
/**
* The clickMojit module.
*
* @module clickMojit
*/
/**
@lazybean
lazybean / robot.js
Created December 6, 2012 13:57
dodobot
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.turn(10);