- The letter X
- The letter Y
- The letter Z
- Roman numerals
- The number 7
- A Yellow flower
- A Purple flower
- A Red flower
- An Orange flower
- Something shiny
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
// ---- | |
// Sass (v3.4.7) | |
// Compass (v1.0.1) | |
// ---- | |
.selector | |
@media screen and (min-width: 1024px) | |
&.-of-5 | |
width: 20% | |
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
def validator_relevant?(validator) | |
return true unless validator.options.key?(:if) || validator.options.key?(:unless) | |
conditional = validator.options.key?(:if) ? validator.options[:if] : validator.options[:unless] | |
result = if conditional.respond_to?(:call) | |
object.instance_exec(&conditional) | |
elsif conditional.is_a?(::Symbol) && object.respond_to?(conditional) | |
object.send(conditional) | |
else | |
conditional |
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 NonActiveRecordModel | |
def initialize(relation) | |
@relation = relation | |
end | |
def do_stuff | |
@relation.some_association.where(...) | |
end | |
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
function s() | |
{ | |
# Look for a .env file, run foreman with -p 3000 for consistency | |
if [ -e ".env" ] | |
then | |
foreman start -p 3000 | |
# Look for "script/rails" (Rails 3) | |
elif [ -e "script/rails" ] | |
then | |
script/rails server |
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
@import "twitter/bootstrap"; | |
.whatever { | |
@extend .well; | |
} |
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
[alias] | |
current-branch = !git branch | grep '^*' | sed s/\\*\\ // | |
track = !git branch --set-upstream $(git current-branch) origin/$(git current-branch) | |
publish = !git push origin $(git current-branch) && echo $(git track) | |
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
# Expected h1 title for posts#show is "My Blog :: My Post Title" | |
# -------------------------------------------------------------- | |
# This was how it worked with `layout nil` in the controller | |
# | |
# posts_controller.rb | |
class PostsController | |
layout nil |
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
.something { | |
rules for older browsers like IE6–8 | |
} | |
.something:not(.crappy) { | |
extra rules for any browser that supports :not selector | |
the .crappy class is a hack, but it feels appropriate | |
} |
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
# PRODUCT MODEL | |
has_many :product_people | |
has_many :people, :through => :product_people | |
accepts_nested_attributes_for :people | |
<%= f.inputs "Cast" do %> | |
<%= f.inputs :for => :people do |p| %> | |
<%= p.input :name %> | |
<%= p.input :_destroy, :as => :boolean %> |
NewerOlder