Skip to content

Instantly share code, notes, and snippets.

View AGoblinKing's full-sized avatar
🐢
INFRASTRUCTURE

a Goblin King AGoblinKing

🐢
INFRASTRUCTURE
View GitHub Profile
@AGoblinKing
AGoblinKing / robot.js
Created December 4, 2012 22:56
Destiny Bot
//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.ahead(100);
@AGoblinKing
AGoblinKing / robot.js
Created December 4, 2012 23:16 — forked from cezarsa/robot.js
Destiny Bot
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {
@AGoblinKing
AGoblinKing / gist:5500193
Created May 2, 2013 04:46
Playing with monads
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/three.js/r57/three.min.js"></script>
<script type="text/javascript" src="lib/monad.js"></script>
</head>
<body>
<script type="text/javascript">
var CTX = MONAD(function(monad, value) {
@AGoblinKing
AGoblinKing / gist:5500461
Last active December 16, 2015 21:29
Monad CTX
var CTX = (function() {
'use strict';
function XMONAD(modifier) {
var monad = MONAD(modifier);
monad.properties = function() {
Array.prototype.slice.call(arguments,0).forEach(function(name) {
var upName = name.charAt(0).toUpperCase() + name.slice(1);
var main = MOGUI()
.setSize(110, 500);
main.load(function() {
main
.circleButton(0, 50, "body")
.click(function() {
alert("works")
}).up()
.circleButton(1, 50, "support")
@AGoblinKing
AGoblinKing / gist:5815963
Last active December 18, 2015 17:08
Running multiple caspers...
/*global exports, require*/
(function() {
"use strict";
var casper = require("casper"),
id = 0,
instances = [];
exports.create = function(options) {
define(function (require, exports, module) {
"use strict";
var DocumentManager = brackets.getModule("document/DocumentManager");
brackets.getModule("utils/AppInit").appReady(function () {
var p4 = require("p4");
$(DocumentManager)
.on("dirtyFlagChange", function (e, doc) {
<three-scene>
<three-object id="someCube">
<geometry-cube width="20" height="20 x="1" y="2" z="3"/>
<material>
<texture src="woo.png"/>
</material>
</three-object>
</three-scene>
<polymer-element name="three-object3d" attributes="x y z">
<script>
(function() {
function bindAttrib(from, target, name) {
from[name] && (target[name] = from[name]);
Object.defineProperty(from, name, {
enumerable: true,
set: function(value) {