Skip to content

Instantly share code, notes, and snippets.

set nocompatible
syntax on
set nu ts=2 sw=2 bs=2 hidden
set hlsearch incsearch expandtab
set mouse=a
filetype indent on
call pathogen#infect()
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
function randomMove(robot) {
var move = (Math.random()*10).toFixed() > 5 ?
"ahead" : "back";
robot.turn(90);
@dudadornelles
dudadornelles / robot.js
Created December 6, 2012 04:44 — forked from marano/robot.js
Shrimp Hunter
var RobotState = function () {
data = {};
data.isLookingAtTarget = false;
return data;
};
var goodRobot = RobotState();
var evilRobot = RobotState();
@dudadornelles
dudadornelles / robot.js
Created December 6, 2012 04:44 — forked from marano/robot.js
Shrimp Hunter
var RobotState = function () {
data = {};
data.isLookingAtTarget = false;
return data;
};
var goodRobot = RobotState();
var evilRobot = RobotState();
var pessoa = function (nome, sobrenome) {
var obj = {};
obj.getNome = function () {
return nome;
};
obj.getSobrenome = function () {
return sobrenome;
Exception happened during processing of request from ('127.0.0.1', 60431)
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 593, in process_request_thread
self.finish_request(request, client_address)
File "/Users/ddornell/Work/pixelated/pixelated-user-agent/service/.virtualenv/lib/python2.7/site-packages/protobuf.socketrpc-1.3.2-py2.7.egg/protobuf/socketrpc/server.py", line 243, in finish_request
request, client_address, self, self.socket_rpc_server)
File "/Users/ddornell/Work/pixelated/pixelated-user-agent/service/.virtualenv/lib/python2.7/site-packages/protobuf.socketrpc-1.3.2-py2.7.egg/protobuf/socketrpc/server.py", line 83, in __init__
self, request, client_address, server)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 649, in __init__
self.handle()
@dudadornelles
dudadornelles / gitr
Last active December 5, 2016 23:28
gitr - run git on all subdirs that are git repos
#!/bin/bash
GREEN='\033[0;32m'
NC='\033[0m'
function git_execute_r {
for dir in `ls -l1d */.git`; do
pushd `dirname $dir` >/dev/null
printf "${GREEN} :: @ `pwd`\n${NC}"
git $@
popd >/dev/null
@dudadornelles
dudadornelles / resolvedVersionOf
Last active December 30, 2017 16:50
Gradle - get resolved version of a dependency
def getResolvedVersionOf(dependency) {
return configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.asList().collectAll { e ->
if (e.moduleName == dependency) {
return e
}
}[0].moduleVersion
}
@dudadornelles
dudadornelles / gist:c3b2cd216af221204756aefbf9117b69
Last active September 20, 2018 12:33
Improves spacing an the FIFA 19 webapp. Create a bookmark and put this code as the url, then run it once you've opened the webapp
javascript:(function(){
setInterval(function(){
document.getElementsByClassName('view-root')[0].style['height'] = '100%';
document.getElementById('FIFAHeader').style['display'] = 'none';
document.querySelector('.layout-hub') && (document.querySelector('.layout-hub').style['padding']=0);
document.querySelector('.ut-content') && (document.querySelector('.ut-content').style['border']='1px')
&& (document.querySelector('.ut-content').style['max-height'] = '100%')
&& (document.querySelector('.ut-content').style['max-width'] = '90%');
document.querySelector('#ut-search-wrapper .ut-content-container') && (document.querySelector('#ut-search-wrapper .ut-content-container').style['padding'] = '0px')
},200)
#!/bin/bash
GH_API=https://api.github.com
gh_get() {
curl \
-H "Accept: application/vnd.github+json" -H "Authorization: token $GITHUB_ACCESS_TOKEN" \
$1
}