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
$("form").submit(function() { | |
if($.browser.msie){ | |
alert("Você foi desqualificado"); | |
return false; | |
} | |
} |
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
require 'net/http' | |
module Net | |
class HTTP | |
def self.enable_debug! | |
# raise "You don't want to do this in anything but development mode!" unless Rails.env == 'development' | |
class << self | |
alias_method :__new__, :new | |
def new(*args, &blk) | |
instance = __new__(*args, &blk) | |
instance.set_debug_output($stderr) |
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
module Enumerable | |
def sum | |
self.inject(:+) | |
end | |
def mean | |
self.sum/self.length.to_f | |
end |
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
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist |
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
a = [6, 2, 8, 4, 7] | |
# 2 numeros corretos, 1 na posição certa | |
b = [0, 5, 9, 4, 7] | |
# 2 números corretos, mas na posição errada | |
c = [1, 3, 0, 8, 7] | |
# 1 número correto na posição correta | |
d = [9, 7, 6, 3, 2] |