Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian bennettscience

View GitHub Profile
@bennettscience
bennettscience / comment.js
Created Dec 31, 2017
Push a comment to a firebase database from a static HTML page
View comment.js
$(function() {
var ref = new Firebase("https://nodes-commenting.firebaseio.com/"),
postRef = ref.child(window.location.pathname);
postRef.on("child_added", function(snapshot) {
var newPost = snapshot.val();
if(newPost.moderated) {
$("#comment-list").prepend('<div class="comment">' +
'<h4>' + escapeHtml(newPost.name) + '</h4>' +
'<div class="profile-image"><img src="http://www.gravatar.com/avatar/' + escapeHtml(newPost.md5Email) + '?s=100&d=retro"/></div> ' +
@bennettscience
bennettscience / onEdit.gs
Last active Sep 30, 2020
Dynamic data validation in Apps Script
View onEdit.gs
function onEdit(e) {
var row = e.range.getRow();
var col = e.range.getColumn();
// If the edited column was 2 or 3, do the next part. Ignore other changes
if(col == 2 || col == 3) {
var value = sheet.getRange(row, col).getValue();
updateList(row,col, value);
}
}
@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 / feedback.gs
Last active Sep 11, 2020
Automating feedback forms with Google Apps Script
View feedback.gs
// Copy this script into the feedback spreadsheet TEMPLATE
/************************ OnOpen *******************************/
function onOpen(e) {
var ui = SpreadsheetApp.getUi().createMenu("Shortlink")
.addItem("Show URL and QR code", "showQrAndLink")
.addToUi()
}
/************************ GLOBALS *******************************/
@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 / code.gs
Created Nov 17, 2017
Auto-tweet images of slides as a Google Slideshow is presented
View code.gs
// The rest of the backend code.
// postTweet.gs and getThumbnails.gs can be appended to this file.
// When combined, click Publish > Deploy as web app
// You can then test by visiting your app page.
var KEY = "YOUR_APP_KEY";
var SECRET = "YOUR_APP_SECRET";
// Initialize Twitter login
// See https://mashe.hawksey.info/2014/10/twtrservice-a-twitter-api-client-for-google-apps-script/
@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 / 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 / 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.

You can’t perform that action at this time.