Skip to content

Instantly share code, notes, and snippets.

View letsbreelhere's full-sized avatar

Bree Elle Gardner letsbreelhere

  • Academia, Inc.
  • Oakland, CA
View GitHub Profile
@letsbreelhere
letsbreelhere / pandora.com.js
Created April 7, 2012 22:59
Set pandora title to track info
var changeTitle = function() {
var artistName = $("#trackInfo .artistSummary").text();
var trackTitle = $("#trackInfo .songTitle").text();
$("title").text(trackTitle + " by " + artistName + " - Pandora");
}
changeTitle();
setInterval(changeTitle, 5000);
@letsbreelhere
letsbreelhere / gist:1938271
Created February 29, 2012 05:43
Functional to_hash
def to_hash
@reports.inject({}) do |report_hash, report|
report_hash.merge report.to_hash
end
end
@letsbreelhere
letsbreelhere / gist:1938258
Created February 29, 2012 05:40
Imperative to_hash
def to_hash
hash = {}
@reports.each do |report|
hash.merge! report.to_hash
end
hash
end