Skip to content

Instantly share code, notes, and snippets.

;;; djot.el -*- lexical-binding: t -*-
;; Copyright (C) 2024 John MacFarlane
;; Author: John MacFarlane <jgm@berkeley.edu>
;; Keywords: lisp djot
;; Version 0.0.1
;;; Commentary:
@jgm
jgm / undergradmath.html
Created June 2, 2023 19:46
Pandoc conversion of undergradmath.typ
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang xml:lang>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>undergradmath</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
@jgm
jgm / pandoc-compilation-phases.md
Created October 1, 2018 23:30
Summary of compilation output with -ddump-timings and -dshow-passes
Phase alloc time
Desugar [Paths_pandoc] 640032 1.119
Simplifier [Paths_pandoc] 12926056 17.214
Specialise [Paths_pandoc] 230440 0.160
Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = False}) [Paths_pandoc] 1233960 0.774
Simplifier [Paths_pandoc] 4764776 4.480
Simplifier [Paths_pandoc] 3155904 2.865
Simplifier [Paths_pandoc] 1244384 1.230
Float inwards [Paths_pandoc] 4224 0.007
@jgm
jgm / my.html
Created December 10, 2017 19:58
Highlighted code spacing/collapsing issue
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>Untitled</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
@jgm
jgm / scanners.c
Created November 16, 2014 23:04
scanners.c generated on osx by re2c 0.13.6
/* Generated by re2c 0.13.6 on Sun Nov 16 15:04:02 2014 */
#include <stdlib.h>
#include "chunk.h"
#include "scanners.h"
int _scan_at(int (*scanner)(const unsigned char *), chunk *c, int offset)
{
int res;
unsigned char *ptr = (unsigned char *)c->data;
unsigned char lim = ptr[c->len];
@jgm
jgm / tricky
Created October 19, 2014 04:12
Tricky Markdown parsing case
*a
**a
*a
**a
*a
**a
*a
**a
*a
**a
@jgm
jgm / tricky
Created September 17, 2014 16:00
Recursively nested strong/emph
*a
**a
*a
**a
*a
**a
*a
**a
*a
**a
@jgm
jgm / letter.latex
Created January 12, 2014 18:06
pandoc letter template
\documentclass[letter,$if(fontsize)$$fontsize$,$else$10pt,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$]{ucbletter}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage{amssymb,amsmath}
\linespread{$if(linespread)$$linespread$$else$1.1$endif$}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=1024" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>impress.js | presentation tool based on the power of CSS3 transforms and transitions in modern browsers | by Bartek Szopka @bartaz</title>
<meta name="description" content="impress.js is a presentation tool based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com." />
@jgm
jgm / gist:5268542
Created March 29, 2013 03:17
Haddock documentation from Pipes/Proxy/Tutorial.hs in pipes package
{- $intro
The @pipes@ library replaces lazy 'IO' with a safe, elegant, and
theoretically principled alternative. Use this library if you:
* want to write high-performance streaming programs,
* believe that lazy 'IO' was a bad idea,
* enjoy composing modular and reusable components, or