Skip to content

Instantly share code, notes, and snippets.


Matthew Wildrick Thomas mwt

View GitHub Profile
mwt /
Last active Mar 11, 2021
Jekyll include for utterances

Jekyll include for utterances

This is an include to use utterances comments on any Jekyll static site. It is fully compatible with GitHub Pages.

Basic usage

Add utterances.html to your /_includes folder. Put the following include statement in the part of your layout/page/post/include that you want the comments to be in:

{% include utterances.html %}
mwt /
Created Jan 25, 2021 — forked from davidejones/
aws lambda parsing multipart form with python3
from cgi import FieldStorage
from io import BytesIO
def parse_into_field_storage(fp, ctype, clength):
fs = FieldStorage(
environ={'REQUEST_METHOD': 'POST'},
'content-type': ctype,
mwt / speedgrader.ahk
Last active Mar 22, 2020
An AutoHotkey script to grade assignments in Canvas SpeedGrader quickly using Numpad keys to score the question. For example, Numpad0 gives a score of zero. Make sure NumLock is on! This is intended for use in the grade by question mode. You may need to make adjustments based on browser metrics. Made for Firefox.
View speedgrader.ahk
SetTitleMatchMode, 2
WinActivate SpeedGrader ; Use window with "SpeedGrader" in name
CoordMode, Click, Window
WinGetPos, winX, winY, winWidth, winHeight, A
Y := winHeight * 0.26 ; Get textbox Y coordinate
tX := winWidth * 0.57 ; Get textbox X coordinate
rX := winWidth * 0.95 ; Arbitrary coordinate on right panel
mwt /
Last active Mar 6, 2021
GPU Accelerated Theil-Sen Estimator for Censored Data
## Define Akritas et al T-S estimator
def censoredts(data):
This function takes a three-column cupy array where the first column is the
independent variable, the second is the dependent variable, and the third is
an indicator which tells us if the data has been censored.
# Make an index for pairwise treatment of data
from itertools import combinations
indit = zip(*combinations(range(n),2))
mwt /
Created Jan 16, 2020
Quick guide to GNU screen

Basic usage

Single terminal

To launch screen, just run


Then run all of your commands like stata -b do filename. When you want to "minimize" the terminal, just press Ctrl+A followed by the D key.

You can then safely log out of ssh without killing the precess that you ran.