{
"id" : (integer, read only),
"lid" : (string, read only),
"custom_id" : (string, optional),
"state" : (string, optional),
"trusted_platforms" : (array of integers, optional),
"restricted_encrypted" : (boolean, optional),
"trusted_only" : (boolean, optional),
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
require "test/unit" | |
class Module | |
alias_method :old_private, :private | |
def private(*args) | |
old_private(*args) | |
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
Handlebars.template = function(templateString) { | |
return function () { | |
if (arguments.length < 1) { | |
// With no arguments, return the raw template -- useful for rendering | |
// partials. | |
return templateString; | |
} else { | |
Handlebars.templates = Handlebars.templates || {} | |
Handlebars.templates[templateString] = Handlebars.templates[templateString] || Handlebars.compile(templateString); | |
return Handlebars.templates[templateString](arguments[0], arguments[1]); |
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
[{"id":3106,"name":"Instrumentals","children":[{"id":22511,"name":"Indie - Upbeat"},{"id":22556,"name":"Pop"},{"id":22600,"name":"Electro Lounge"},{"id":22651,"name":"Hip Hop"},{"id":22689,"name":"Hard Rock"},{"id":22736,"name":"Rock - Drums"},{"id":22766,"name":"Muted Guitar"},{"id":22796,"name":"Emotional Rock"},{"id":22844,"name":"Rock - Techno"},{"id":22904,"name":"Indie Rock"},{"id":23041,"name":"Dance Club"},{"id":23323,"name":"Film/TV - World"},{"id":23661,"name":"Film/TV - Whimsical/Quirky"},{"id":23748,"name":"Film/TV - Suspense"},{"id":23968,"name":"Rock & Roll"},{"id":24571,"name":"Film/TV - Percussion"},{"id":24830,"name":"Groove"},{"id":25159,"name":"Electronica"},{"id":25240,"name":"Film/TV - Dramatic"},{"id":25392,"name":"Ambient"},{"id":25683,"name":"Film/TV - Action"}],"tracks":[]},{"id":3107,"name":"Bands","children":[{"id":22514,"name":"Pearl Django"}],"tracks":[]},{"id":3108,"name":"Risk Film","children":[{"id":22520,"name":"Tension tones/uplifting"},{"id":22536,"name":"Tension tones/Erie" |
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
renderClassesEditor: -> | |
raw = $(".courses input:b(values)").val() | |
raw = "[]" if _.isBlank raw | |
@enrolledCourses = JSON.parse raw | |
raw = $(".courses input:b(available)").val() | |
raw = "[]" if _.isBlank raw | |
@availableCourses = JSON.parse raw |
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
# Our app is a backbone.js app, so no 'normal' page loads. | |
class App.Actions | |
# Our version of identify to deal with logged in vs anonymous users. | |
identify: (options = {}) => | |
callback = options.callback | |
delete options.callback |
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
identify: (options = {}) => | |
callback = options.callback | |
delete options.callback | |
attrs = _.extend options, "Account": App.name | |
if App.params.utm_campaign | |
attrs["Campaign Type"] = App.params.utm_medium | |
attrs["Campaign"] = App.params.utm_campaign |
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
%button { | |
color: red; | |
font-size: 14px; | |
} | |
%button-big { | |
font-size: 18px; | |
} | |
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 artist_stats ids | |
Artist.find(ids).each do |artist| | |
puts artist.name | |
tracks = artist.tracks.active | |
puts "tracks : #{tracks.count}" | |
puts "streams : #{tracks.map {|t| Track.hits[t.id]}.sum}" | |
downloads = Filing.joins(:folder).where("filings.track_id in (?) and folders.name = 'Downloads'", tracks.map(&:id)).count | |
puts "downloads : #{downloads}" |
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 from_rack(env_hash) | |
req = ::Rack::Request.new(env_hash) | |
self.url = req.scheme && req.url.split('?').first | |
self.method = req.request_method | |
self.query_string = req.query_string | |
self.data = read_data_from(req) | |
self.headers = format_headers_for_sentry(env_hash) | |
self.env = format_env_for_sentry(env_hash) |
OlderNewer