Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View matt-bernhardt's full-sized avatar
💭
Learning Rails...

Matthew Bernhardt matt-bernhardt

💭
Learning Rails...
View GitHub Profile
@-moz-document url-prefix("https://mit.primo.exlibrisgroup.com/discovery/search?vid=01MIT_INST:MIT&lang=en") {
/* Insert code here... */
body {
font-size: 16px;
}
div.header {
border-top: 2rem solid white;
}
.__xl div.header {
border-top-color: red;
@matt-bernhardt
matt-bernhardt / big-decision.md
Last active September 21, 2023 17:23
Mermaid and accessibility

This is a demonstration Mermaid diagram which implements a description tag. Does the VoiceOver screenreader find it?

graph LR;
      accTitle: Big Decisions;
      accDescr: This is the description for this Mermaid diagram. The diagram depicts the Bob's Burgers process for making big decisions;
      A[Identify Big Descision] --> B{Make Big Decision};
      B --> D[Be done];

If you are hearing this text, then you have left the diagram, and should have already heard the description contents.

@matt-bernhardt
matt-bernhardt / 1_theory_of_search.md
Created September 6, 2023 15:03
Mermaid diagrams describing some search architectures
---
title: Theory of search
---
flowchart
  direction LR
  Capture --> Interpret
  Interpret --> Match
  Match --> Rank
 Rank --> Present
@matt-bernhardt
matt-bernhardt / yellow-machine-46ccee.lua
Created December 28, 2022 15:26
A patched version of the Yellowscribe LUA script
-- Bundled by luabundle {"rootModuleName":"Yellow Machine.46ccee.lua","version":"1.6.0"}
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
local loadingPlaceholder = {[{}] = true}
local register
local modules = {}
local require
local loaded = {}
.wpcf7 fieldset{margin-top:1.5rem;margin-bottom:1.5rem;border:1px solid #ccc;padding:1rem 1.5rem;width:75%}.wpcf7 .wpcf7-text,.wpcf7 .wpcf7-email,.wpcf7 .wpcf7-textarea{background-color:#fff;color:#000;font-size:14px}.wpcf7 .wpcf7-submit{-webkit-appearance:none;transition:background-color 0.25s, border 0.25s;border:1px solid #338bc5;border-radius:3px;padding:5px 10px;background-color:#338bc5;background-image:none;font-size:1rem;color:#fff;margin-top:10px}.wpcf7 legend{padding:0 1rem;font-size:0.9rem;color:#595959;text-transform:uppercase;width:auto}.wpcf7 .button-primary.green,.wpcf7 .wrap-outer-header-local .green.action-auth{border:1px solid #3b815d;background-color:#43926a;margin:0;max-width:15rem}.wpcf7 .button-primary.green:focus,.wpcf7 .wrap-outer-header-local .green.action-auth:focus,.wpcf7 .button-primary.green:hover,.wpcf7 .wrap-outer-header-local .green.action-auth:hover{background-color:#2ea76a;border-color:#43926a}.wpcf7 .wpcf7-list-item{display:block}.loading-container{display:block;width:100%;he
@matt-bernhardt
matt-bernhardt / year-over-year-ppg.csv
Created February 29, 2020 21:43
A dataset of MLS team performance (measured by Points Per Game) from year to year between 1996 and 2019. Brief context at https://twitter.com/bernhardtsoccer/status/1233859569983639552
ID Team Year1 Pts1 GP1 PPG1 Playoffs1 Playoffs1Int Year2 Pts2 GP2 PPG2 Playoffs2 Playoffs2Int
1 Colorado Rapids 1996 29 32 0.9063 Did Not Qualify 0 1997 38 32 1.1875 Finalist 4
2 Columbus Crew 1996 37 32 1.1563 Quarterfinalist 2 1997 39 32 1.2188 Semifinalist 3
3 D.C. United 1996 46 32 1.4375 Champion 5 1997 55 32 1.7188 Champion 5
4 FC Dallas 1996 41 32 1.2813 Quarterfinalist 2 1997 42 32 1.3125 Semifinalist 3
5 Los Angeles Galaxy 1996 49 32 1.5313 Finalist 4 1997 44 32 1.375 Quarterfinalist 2
6 New England Revolution 1996 33 32 1.0313 Did Not Qualify 0 1997 37 32 1.1563 Quarterfinalist 2
7 New York Red Bulls 1996 39 32 1.2188 Quarterfinalist 2 1997 35 32 1.0938 Did Not Qualify 0
8 San Jose Earthquakes 1996 39 32 1.2188 Quarterfinalist 2 1997 30 32 0.9375 Did Not Qualify 0
9 Sporting Kansas City 1996 41 32 1.2813 Semifinalist 3 1997 49 32 1.5313 Quarterfinalist 2
@matt-bernhardt
matt-bernhardt / 4lda-notes-only.py
Last active December 18, 2019 17:17
2019 Learning Days - attempting a rudimentary Recommender System with ASpace data
from __future__ import absolute_import
import csv
from time import time
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction import text
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import LatentDirichletAllocation
# This attempts to perform LDA on the text of the notes from ArchivesSpace.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@matt-bernhardt
matt-bernhardt / mitlib-content-model.php
Created January 28, 2019 19:59
Snippet to establish a WordPress custom post type in vanilla PHP
<?php
/**
* Plugin Name: MITlib Content Model
*
* @package mitlib-content-model
* @version 0.0.1
*/
/**
* Register content types