Skip to content

Instantly share code, notes, and snippets.

View juanmalunatic's full-sized avatar

Juan Manuel Luna López juanmalunatic

View GitHub Profile
@juanmalunatic
juanmalunatic / hide-edx-answers.css
Last active August 20, 2019 12:49
Show edX answers as if they haven't been submitted (useful for studying)
:root {
--border-unans: 1px solid #c8c8c8;
}
/* Inputs */
.correct input,
.incorrect input
{
border: var(--border-unans) !important;
@juanmalunatic
juanmalunatic / edx-mathjax.js
Created August 10, 2020 16:56
Toggle MathJax to copy EdX equations to Anki
// Based on https://github.com/mathjax/mathjax-docs/wiki/Obtaining-the-original-TeX-from-a-rendered-page
function removeTypeset() {
var HTML = MathJax.HTML, jax = MathJax.Hub.getAllJax();
for (var i = 0, m = jax.length; i < m; i++) {
var script = jax[i].SourceElement(), tex = jax[i].originalText;
if (script.type.match(/display/)) {tex = "\\["+tex+"\\]"} else {tex = "\\("+tex+"\\)"}
jax[i].Remove();
var preview = script.previousSibling;
if (preview && preview.className === "MathJax_Preview") {