Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Braddock slashinfty

View GitHub Profile
@slashinfty
slashinfty / primetimer.html
Last active Oct 6, 2020
Prime factorization speedrunning timer
View primetimer.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Prime Timer</title>
<style>
@font-face {
font-family: 'Latin Modern Roman';
font-weight: normal;
font-style: normal;
@slashinfty
slashinfty / delta-math-cheats.md
Last active Sep 29, 2020
Getting information out of DeltaMath
View delta-math-cheats.md

Student History on a Skill

Create a bookmark in Chrome, name it what you want, and put the following for the page:

javascript:(function(){const a=[...document.querySelectorAll("tr:not(.flatly-table-header)")];let s="";a.forEach((e,t)=>{let n=e.children,i=n[n.length-1].children,l="";for(let e=0;e<i.length;e++){if(i[e].classList.contains("fa-times"))l+="X";else if(i[e].classList.contains("fa-check"))l+="O";else if(i[e].classList.contains("fa-film"))continue;e+1!=i.length&&(l+=",")}""===l&&(l="none"),s+=n[1].innerText+", "+n[0].innerText+" - "+n[2].innerText+" - Record: "+n[4].innerText+" - History: "+l,t+1!=a.length&&(s+="\n")}),navigator.clipboard.writeText(s).then(()=>alert("Text copied to clipboard!"));})();

When you click it, a list will be copied to your clipboard. Paste it in a document to see the results. It will give you student name, period, record, and history (O means check).

@slashinfty
slashinfty / Meet_Attendance.md
Last active Sep 8, 2020
How to easily take attendance from Google Meets
View Meet_Attendance.md

Google Meet Attendance Made Easier

How are most things made easier? Usually by doing some work ahead of time.

Google Sheets

First thing to do is to have a spreadsheet for attendance. I suggest making a copy of this spreadsheet.

You need to get a list of your students. The easiest way to do this is to go into Canvas gradebook, and select Actions -> Export. It will download a .csv file. In your Google Sheet, select File -> Import, then Upload, and select the file from Canvas. In the resulting dialog, change the first option (Import Location) to Insert New Sheet(s).

In order to get names alphabetized within sections, we have to do a bit of work. Delete the first two rows (they are unnecessary headers) and create a column to the right of student names (names should be in the A column, and the B column should be blank). First, sort by the A column (names), then sort by the F column (sect

@slashinfty
slashinfty / index.js
Created Jul 26, 2020
Mobile Speedrunning Bot
View index.js
//dependencies: discord.js, node-fetch, dotenv
const fs = require('fs');
const Discord = require('discord.js');
const fetch = require('node-fetch');
const path = require('path');
require('dotenv').config();
const client = new Discord.Client();
client.login(process.env.TOKEN);
@slashinfty
slashinfty / .profile
Last active Jul 27, 2020
Verifying runs
View .profile
# must hanve youtube-dl streamlink ffmpeg bc
# these specific commands also have the IBMPlexMono-Regular.ttf text file in the /hdd/verification/ folder
## edit all commands as necessary
alias yt-dl='yt-frames'
# must pass youtube video slug
function yt-frames() {
cd /hdd/verification/
rm -f temp_frames.mp4
@slashinfty
slashinfty / fromSGB-toSGB
Last active Jul 21, 2020
Nightbot commands for SGB time conversion
View fromSGB-toSGB
Suggested command name: !fromSGB
Command:
$(eval const timeToMS=b=>{let c=b.split(":").reverse(),a=1e3*parseFloat(c[0]);return 1<c.length&&(a+=6e4*parseInt(c[1])),2<c.length&&(a+=36e5*parseInt(c[2])),a},msToTime=a=>{let b=Math.floor(a/36e5%24),c=Math.floor(a/6e4%60);c=10<c?c+":":0===c?"":"0"+c+":";let d=Math.floor(a/1e3%60);d=10>d?"0"+d:d;let e=Math.trunc(a%1e3);return b=0===b?"":b+":",e=0==e?"":"."+e,b+c+d+e};msToTime(4295454*timeToMS("$(1)")/4194304);)
To add:
!commands add !fromSGB $(eval const timeToMS=b=>{let c=b.split(":").reverse(),a=1e3*parseFloat(c[0]);return 1<c.length&&(a+=6e4*parseInt(c[1])),2<c.length&&(a+=36e5*parseInt(c[2])),a},msToTime=a=>{let b=Math.floor(a/36e5%24),c=Math.floor(a/6e4%60);c=10<c?c+":":0===c?"":"0"+c+":";let d=Math.floor(a/1e3%60);d=10>d?"0"+d:d;let e=Math.trunc(a%1e3);return b=0===b?"":b+":",e=0==e?"":"."+e,b+c+d+e};msToTime(4295454*timeToMS("$(1)")/4194304);)
To edit:
!commands edit !fromSGB $(eval const timeToMS=b=>{let c=b.split(":").reverse(),a=1e3*parseFloat(c[0]);retu
View board.tex
\documentclass[t]{beamer}
\usepackage[utf8]{inputenc}
\usecolortheme{seahorse}
\usetheme{Rochester}
\usefonttheme{structuresmallcapsserif}
\beamertemplatenavigationsymbolsempty
\begin{document}
\begin{frame}
\frametitle{Monday\,-\,\today}
\begin{columns}
View sml2tiles.lua
local i = 0
local cx = 0
local cy = 0
local p1_cx = 0
local p1_cy = 0
local p2_cx = 0
local p2_cy = 0
local drawn = 0
function drawTile(x, y)
@slashinfty
slashinfty / racetime.js
Last active Jun 1, 2020
Are you in a racetime.gg race? (node.js)
View racetime.js
const fetch = require('node-fetch');
module.exports = {
getLink: async function(client, channel) {
const siteRoot = 'https://racetime.gg';
const raceSearch = await fetch(`${siteRoot}/races/data`);
const races = await raceSearch.json();
if (races.races.length === 0) client.say(channel, 'No active races');
else {
let foundRace = null;
@slashinfty
slashinfty / copy-meet-chat.js
Last active Apr 21, 2020
Get a list of users who have sent a chat message in a Google Meet
View copy-meet-chat.js
// To run (in Chrome):
// MUST HAVE GOOGLE MEET CHAT VISIBLE!
// Press F12 to open Developer Tools
// Click the "Console" tab
// Copy and paste the code below
function copyToClipboard(str) {
var tempInput = document.createElement("input");
tempInput.style = "position: absolute; left: -1000px; top: -1000px";
tempInput.value = str;
You can’t perform that action at this time.