Skip to content

Instantly share code, notes, and snippets.

View mbakeranalecta's full-sized avatar

Mark Baker mbakeranalecta

View GitHub Profile
@mbakeranalecta
mbakeranalecta / gist:6adaa9b0412185f51930e41b0bd67ca2
Last active March 14, 2017 12:45
SAM comparison to MDITA samples
topic: The point of it all
I can sum it up here
I can say some more stuff
section: Stuff
And so on
@mbakeranalecta
mbakeranalecta / grouping.xsl
Created July 27, 2015 15:11
Complex grouping in XSLT
<?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"
version="2.0">
<xsl:output indent="yes"/>
<xsl:variable name="f">
<x g="green" n="1. Just green"/>
@mbakeranalecta
mbakeranalecta / resolve-defines.py
Created January 27, 2015 21:25
Resolving variables in a text string in Python
self.defines = {'HOME': self.spfe_dirs['home'],
'SPFEOT_HOME': self.spfe_dirs['spfe_ot_home'],
'CONTENT_SET_BUILD_DIR': self.content_set_build_dir,
'CONTENT_SET_OUTPUT_DIR': self.content_set_output_dir,
'CONTENT_SET_BUILD_ROOT_DIR': self.content_set_build_root_dir
}
def _resolve_defines(self, string):
defines_pattern = re.compile('\$\{([^}]*)\}')
resolved = re.sub(defines_pattern, self._replace_defines, string)