Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian bennettscience

View GitHub Profile
@bennettscience
bennettscience / fixtures.gs
Last active Feb 24, 2021
A simple Mocking framework in Google Apps Script
View fixtures.gs
/**
* Fixtures provide a conventient way to define expected data strucures from API calls. This
* works based on JSON keys and gives a flexible, namespaced access for quickly making Mocks.
*/
const fixtures = (function() {
const init = function() {
return this;
}
@bennettscience
bennettscience / assignment_rubrics.py
Created Nov 4, 2020
Get outcome results from a rubric on Canvas LMS assignments
View assignment_rubrics.py
"""
This script will fetch Outcome ratings from assignment rubrics and return a list of dicts.
Requires the use of UCF Open's canvasapi library. Install with `pip install canvasapi`.
Replace PROD_URL and PROD_KEY with your own Canvas URL and API key.
"""
from canvasapi import Canvas
from config import PROD_KEY, PROD_URL
from pprint import pprint
def build_assignment_rubric_results(canvas, course_id, assignment_id):
@bennettscience
bennettscience / missing_report.py
Last active May 18, 2020
Generate a report of missing assignments for all students in a Canvas course. Returns a CSV.
View missing_report.py
from canvasapi import Canvas # pip install canvasapi
import csv
import concurrent.futures
from functools import partial
KEY = '' # Your Canvas API key
URL = '' # Your Canvas API URL
COURSE = '' # Your course ID
@bennettscience
bennettscience / update_student_notifications.py
Last active Sep 24, 2020
Update student email notifications as an admin in Canvas LMS
View update_student_notifications.py
import csv
import re
import requests
import concurrent.futures
import time
# pip install tqdm for progress monitoring
from tqdm import tqdm
from functools import partial
"""
@bennettscience
bennettscience / script.gs
Last active Oct 31, 2019
Automatically set a programmatically-created Google Doc to the correct owner.
View script.gs
/*********** SETUP ***************/
// Store two global variables with columns to use as references.
// These should be zero-based because they're used in a loop.
var docIdCol = 0 // Int of col to check for a document ID
var emailCol = 0 // Int of col with submitter email address
/********** END SETUP **************/
@bennettscience
bennettscience / studentOutcomes.user.js
Last active Sep 6, 2019
Collect and display student Outcome score averages in Canvas LMS
View studentOutcomes.user.js
// ==UserScript==
// @name Student LMG Viewer
// @namespace https://gist.github.com/bennettscience/cf6a0ec2526844aa672bd3850dee85ee
// @description Show calculated Outcome socres for students in Canvas
// @author Brian Bennett
// @match https://*.instructure.com/courses/*/grades/*
// ==/UserScript==
(function() {
'use strict';
@bennettscience
bennettscience / TBMod.md
Last active Jun 13, 2019
Tecmo Bowl modding instructions with links
View TBMod.md

Apparently, Tecmo Bowl is one of the most modded games ever. Much of this information is found on the tecmobowl.org forums, along with more software.

  1. Tecmo Bowl Team Manager

Tecmo Bowl is the simplest title. Tecmo Super Bowl got a little more complex, so the editor is more complex. Personally, as I was tinkering, I enjoyed replaying the original vs Tecmo Super Bowl, but that's just me. All things aside, you need an editor.

These programs allow you to load the game file (ROM, see below) and edit team names and rosters through a desktop app. If you're on a Mac and want to run Tecmo Bowl Manager, I can send more detailed instructions, because I got that running as well.

@bennettscience
bennettscience / pity_party_scraper.py
Last active Jul 22, 2019
A script to scrape The Pity Part playlist from WDBM and create a spotify playlist
View pity_party_scraper.py
import re, sys
import requests
import spotipy
import spotipy.util as util
from bs4 import BeautifulSoup
# Get the ID of the track from Spotify
def get_track_id(username, title, artist):
print("Searching for {} by {}".format(title, artist))
scope = 'playlist-modify-public'
@bennettscience
bennettscience / sgstatus.user.js
Last active May 29, 2019
Update the assignment status from the speedgrader in canvas
View sgstatus.user.js
// ==UserScript==
// @name SpeedGrader Status
// @namespace http://tampermonkey.net/
// @version 0.4
// @description Set Canvas Assignment statuses from the SpeedGrader
// @author You
// @include /^https://.*\.instructure\.com/
// @grant none
// ==/UserScript==
@bennettscience
bennettscience / script.py
Created May 10, 2019
Sample script of changing the enrollment statuses with canvasapi
View script.py
from canvasapi import Canvas
# Instantiate the Canvas object
canvas = Canvas("your_url", "your_key")
# Get the course by it's ID
course = canvas.get_course(course_id)
# Get a list of Enrollment items
# Use the 'type' and 'state' kwargs to only get active students