Skip to content

Instantly share code, notes, and snippets.

@pkra
pkra / quickmjpage.js
Last active February 13, 2019 09:11
boiler plate for page processing with mathjax-node
const fs = require('fs');
const mjnode = require('mathjax-node-sre');
const jsdom = require('jsdom');
const { JSDOM } = jsdom;
process.on('unhandledRejection', r => console.log(r));
mjnode.config({
MathJax: {
// your config
}
@pkra
pkra / mj-bookmarklet
Created January 10, 2019 13:24
Bookmarklet for injecting mathjax
javascript:(function(){function%20e(e){var%20i=e.createElement('script'),o;i.src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML-full.js';i.type='text/javascript';o='MathJax.Hub.Config({tex2jax:{inlineMath:[[\'$\',\'$\'],[\'\\\\(\',\'\\\\)\']],displayMath:[[\'\\\\[\',\'\\\\]\']],processEscapes:true}});MathJax.Hub.Startup.onload();';%20i.text=o;e.getElementsByTagName('head')[0].appendChild(i)}function%20t(t){if(t.MathJax===undefined){e(t.document)}else{t.MathJax.Hub.Queue(new%20t.Array('Typeset',t.MathJax.Hub))}}var%20a=document.getElementsByTagName('iframe'),n,i;t(window);for(n=0;n<a.length;n++){i=a[n].contentWindow||a[n].contentDocument;if(!i.document)i=i.parentNode;t(i)}})();
@pkra
pkra / mse-tutorial-plain.html
Last active July 4, 2018 07:15
TeX sample extracted from math.SE tutorial
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Math.SE extracted Samples</title>
</head>
<body>
@pkra
pkra / post.md
Last active June 14, 2018 09:37
draft: A11y und eine kurze Einführung in Numeronyme

layout: post title: | Quick Tip: A11y und eine kurze Einführung in Numeronyme description: Das Numeronym "a11y" steht für "accessibility" author: Scott O'Hara translator: Peter Krautzberger date: 2017-11-27

last_updated:

published: true

@pkra
pkra / test.svg
Last active September 6, 2017 14:04
A test svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pkra
pkra / chromium739221-stroke0.svg
Last active September 6, 2017 08:21
Samples for Chromium bug 739221
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pkra
pkra / sre.js
Created August 25, 2017 13:57
sre, hacked.
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(a){return $jscomp.SYMBOL_PREFIX+(a||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(th
@pkra
pkra / cdnjsredirect.js
Last active April 12, 2017 14:51
cdnjs redirect example
(function () {
var newMathJax = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js';
var oldMathJax = 'https://path.to/MathJax.j';
var n = oldMathJax.length;
var scripts = document.getElementsByTagName('script');
for (var i = 0; i < scripts.length; i++) {
var script = scripts[i];
var src = script.getAttribute('src') || '';
if (src.substr(0, n) === oldMathJax) {
@pkra
pkra / email.svg
Last active September 6, 2017 14:04
An svg to test email delivery
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pkra
pkra / deep_labels.html
Last active March 30, 2017 09:36
Deep Labels, cf. codepen.io/pkra/pen/xRBZjq
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="https://production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" />
<link rel="mask-icon" type="" href="https://production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" />
<title>CodePen - Deep labels</title>