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
Alimentos e Bebidas | |
Arte e Antiguidades | |
Artigos Religiosos | |
Assinaturas e Revistas | |
Automóveis e Veículos | |
Bebês e Cia | |
Blu-Ray | |
Brindes / Materiais Promocionais | |
Brinquedos e Games | |
Casa e Decoração |
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 ExitPageConfirmer(message) { | |
this.message = message; | |
this.needToConfirm = false; | |
var myself = this; | |
window.onbeforeunload = function() { | |
if (myself.needToConfirm) { | |
return myself.message; | |
} |
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
names = ["Akira", "Fernando", "Jose"] | |
names.length # => 3 | |
names.size # => 3 |
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
### Keybase proof | |
I hereby claim: | |
* I am prodis on github. | |
* I am prodis (https://keybase.io/prodis) on keybase. | |
* I have a public key ASBYWVy_Ip4Ln4bB3NQeUXJeiZScRB3HwNvoJh-_bbiT3Ao | |
To claim this, I am signing this object: |
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
even_numbers = {} # Cria um objeto hash vazio | |
even_numbers["zero"] = 0 # Atribui 0 como valor para a chave "zero" | |
even_numbers["two"] = 2 | |
even_numbers["four"] = 4 | |
even_numbers["two"] # Recupera 2 como valor |
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
x = 10 | |
5.times do |x| | |
puts "x inside the block: #{x}" | |
end | |
puts "x outside the block: #{x}" |
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 InitAttributes | |
def self.included(base) | |
base.send(:include, InstanceMethods) | |
base.extend(ClassMethods) | |
end | |
module InstanceMethods | |
def initialize(attributes) | |
init_instance_variables(self.class.accessor_attributes, attributes) | |
init_instance_variables(self.class.reader_attributes, attributes) |
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
<transaction> | |
<id>456</id> | |
<status>Aprovada</status> | |
<order_number>F2457</order_number> | |
<price>33.21</price> | |
<date_transaction>2012-12-13T12:35:30</date_transaction> | |
<date_release></date_release> | |
<payment> | |
<payment_method>Mastercard</payment_method> | |
<date_approval>2012-12-13T12:35:31</date_approval> |
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
# Typically in Rails to use VCR we setup the RSpec config like so: | |
RSpec.configure do |config| | |
config.extend VCR::RSpec::Macros #deprecated | |
end | |
# This gives us access to the use_vcr_cassette method: | |
describe Reviewed::Article do | |
use_vcr_cassette 'article/grill' | |
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
# You didn't write this code | |
class ExternalClass | |
def self.class_number | |
123 # Just to exemplify | |
end | |
def some_number | |
456 # Just to exemplify | |
end | |
end |
NewerOlder