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
# Bundler | |
require "bundler/capistrano" | |
# Pretty colors | |
require 'capistrano_colors' | |
# Assets | |
load 'deploy/assets' | |
# Whenever |
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
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | |
# Uncomment if you are using Rails' asset pipeline | |
# load 'deploy/assets' | |
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } | |
load 'config/deploy' # remove this line to skip loading any of the default tasks |
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
# Bundler | |
require "bundler/capistrano" | |
# Pretty colors | |
require 'capistrano_colors' | |
# Assets | |
load 'deploy/assets' | |
# Whenever |
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
$.fn.allOn = function(onEvent, bindings) { | |
for (var target in bindings) { | |
(function(t) { | |
$(this).on(onEvent, t, function(e) { | |
bindings[t].call(this, e, $(this)); | |
}); | |
})(target); | |
} | |
} |
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
# Ranking algorithm | |
def set_rank | |
find_id = matching_id || id | |
shared_song = Song.find(find_id) if find_id | |
if shared_song | |
favs_count = shared_song.user_broadcasts_count | |
time_created = shared_song.created_at | |
else | |
favs_count = 1 | |
time_created = created_at |
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 Song | |
# Regular expressions | |
RE = { | |
:featured => /(featuring | ?ft\.? |feat\.? |f\. |w\/){1}/i, | |
:remixer => / remix| rmx| edit| bootleg| mix| remake| re-work| rework| extended remix| bootleg remix/i, | |
:mashup_split => / \+ | x | vs\.? /i, | |
:producer => /^(produced by|prod\.? by |prod\. )/i, | |
:cover => / cover/i, | |
:split => /([^,&]+)(& ?([^,&]+)|, ?([^,&]+))*/i, # Splits "one, two & three" | |
:open => /[\(\[\{]/, |
NewerOlder