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
| #starting at line 243 | |
| def feeds_into_timescales(feeds) | |
| # convert timescale (minutes) into seconds | |
| seconds = params[:timescale].to_i * 60 | |
| # get floored time ranges | |
| logger.info "Original Start time is " + feeds.first.created_at.to_s | |
| logger.info "Original End time is " + feeds.last.created_at.to_s | |
| start_time = get_floored_time(feeds.first.created_at, seconds) | |
| end_time = get_floored_time(feeds.last.created_at, seconds) | |
| logger.info "start_time = " + start_time.to_s + " & end_time is " + end_time.to_s |
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
| <h1>MenuItems#index</h1> | |
| <style> | |
| .column { width: 170px; float: left; padding-bottom: 100px; } | |
| .portlet { margin: 0 1em 1em 0; } | |
| .portlet-header { margin: 0.3em; padding-bottom: 4px; padding-left: 0.2em; } | |
| .portlet-header .ui-icon { float: right; } | |
| .portlet-content { padding: 0.4em; } | |
| .ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important; } |
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
| # check that user is logged in | |
| def require_user | |
| if current_user.nil? | |
| session[:link_back] = request.url | |
| redirect_to login_path | |
| false | |
| end | |
| end |
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
| # check that user is logged in | |
| def require_user | |
| logger.info "Require User" | |
| if current_user.nil? | |
| session[:link_back] = request.url | |
| redirect_to login_path | |
| false | |
| end | |
| end | |
| def require_user_no_linkback |
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
| <div id="channel_info"> | |
| <div style="clear:both"/> | |
| <div id="dialog0" class="column" > </div> | |
| <div id="dialog1" class="column" > </div> | |
| </div> | |
| <div style="clear:both"></div> |
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
| def update | |
| @channel = Channel.find(params[:channel_id]) | |
| @status = 0 | |
| # check permissions | |
| if @channel.user_id == current_user.id | |
| # save data | |
| @channel.options1 = params[:options] | |
| logger.debug "Channel changes " + @channel.changes.to_s | |
| if @channel.save |
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
| Started GET "/plugins/1" for 127.0.0.1 at 2012-07-27 08:12:13 -0400 | |
| Processing by PluginsController#show as HTML | |
| Parameters: {"id"=>"1"} | |
| Plugin Load (0.1ms) SELECT `plugins`.* FROM `plugins` WHERE `plugins`.`id` = 1 LIMIT 1 | |
| Rendered plugins/show.html.erb (0.3ms) | |
| Completed 200 OK in 110ms (Views: 2.2ms | ActiveRecord: 0.1ms) | |
| Private User |
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 Plugin < ActiveRecord::Base | |
| belongs_to :user | |
| has_one :plugin_window_detail, :dependent => :delete | |
| def private? | |
| private_flag? | |
| end | |
| end |
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
| def update | |
| @channel = current_user.channels.find(params[:id]) | |
| # make sure channel isn't social | |
| #render :text => '' and return if @channel.social | |
| if params["channel"]["video_type"].blank? && !params["channel"]["video_id"].blank? | |
| @channel.errors.add(:base, t(:channel_video_type_blank)) | |
| end | |
| if @channel.errors.count <= 0 | |
| puts "########## Params #{params.inspect}" | |
| @channel.save_tags(params[:tags][:name]) |
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
| $ ./redis-cli | |
| redis> set x 10 | |
| OK | |
| redis> config set maxmemory 200 | |
| OK | |
| redis> set y 20 | |
| (error) ERR command not allowed when used memory > 'maxmemory' | |
| redis> config set maxmemory 0 | |
| OK | |
| redis> set y 20 |