Skip to content

Instantly share code, notes, and snippets.

💭
Hacking on EN16931-1:2017 based invoices

Patrick Gundlach pgundlach

💭
Hacking on EN16931-1:2017 based invoices
Block or report user

Report or block pgundlach

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pgundlach
pgundlach / rng2adoc.xsl
Created Mar 22, 2018
Simple RELAX NG to adoc transformation
View rng2adoc.xsl
<?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 Jun 27, 2017
XSL-Transformation of HTML style fontawesome include to a custom tag with code
View transform-fontawesome.xsl
<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 Sep 2, 2016
Extract the image shape to use with the speedata Publisher
View main.go
package main
import (
"encoding/xml"
"fmt"
"image"
"image/color"
"log"
"os/exec"
View keybase.md

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 Mar 16, 2015
Sample for table breaking across positioning areas
View layout.xml
<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 Aug 29, 2015
A simple version of the unix utility "cksum" in Go
View cksum.go
package main
import (
"bufio"
"fmt"
"io"
"os"
)
// A simple version of the unix utility "cksum" in Go
@pgundlach
pgundlach / xmlparser.lua
Created Apr 26, 2012
XML Parser based on lpeg
View xmlparser.lua
-- 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 Mar 14, 2012
Strichcodes mit LuaTeX
View ltxbarcode.lua
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 Dec 23, 2011
barcodes with LuaTeX
View ltxbarcode.lua
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.
View sample.tex
\documentclass{article}
\begin{document}
\parindent = 2cm
\setlength{\parfillskip}{0pt plus\dimexpr\textwidth-2\parindent}
A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel.
The charm of existence in this spot, which was created for the bliss of souls like mine.
You can’t perform that action at this time.