Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Lin kevinlin1

View GitHub Profile
View zoom-groups.py
#!/usr/bin/env python3
from canvasapi import Canvas
import os
if __name__ == "__main__":
canvas = Canvas("https://canvas.uw.edu", os.getenv("TOKEN"))
course = canvas.get_course(os.getenv("COURSE_ID"))
groups = course.get_groups()
View gitlab-groups.py
#!/usr/bin/env python3
from canvasapi import Canvas
import os
if __name__ == "__main__":
canvas = Canvas("https://canvas.uw.edu", os.getenv("TOKEN"))
course = canvas.get_course(os.getenv("COURSE_ID"))
groups = course.get_groups()
@kevinlin1
kevinlin1 / autocaption.js
Last active Jan 23, 2023
Caption your speech on any website using the Web Speech API. Supports all browsers except for Firefox. To start captioning speech, add this script as a bookmarklet (paste contents in the URL field) and run the bookmark. To stop captioning speech, click the caption box.
View autocaption.js
javascript:(() => {
const div = document.createElement('div');
div.style.alignItems = 'flex-end';
div.style.backgroundColor = 'black';
div.style.bottom = '0';
div.style.color = 'white';
div.style.display = 'none';
div.style.fontFamily = '-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif';
div.style.fontSize = '3vh';
div.style.maxHeight = '7vh';
@kevinlin1
kevinlin1 / canvas_lesson_sync.ipynb
Last active Mar 15, 2022
Synchronize Canvas assignments with Ed Lesson completions.
View canvas_lesson_sync.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kevinlin1
kevinlin1 / canvas_assessment_sync.ipynb
Last active May 31, 2021
Synchronize Canvas outcomes (learning mastery gradebook) with Ed code challenge grading criteria.
View canvas_assessment_sync.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kevinlin1
kevinlin1 / SET.java
Last active Mar 19, 2022
Send file contents to Python Tutor's Java 8 visualizer: node visualize.js [code file] [stdin file]
View SET.java
class SET<Key extends Comparable<Key>> implements Iterable<Key> {
ST<Key, Boolean> map = new ST<>();
void add(Key key) {
map.put(key, true);
}
boolean contains(Key key) {
return map.contains(key);
}
View completions.py
import aiohttp
import asyncio
import io
import pandas as pd
lessons = [
# Ed Lesson IDs
]
token = "" # Ed login token
@kevinlin1
kevinlin1 / StringIsEqualIgnoringLineOrder.java
Last active May 2, 2020
Hamcrest matcher that checks if the string is as expected, ignoring line order.
View StringIsEqualIgnoringLineOrder.java
import java.util.Arrays;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
public class StringIsEqualIgnoringLineOrder extends TypeSafeMatcher<String> {
private final String expected;
private final String[] expectedLines;
@kevinlin1
kevinlin1 / README.md
Last active Nov 6, 2019
Get MapBox Tiles for {Bear,Husky,*}Maps
View README.md

server/scripts

The data for HuskyMaps consists of two parts: the osm data and the tileset.

OSM Data

The OpenStreetMap data is generated via the BBBike extraction service which uses the osmconvert tool to reduce a massive planet.osm file to a local region.

@kevinlin1
kevinlin1 / game.py
Last active Apr 28, 2019
SemEval command-line game
View game.py
#!/bin/env python3
"""
Play the STS sentiment evaluation game! Test your ability to predict the gold
standard label for the TSV containing gold labels and sentence pairs.
Try loading the question-question set from SemEval Semantic Textual Similarity.
https://github.com/brmson/dataset-sts
"""