Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Lin kevinlin1

View GitHub Profile
@kevinlin1
kevinlin1 / autocaption.js
Last active Mar 28, 2022
Caption your speech on any website using the Web Speech API
View autocaption.js
javascript:(() => {
div = document.createElement('div');
div.style.backgroundColor = 'rgba(0,0,0,0.75)';
div.style.bottom = '5%';
div.style.left = '10%';
div.style.maxWidth = '80%';
div.style.position = 'fixed';
div.style.zIndex = '10000';
let caption, timeoutID;
@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
"""
@kevinlin1
kevinlin1 / .block
Last active May 17, 2021
k-d Tree Visualization
View .block
license: cc-by-4.0
height: 500
scrolling: no
border: no
View minerals.txt
Abelsonite
Abenakiite
Abernathyite
Abhurite
Abramovite
Abswurmbachite
Acanthite
Achavalite
Actinolite
Acuminite