This file contains hidden or 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
| // fill in the video ID here | |
| $video_id = ''; | |
| $info_url = 'http://www.youtube.com/get_video_info?video_id=' . $video_id; | |
| $info_page = file_get_contents($info_url); | |
| // put query strings into local scope | |
| parse_str($info_page); | |
| // parse fmt_stream_map |
This file contains hidden or 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 ApplicationController < ActionController::Base | |
| protect_from_forgery | |
| rescue_from CanCan::AccessDenied do |exception| | |
| if user_signed_in? | |
| flash[:error] = I18n.t('auth.message.access_denied') | |
| session[:user_return_to] = nil | |
| redirect_to dashboard_path | |
| else | |
| flash[:error] = I18n.t('auth.message.admin_login_required') |
This file contains hidden or 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 Ability | |
| include CanCan::Ability | |
| def initialize(user) | |
| user ||= User.new | |
| p user | |
| if user.admin? | |
| can :manage, :all |
This file contains hidden or 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
| App.Track = DS.Model.extend({ | |
| uri: DS.attr('string') | |
| }) | |
| App.LikedTracksRoute = Ember.Route.extend({ | |
| model: function() { | |
| return this.store.find('track', { filter: 'user_only', limit: 30 }) | |
| } | |
| }) |