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
@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 / robot.js
Created December 1, 2012 01:19
destroyer convolutos
//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);
@fabiomcosta
fabiomcosta / robot.js
Created November 29, 2012 23:44
Fabio
//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);
//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);
//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);
@fabiomcosta
fabiomcosta / .vimrc
Created June 19, 2012 22:42
Better filetype detection for djangohtml on .html files on VIM. The default one just checks for the existence of `{%\s*\(extends\|block\)` on the first 10 lines, and sometimes, on include files for example, you dont have any of them. Thi
" a better htmldjango detection
augroup filetypedetect
" removes current htmldjango detection located at $VIMRUNTIME/filetype.vim
au! BufNewFile,BufRead *.html
au BufNewFile,BufRead *.html call FThtml()
func! FThtml()
let n = 1
while n < 10 && n < line("$")
if getline(n) =~ '\<DTD\s\+XHTML\s'
@fabiomcosta
fabiomcosta / legendas.tv.js
Created June 4, 2012 05:06
Use dotjs (https://github.com/defunkt/dotjs) to remove the unwanted pop-up before downloading subtitles on legendas.tv - click and download the subtitle right away!
(function () {
var script = document.createElement('script');
script.type = 'text/javascript';
script.onload = ready;
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js';
document.body.appendChild(script);
function ready() {
var $ = jQuery;
@fabiomcosta
fabiomcosta / css-transitionspseudos.js
Created May 16, 2012 23:48
Modernizr feature-detect for css transitions on pseudos elements
// transitions pseudos test.
// check if CSS3 transitions take effect on pseudo elements.
// https://github.com/Modernizr/Modernizr/issues/295
// This test is asynchronous. Watch out.
// without csstransitions this check makes no sense and
// without getComputedStyle we wont be able to get the style from a pseudo element
if (Modernizr.csstransitions && window.getComputedStyle) {
@fabiomcosta
fabiomcosta / phantomjs.rb
Created March 28, 2012 03:15
proposed phantomjs formula
require 'formula'
class NeedsSnowLeopardOrNewer < Requirement
def satisfied?
MacOS.snow_leopard?
end
def message
"phantomjs requires Mac OS X 10.6 (Snow Leopard) or newer."
end
@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