This file contains 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
const App: () => React$Node = (props) => { | |
const [ players, setPlayers ] = useState([]); | |
useEffect(() => { | |
AsyncStorage.getItem('@maddness_user').then((userData) => { | |
getNearbyPlayers().then(performStompConnect); | |
} | |
}); | |
}, []); |
This file contains 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 Robot(robot) {} | |
Robot.status = 0; | |
Robot.enemy = {}; | |
Robot.enemy.posX; | |
Robot.enemy.posY; | |
Robot.enemy | |
// well, we need to do something... | |
// whenever our robot is idle, this method gets called. | |
Robot.prototype.onIdle = function(ev) { |
This file contains 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
//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.rotateCannon(360); |
This file contains 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
echo 'function isEmpty (o) { for (var i in o) return false; return true } require("testling")(function (t) { t.ok(isEmpty({})); t.ok(!isEmpty({toString:1})); t.end() })' | curl -sSNT- testling.com -u [email protected] |
This file contains 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
/* | |
Copyright (c) 2009 Rob Bast | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without | |
restriction, including without limitation the rights to use, | |
copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software |
This file contains 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 old = Array.from; | |
try { | |
old(document.html.childNodes); | |
} catch(e){ | |
Array.from = function(item, slice){ | |
if (typeOf(item) == 'collection'){ | |
var l = item.length, array = new Array(l - slice), i = slice - 1; | |
while (++i < l) array[i] = item[i]; | |
return array; | |
} |