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
others_string = I18n.t('conversation_message.other_recipients', { | |
:one => "and 1 other", | |
:other => "and %{count} others" | |
}, | |
:count => audience_names.length - 2) |
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
if connection.adapter_name =~ /mysql/i | |
connection.execute <<-SQL | |
UPDATE users, conversation_participants cp | |
SET unread_conversations_count = unread_conversations_count + 1 | |
WHERE users.id = cp.user_id AND #{cp_conditions} | |
SQL | |
else | |
User.update_all 'unread_conversations_count = unread_conversations_count + 1', | |
"id IN (SELECT user_id FROM conversation_participants cp WHERE #{cp_conditions})" | |
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
# @API | |
# Mark a discussion entry as read. | |
# | |
# No request fields are necessary. | |
# | |
# On success, the response will be 204 No Content with an empty body. | |
# | |
# @example_request | |
# | |
# curl 'http://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/entries/<entry_id>/read.json' \ |
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
# remove the timestamp that bip inserts in a backlog message and set the time | |
# of the span element that limechat uses | |
bind 'line', (line) -> | |
# see if out message matches 'hh:mm:ss>' | |
html = line.innerHTML | |
regex = /(\d{2}:\d{2}):\d{2}>/ | |
matches = html.match regex | |
return unless matches | |
# remove that timestamp from the message |
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
select id, avatar_image_url as aiu from users order by aiu; -- works! | |
select id, avatar_image_url as aiu from users order by coalesce(avatar_image_url, 'zzz'); -- works! | |
select id, avatar_image_url as aiu from users order by coalesce(aiu, 'zzz'); -- doesn't work :( |
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
# from app/models/submission.rb | |
# Current version, does not work. | |
[:submission_comments, :visible_submission_comments].each do |method| | |
alias_method "old_#{method}", method | |
instance_eval <<-CODE | |
def #{method}(options = {}) | |
res = old_#{method}(options) | |
res = res.select{|sc| sc.grants_right?(@comment_limiting_user, @comment_limiting_session, :read) } if @comment_limiting_user |
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
<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/VHRKdpR1E6Q?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/VHRKdpR1E6Q?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object> |
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
function measureForTopicList() { | |
windowHeight = $(window).height(); | |
if($after_topic_list.length > 0) { | |
afterTopicListTop = $after_topic_list.offset().top; | |
} else { | |
afterTopicListTop = windowHeight; | |
} | |
} | |
measureForTopicList(); | |
setInterval(measureForTopicList, 2000); |
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
# Invitations | |
'Account User Notification' | |
'Account User Registration' | |
'Collaboration Invitation' | |
'Enrollment Accepted' | |
'Enrollment Invitation' | |
'Enrollment Notification' | |
'Enrollment Registration' | |
'Group Membership Accepted' | |
'Group Membership Rejected' |
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
# remove the timestamp that bip inserts in a backlog message and set the time | |
# of the span element that limechat uses | |
bind 'line', (line) -> | |
# see if out message matches 'hh:mm:ss>' | |
$line = $(line) | |
html = $line.html() | |
regex = /(\d{2}:\d{2}):\d{2}>/ | |
matches = html.match regex | |
return unless matches |
OlderNewer