Skip to content

Instantly share code, notes, and snippets.

View robert-carroll's full-sized avatar

Robert Carroll robert-carroll

View GitHub Profile
var addMenuButton = function(title, url, img) {
var id_title = 'global_nav_custom_' + title.replace(/\s/, '_').toLowerCase();
var button = $('<li class="custom-menu ic-app-header__menu-list-item" id="'+id_title+'_menu">' +
'<a id="'+id_title+'" href="'+url+'" class="ic-app-header__menu-list-link">' +
'<div class="menu-item-icon-container" aria-hidden="true"><span class="menu-item__badge" style="display: none">'+title+'</span><span class="svg-holder"></span></div>' +
'<div class="menu-item__text">' + title + '</div>' +
'</a>' +
'</li>');
@robert-carroll
robert-carroll / courselinks-termsort.js
Last active September 28, 2018 14:13
course links with term select sort
@robert-carroll
robert-carroll / parse-events.rb
Last active October 3, 2018 22:50
live events ims format to flat
# https://github.com/instructure/canvas-lms/blob/master/lib/canvas/live_events.rb#L19
# https://canvas.instructure.com/doc/api/file.live_events.html
# this file parses the JSON data
# making best attempts to map JSON data to documented fields
class ParseEvents
# mimic this, https://github.com/instructure/switchman/blob/master/app/models/switchman/shard_internal.rb
def local_id(any_id)
any_id.to_i % 10_000_000_000_000
@robert-carroll
robert-carroll / assignment-groups.sql
Created August 2, 2018 17:04
canvas-data/mssql - assignment groups of master courses
SELECT
canvas_course_id,
course_name,
ISNULL(formative,0) formative,
ISNULL(summative,0) summative,
ISNULL(other,0) other
FROM (
SELECT
canvas_course_id,
course_name,
@robert-carroll
robert-carroll / icon-bank.svg
Last active July 10, 2018 20:09
inst-ui-icon-bank-svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/**
// @name Global Nav - Custom Tray
// @namespace https://github.com/robert-carroll/ccsd-canvas
// @author Robert Carroll <carror@nv.ccsd.net>
//
// Pin by [Gregor Cresnar](https://thenounproject.com/grega.cresnar/) from [The Noun Project]
// https://creativecommons.org/licenses/by/3.0/
**/
$(document).ready(function() {
///* set tray title, icon, links and footer here *///