1 + 1
2 * 2
5 / 3
5 % 3
5 ** 2
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
#outer { | |
width: 500px; | |
} | |
#outer:hover #text { | |
-webkit-transition: left linear .5s; | |
position: absolute; | |
left: 100px; | |
} |
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
p { | |
background-color: red; | |
} |
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
# do .. end when we're only interested on the side effect | |
array.each do |item| | |
puts item | |
end | |
# { } when we want the result of the evaluation | |
array.map { |item| | |
item + 1 |
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
irb(main):013:0> blog = Blog.new | |
=> #<Blog id: nil, title: nil, created_at: nil, updated_at: nil> | |
irb(main):014:0> blog.save | |
(0.2ms) BEGIN | |
SQL (0.4ms) INSERT INTO `blogs` (`created_at`, `title`, `updated_at`) VALUES ('2012-04-13 00:56:01', NULL, '2012-04-13 00:56:01') | |
(19.5ms) COMMIT | |
=> true | |
irb(main):015:0> post = blog.posts.new | |
=> #<Post id: nil, blog_id: 2, created_at: nil, updated_at: nil> | |
irb(main):016:0> post.save |
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
class Password < ActiveRecord::Base | |
belongs_to :user | |
scope :current, where(:changed_at => nil) | |
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
class Password < ActiveRecord::Base | |
belongs_to :user | |
scope :current, where(:changed_at => nil) | |
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
flores in /Users/flores/Code/sum/sum/mdown-erlang with 1.9.3-p125 on (master *) | |
% erl | |
Erlang R15B (erts-5.9) [source] [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false] | |
Eshell V5.9 (abort with ^G) | |
1> c(markdown). | |
{ok,markdown} | |
2> markdown:to_html(<<"# OK #">>). | |
"<h1>OK</h1>\n" | |
3> markdown:to_html(<<"# OK #\n * OK">>). |
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
pt-BR: | |
simple_form: | |
"yes": 'Sim' | |
"no": 'Não' | |
required: | |
text: 'obrigatório' | |
mark: '*' | |
# You can uncomment the line below if you need to overwrite the whole required html. | |
# When using html, text and mark won't be used. | |
# html: '<abbr title="required">*</abbr>' |
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
case my_var | |
when String then puts "It is a string" | |
when Integer then puts "It is an integer" | |
else puts "It is another thing" | |
end | |
#instead of | |
case my_var.class | |
when String then puts "It is a string" | |
when Integer then puts "It is an integer" |