Skip to content

Instantly share code, notes, and snippets.

View ryankshaw's full-sized avatar

Ryan Shaw ryankshaw

  • Instructure
  • Utah
View GitHub Profile
@ryankshaw
ryankshaw / gist:1157812
Created August 19, 2011 19:46
debug markdown
# run this in script/console
include TextHelper
def t(key,default, options={})
I18n.translate(key, default, options)
end
mt 'instructions.syllabus', <<-DOC
The syllabus page shows a table-oriented view of the course schedule, and the basics of
@ryankshaw
ryankshaw / test.js
Created August 23, 2011 22:27
test
function howdy(){
console.log(this, arguments);
}
howdy();
@ryankshaw
ryankshaw / hidden_grades.js
Created September 6, 2011 22:00 — forked from tommetge/hidden_grades.js
hiding grades in canvas
/* Note that this does not disable viewing of grades, it simply
hides them from the students. As such, this is certainly not
bullet-proof: a smart and dedicated person will be able to
expose grades.
Given the above, it is recommended that institutions simply
wait for the official hidden grade functionality in Canvas. */
// this syntax is like $(document).ready but also works if the 'ready' event has already fired
jQuery(function($){
guard 'bundler', :notify => false do
watch('Gemfile')
watch(%r{^vendor/plugins/(.+)Gemfile$})
end
guard 'compass' do
watch(%r{^app/stylesheets/(.*)\.s[ac]ss})
end
guard 'livereload' do
@ryankshaw
ryankshaw / gist:1629863
Created January 17, 2012 23:54
save this as a bookmarklet
javascript:var%20nodes%20=%20window.frames[0].document.querySelectorAll(%27.spec.passed%27);for%20(var%20i=0;%20i%20<%20nodes.length;%20i++)%20{var%20node%20=%20nodes[i];node.parentNode.removeChild(%20node%20);}var%20headers%20=%20window.frames[0].document.querySelectorAll(%27.example_group%27);for%20(var%20i=0;%20i%20<%20headers.length;%20i++)%20{var%20header%20=%20headers[i];if%20(!header.querySelector(%27.failed%27))%20header.parentNode.removeChild(%20header%20);}
@ryankshaw
ryankshaw / gist:1629874
Created January 17, 2012 23:55
this is the raw js
var nodes = window.frames[0].document.querySelectorAll('.spec.passed');
for (var i=0; i < nodes.length; i++) {
var node = nodes[i];
node.parentNode.removeChild( node );
}
var headers = window.frames[0].document.querySelectorAll('.example_group');
for (var i=0; i < headers.length; i++) {
@ryankshaw
ryankshaw / instructurezendesk.js
Created January 20, 2012 17:47
Instructure Zendesk Agent-only mods
previousjQuery = jQuery;
jQuery(function($){
// only run in browsers that can do localStorage (not IE) and only on the tickets page
if ('localStorage' in window && $('body').hasClass('tickets-show')) {
// I want to make sure that this always runs with my version of jquery, not zendesk's
$.getScript('http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js', function(){
jQuery(function($){
function getThisZendeskTicketFromRestApi(callback){
var UrlToThisTicket = window.location.protocol + "//" + window.location.host + window.location.port + window.location.pathname;
errors = []
ErrorReport.find_each(:conditions => "user_id is not null and created_at > '2012-01-24' AND email='[email protected]'") do |report|
if report.comments.present?
puts "resending error report #{report.id}"
report.email = nil
begin
report.send_to_external
rescue Exception => e
puts e.to_json
errors << e
diff --git a/app/coffeescripts/gradebook2/Gradebook.coffee b/app/coffeescripts/gradebook2/Gradebook.coffee
index 1243233..156ce3a 100644
--- a/app/coffeescripts/gradebook2/Gradebook.coffee
+++ b/app/coffeescripts/gradebook2/Gradebook.coffee
@@ -12,7 +12,6 @@ define [
'str/htmlEscape'
'jst/gradebook_uploads_form'
'jst/gradebook2/section_to_show_menu'
- 'jst/gradebook2/column_header'
'jquery.ajaxJSON'
@ryankshaw
ryankshaw / override.js
Created January 25, 2012 17:41
how to override the "file a ticket" link
$('a[href="#create_ticket"]').live('click', function(event){
$(this).parents('.ui-dialog-content').dialog('close');
window.open("http://putYourCustomSupportSiteUrlHere.com");
});