Skip to content

Instantly share code, notes, and snippets.

View pgundlach's full-sized avatar
💭
Working on boxes and glue

Patrick Gundlach pgundlach

💭
Working on boxes and glue
View GitHub Profile
@pgundlach
pgundlach / data.xml
Last active September 7, 2020 10:07
Example for table construction
<data>
<entry>E3Q7wpaCuqlEW7IpD5wLZ%EKnL6l6KzJ</entry>
<entry>0wLL7=Y6XKUDw$rS3STaxq6vGnPC,S,s</entry>
<entry>uIB9xFJ7o1c9cpvdW-fuAn8%7V6XjsP5</entry>
<entry>ApBxPOQAeqn1vLBDZgUhsMCa:yoEw3-O</entry>
<entry>XMa0V%Cgp09GLHlGNiby8,2zwHgPqs.r</entry>
<entry>5A;ybcJtNQ.k58Vium=PFdShVJ5X1pg4</entry>
<entry>XFfpSQa2nfVzUgNPwfGDdzu*@6SLAyd3</entry>
<entry>7r@ZQdXckXVzIVTdpg2nEFRJ7h*IZd52</entry>
<entry>GzazyelFpKWU8&amp;79IL.o6k5QS9gq2gVZ</entry>
@pgundlach
pgundlach / rng2adoc.xsl
Created March 22, 2018 12:11
Simple RELAX NG to adoc transformation
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
version="2.0">
<xsl:output method="xml" indent="no" omit-xml-declaration="yes"/>
<xsl:variable name="startxml"><xsl:text>
[source, xml]
-------------------------------------------------------------------------------
@pgundlach
pgundlach / transform-fontawesome.xsl
Created June 27, 2017 19:30
XSL-Transformation of HTML style fontawesome include to a custom tag with code
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all">
<!--
This transformation turns <i class="fa fa-..."></i> into
<fa>&#x...;</fa>
This is useful for the layout files in the speedata Publisher.
https://github.com/speedata/publisher
@pgundlach
pgundlach / main.go
Created September 2, 2016 07:21
Extract the image shape to use with the speedata Publisher
package main
import (
"encoding/xml"
"fmt"
"image"
"image/color"
"log"
"os/exec"

Keybase proof

I hereby claim:

  • I am pgundlach on github.
  • I am patrickgundlach (https://keybase.io/patrickgundlach) on keybase.
  • I have a public key whose fingerprint is 703C 6BE8 A150 11E6 22B4 3BEC 6074 B788 B6D9 6FE5

To claim this, I am signing this object:

@pgundlach
pgundlach / layout.xml
Created March 16, 2015 13:46
Sample for table breaking across positioning areas
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Pagetype name="true" test="true()">
<Margin left="1cm" right="1cm" top="1cm" bottom="1cm"/>
<PositioningArea name="foo">
<PositioningFrame width="5" height="10" row="1" column="1"/>
<PositioningFrame width="5" height="10" row="1" column="7"/>
</PositioningArea>
</Pagetype>
@pgundlach
pgundlach / cksum.go
Last active October 16, 2021 01:57
A simple version of the unix utility "cksum" in Go
package main
import (
"bufio"
"fmt"
"io"
"os"
)
// A simple version of the unix utility "cksum" in Go
@pgundlach
pgundlach / xmlparser.lua
Created April 26, 2012 13:01
XML Parser based on lpeg
-- xml parser
local require,lpeg,io,select,string,type,tonumber,tostring=require,lpeg,io,select,string,type,tonumber,tostring
local w = w
local printtable=printtable
module(...)
bit = require('bit')
local C,P,R,S,V = lpeg.C,lpeg.P,lpeg.R,lpeg.S,lpeg.V
@pgundlach
pgundlach / ltxbarcode.lua
Created March 14, 2012 10:25
Strichcodes mit LuaTeX
module(...,package.seeall)
local add_checksum_if_necessary, mkpattern, split_number, calculate_unit, pattern_to_wd_dp
function generate_barcode(str)
-- Wenn nur 12 Ziffern übergeben werden, fügen wir die 13 hinzu
str = add_checksum_if_necessary(str)
-- Die kleinste Lücke / Strich ist ein siebtel der Breite einer Ziffer und damit
@pgundlach
pgundlach / ltxbarcode.lua
Created December 23, 2011 09:48
barcodes with LuaTeX
module(...,package.seeall)
local add_checksum_if_necessary, mkpattern, split_number, calculate_unit, pattern_to_wd_dp
function generate_barcode( str )
-- If we only pass 12 digits, the 13th will be added
str = add_checksum_if_necessary(str)
-- The smallest bar/gap is 1/7th the width of a digit.