Skip to content

Instantly share code, notes, and snippets.

#-sinatra server
# -spotify module
# -spotify gem
# -attributes and methods: search, play
# -playlister object
# -include/extend spotify module
# -creates song objects from the spotify search data
# -methods: sort, list,
def test(cat)
cat.map(&:name)
end
fav_cat_names.map do |name|
break if name == "Johnny Cochran"
name
end
chosen_names = []
fav_cat_names.each do |name|
break if name == "Johnny Cochran"
chosen_names << name
end
chosen_names
def return_nokogiri_table_rows(noko_obj)
noko_obj.xpath('/html/body/table/tbody/tr/td/table[3]/tbody/tr[4]/td[2]/table/tbody/tr/td')
end
def return_nokogiri_table_rows(noko_obj)
noko_obj.xpath('/html/body/table/tr/td/table[3]/tr[4]/td[2]/table/tr/td')
end
puts noko_obj.to_html['tbody']
#=> nil
module SlimySlug
extend ActiveSupport::Concern
included do
before_save :set_slug
end
def set_slug
self.slug = self.name.downcase.gsub('.','').gsub(' ','-')
end
module SlimySlug
extend ActiveSupport::Concern
included do
before_save :set_slug
has_many :actions
has_many :lobbyists, through: :actions
has_many :clients, through: :actions
end
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/eojssfq/QG5m6cm3z/embedgist.js"></script>