Skip to content

Instantly share code, notes, and snippets.

class HelloController
before_filter :find_market
def index
end
private
def find_market
@market = Market.find(params[:id])
end
gem install zeus
zeus start
class NilClass
def strip
to_s.strip
end
end
<div class="products cities-content">
<ul class="unstyled cities-items" style="color:white;">
<% sort_by_sold_out_or_ended(all_products_and_categories.sort_by(&:weighted_position)).each_with_index do|product_or_category, index| %>
<%= render product_or_category %>
<% end %>
</ul>
</div>
@MikeSilvis
MikeSilvis / .gitignore
Created March 11, 2013 17:53
Sharing your project without forcing people to install Crashlytics on their personal computer. Written by @joeymeyer
.crashlytics
class Hash
def compact
delete_if { |k, v| !v }
end
end
class Contact
def self.all
people.collect do |p|
{
title: "#{p.first_name} #{p.last_name}",
action: :open_contact,
image: { image: p.photo }
}
end
{
:person => [
1 => { :name => "Alan", :location => "Washington, DC" },
2 => { :name => "Mike", Location => "Washington, DC"}
]
}
$(window).bind "hashchange", ->
$(".mikes-modal").trigger "close"
$(window).unbind "hashchange"
def make_ids
@make_ids ||= normalize_makes.map { |make| make[:id] }
end