Skip to content

Instantly share code, notes, and snippets.

View phi-gamma's full-sized avatar
💤
Does nothing unless polled.

Philipp Gesang phi-gamma

💤
Does nothing unless polled.
View GitHub Profile
local traverse_nodes = node.traverse
local iowrite = io.write
local tableconcat = table.concat
local utfchar = unicode.utf8.char
local stringformat = string.format
local stringrep = string.rep
local nodelength = node.length
local count_nodes = node.count
local nodecodes = table.mirrored (node.types())
@phi-gamma
phi-gamma / luatex-0.78.3_prevent-PTEX.FileName.patch
Created February 24, 2014 21:27
Prevent Luatex from writing filesystem location of included PDFs to the document.
Index: source/texk/web2c/luatexdir/image/writeimg.w
===================================================================
diff --git a/trunk/source/texk/web2c/luatexdir/image/writeimg.w b/trunk/source/texk/web2c/luatexdir/image/writeimg.w
--- a/trunk/source/texk/web2c/luatexdir/image/writeimg.w (revision 4837)
+++ b/trunk/source/texk/web2c/luatexdir/image/writeimg.w (working copy)
@@ -693,7 +693,7 @@
// write additional information
snprintf(s, 20, "%s.FileName", pdfkeyprefix);
pdf_add_name(pdf, s);
- pdf_printf(pdf, " (%s)", convertStringToPDFString(p, strlen(p)));
@phi-gamma
phi-gamma / tex
Created May 14, 2014 04:40
pln-cambria.tex
\input luaotfload.sty
\font \cambria = "Cambria"
\font \cambriamath = "Cambria Math"
\cambria foo
\cambriamath bar
\bye
\input luaotfload.sty
\font \foo = file:Iwona-Regular.otf:+smcp;letterspace=1.25 at 42pt
\font \foo = file:MinionPro-Regular.otf:+smcp;letterspace=1.25 at 42pt
\foo It works!
\bye
\input luaotfload.sty
\font \foo = file:Iwona-Regular.otf:+smcp;letterspace=1.25 at 42pt
\foo It works!
\bye
ocamlc -ccopt "-I/usr/lib/ocaml -DZ_OCAML_HASH -DZ_OCAML_COMPARE_EXT -DHAS_GMP -DZ_ELF -DZ_DOT_LABEL_PREFIX -O3 -Wall -Wextra " -c caml_z.c
In file included from /usr/include/stdio.h:33:0,
from caml_z.c:24:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/include/stddef.h:212:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
typedef __SIZE_TYPE__ size_t;
^
In file included from caml_z.c:24:0:
/usr/include/stdio.h:48:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
typedef struct _IO_FILE FILE;
^
\unprotect
\let\@EA\expandafter%% Precaution in case Hans removes it.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% implementation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% We-F¢ll have a minimal setup macro as an interface.
\def\setupsortstructure{%
\dosingleempty\do_setup_sort_structure%
}
@phi-gamma
phi-gamma / whatever.tex
Created May 16, 2012 11:43
flushleft structure numbers
\setuphead [chapter,section] [alternative=leftalignmargin]
\setupmargindata [left] [align=flushleft]
\setuplayout [leftmargin=1cm]
\unprotect
%%% simplified from strc-ren.mkiv
\unexpanded\def\placeheadleftalignmarginalternative#1#2{%
\vbox{%
\localheadsetup\begstrut\dontleavehmode
\ifconditional\headshownumber\inleftmargin{#1}\fi
{#2}%
@phi-gamma
phi-gamma / PKGBUILD
Created May 19, 2012 14:05
PKGBUILD for polipo-git
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.
# See http://wiki.archlinux.org/index.php/VCS_PKGBUILD_Guidelines
# for more information on packaging from GIT sources.
# Maintainer: Your Name <jhernberg@alchemy.lu>
pkgname=polipo-git
@phi-gamma
phi-gamma / structure_images.tex
Created June 7, 2012 13:28
refined structure fullsize image macros
% macros=mkvi
%
% pretty dummy graphics
\useMPlibrary
[dum]
% fake text
\usemodule
[visual]