Skip to content

Instantly share code, notes, and snippets.

View acbart's full-sized avatar

Austin Cory Bart acbart

View GitHub Profile
@acbart
acbart / guizero_designer.py
Created March 4, 2022 11:52
Example of GUIZero and Designer working together
from guizero import *
from designer import *
# GuiZero stuff
app = App(title="Main window", width=200, height=200)
text_1 = Text(app, text="X", color="red", size=20)
# Designer stuff
frog = emoji("frog")
grow(frog, 5)
@acbart
acbart / latex.ts
Created February 2, 2022 20:26
Sage extension to render LaTeX
import { Message, MessageEmbed } from 'discord.js';
import moment from 'moment';
import fetch from 'node-fetch';
import { Command } from '@lib/types/Command';
export default class extends Command {
description = 'Render some LaTeX as a PNG';
usage = '[latex]';
extendedHelp = 'Type whatever LaTeX you want.';
@acbart
acbart / download_canvas_rubric.js
Created October 11, 2021 02:35
Snippet to download Canvas rubric data for current assignment as a CSV file
(async function(){
// https://stackoverflow.com/questions/8735792/how-to-parse-link-header-from-github-api
const linkParser = (linkHeader)=>{
let re = /,[\s]*<(.*?)>;[\s]*rel="next"/g;
let result = re.exec(linkHeader);
if (result == null) {
return null;
}
return result[1];
@acbart
acbart / job_schedule.py
Created April 19, 2021 18:47
Full Job Scheduling Code
# Python program for weighted job scheduling using Dynamic
# Programming and Binary Search
# Class to represent a job (simple data-only class)
class Job:
def __init__(self, start: int, finish: int, profit: int):
self.start: int = start
self.finish: int = finish
self.profit: int = profit
@acbart
acbart / index.html
Created April 8, 2021 04:19
Ohyay Showcase Buttons
<html>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ohyay.co/js/api.js"></script>
<!-- Jquery -->
<script
@acbart
acbart / basic_example.py
Last active February 14, 2023 19:30
Example Python Code for CISC320
"""
Author: acbart@udel.edu
Updated: 2/4/2021
Description: A sample of taking a filename from stdin, loading it into a string
array, and printing out the first line.
"""
def print_all_lines(lines: list[str]) -> str:
""" Print each line, then return the last one. """
@acbart
acbart / tracing_ifs.py
Created September 30, 2020 20:54
Tracing IF statements
today = "Tuesday"
def is_early(day_of_week: int) -> bool:
return day_of_week < 2
def is_late(day_of_week: int) -> bool:
return day_of_week >= 4
def convert_date(date: str) -> int:
if date.lower() == 'monday':
return 0
@acbart
acbart / structure.md
Last active August 17, 2020 14:36
UD CIS Discord Structure

Top levels:

  • #discord-help
  • #rules
  • #announcements
  • #computer-science
  • #careers
  • #general-coding-help
  • #random
  • #lounge (voice)
@acbart
acbart / gist:a7351b2fb031aece0a378957c6a9cfdf
Last active July 25, 2020 04:40
Half-baked desire for a collaborative real-time group quizzing system
As an instructor, I can ask students one or more questions (i.e., MQ, TF, essays).
Sometimes as individuals and sometimes in pairs or small groups, they arrive at an answer (e.g., voting, google-docs style essay).
Students' answers are recorded and stored in my Learning Management System.
If there's a definitive right answer, I should be able to mark them as correct at that point in time (less important), or just give points for partial credit.
I should be able to conveniently "listen-in" to any group's conversation.
I want to have a clear measure of whether they were making an attempt and interacting.
This would replace not only my Think-Pair-Share, but also the whole "Do this worksheet in small groups" activity.
I'm not opposed to mangling together technologies where it makes sense, but I also don't want to overwhelm students with too many tools.
export default class InteractiveButton extends Phaser.GameObjects.Text {
constructor(scene: Phaser.Scene, x: number, y: number, name: string) {
super(scene, x, y, name, { backgroundColor: '#000', padding:20});
scene.add.existing(this);
this.on('pointerover', () => {this.buttonHover()})
.on('pointerout', () => {this.buttonRest()})
.on('pointerdown', () => {this.buttonDown()})
.on('pointerup', () => {