Move in screen: L
low, M
middle, H
high
{
and }
jump by paragraph
t<char>
— Move forward until the next occurrence of the character.
f
— Move forward over the next occurrence of the character.
<% flash.each do |name, message| %> | |
<%= content_tag("p", message, class: name) %> | |
<% end %> |
$ -> | |
# Handle focus on the Contact Form | |
$('#email').focus -> $(this).val('') if $(this).val() == 'E-mail Address' | |
$('#email').blur -> $(this).val('E-mail Address') if $(this).val() == '' | |
$('#phone').focus -> $(this).val('') if $(this).val() == 'Telephone Number' | |
$('#phone').blur -> $(this).val('Telephone Number') if $(this).val() == '' | |
$('#message').focus -> $(this).val('') if $(this).val() == 'Message' | |
$('#message').blur -> $(this).val('Message') if $(this).val() == '' |
require 'open-uri' | |
require 'net/http'· | |
sourcefile = "http://s3.amazonaws.com/*redacted*/old_site_product_images/product1.jpg" | |
open(sourcefile) do |f| | |
puts File.basename(f) | |
end | |
# outputs: open-uri20120330-58981-1mny2cc |
@mixin rounded($radius) { | |
-webkit-border-radius: $radius; | |
-moz-border-radius: $radius; | |
border-radius: $radius; | |
} | |
div { | |
@include rounded(5px); | |
} |
Product.all.each { |p| p.tire.update_index } |
# Shorthand way of declaring Class/Module methods without having to def self.bar, self.baz, etc. | |
module Foo | |
class << self | |
def bar | |
end | |
def baz | |
end | |
end |
def banner | |
banner_text = "----------\n" | |
banner_text << yield | |
banner_text << "\n----------\n" | |
banner_text | |
end | |
banner_text = banner do | |
"foo" | |
"bar" |