Skip to content

Instantly share code, notes, and snippets.

View fabiomcosta's full-sized avatar
:octocat:
void 0

Fabio M. Costa fabiomcosta

:octocat:
void 0
View GitHub Profile
const App: () => React$Node = (props) => {
const [ players, setPlayers ] = useState([]);
useEffect(() => {
AsyncStorage.getItem('@maddness_user').then((userData) => {
getNearbyPlayers().then(performStompConnect);
}
});
}, []);
@fabiomcosta
fabiomcosta / robot.js
Created December 1, 2012 01:26 — forked from cezarsa/robot.js
Kaiju Banzai
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) {
@fabiomcosta
fabiomcosta / robot.js
Created December 1, 2012 01:21 — forked from mateusdelbianco/robot.js
Staticker
//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);
@fabiomcosta
fabiomcosta / dont enum bug
Created December 20, 2011 00:17
testling isEmpty
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 substack@gmail.com
/*
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
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;
}
/*
* Inspired from http://github.com/jeresig/sizzle/commit/7631f9c3f85e5fa72ac51532399cb593c2cdc71f
* and this http://github.com/jeresig/sizzle/commit/5716360040a440041da19823964f96d025ca734b
* and then http://dev.jquery.com/ticket/4512
*/
Element.implement({
isHidden: function(){
var w = this.offsetWidth, h = this.offsetHeight,