Skip to content

Instantly share code, notes, and snippets.


Allen Chang allen

View GitHub Profile
View master.xml
<item id='1'>Fred</item>
<item id='2'>Jane</item>
<item id='3'>Bob</item>
<item id='4'>Mary</item>
<item id='6'>Tom</item>
<entry id='1'>
View master.xml
<?xml version="1.0" encoding="UTF-8"?>
<title>Recurring Exciting Event</title>
View master.xml
<?xml version="1.0" ?>
<item handle="compressors">compressors</item>
<item handle="compressors">compressors</item>
<item handle="complete-plants">complete-plants</item>
<item handle="complete-plants">complete-plants</item>
<item handle="chillers">chillers</item>
<item handle="chillers">chillers</item>
<item handle="chillers">chillers</item>
<item handle="chillers">chillers</item>
View master.xml
<?xml version="1.0" encoding="UTF-8"?>
<section id="20" handle="plant-of-the-month">plant of the month</section>
<entry id="99">
<genus handle="fgfg">fgfg</genus>
<common-name handle="ggfdgb">ggfdgb</common-name>
<latin-name handle="dghgh">dghgh</latin-name>
View master.xml
<sitename>Client - Portfolio</sitename>
<entry id="1" handle="english" lang="en">English</entry>
<entry id="2" handle="francais" lang="fr">Francais</entry>
allen / symphony-2.3-post.markdown
Created May 28, 2012
Symphony 2.3 Release Announcement
View symphony-2.3-post.markdown

Last year, a baker once asked me, "Do you want icing on your cake?" Now, if there is just one thing you need to know about me, it would be that my answer is always, "Yes, ALL the icing." This year, I've gone back to my baker to get a new cake. And before I continue with my fictitious story, yes, I have an appointed baker, like I do with tailors, hairdressors and manicurists. I'm an important man, dammit.

Okay, onwards with my tale: every year, without fail, the baker asks me the same question about cake icing. I don't have to tell you again--unless you have the memory of a goldfish--that it's always an "affirmative" on the icing. All of it.

But this year, I had a new thought. An inception planted by Symphonists inside a dream I was having while dreaming about cake. I didn't just want icing. I wanted a new cake. I always get Black Forest chocolate cake; had it for years. Black Forest is old news, joining among the likes of carrot cakes. Customers can no longer tolerate messy and hard to eat cakes. Kids

allen / enkoder.xsl
Created Jan 16, 2012
XSLT Utility: Enkoder
View enkoder.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:template name="enkoder">
<script type="text/javascript">
<xsl:text disable-output-escaping="yes">&#x0A;//&lt;![CDATA[&#x0A;</xsl:text>
<xsl:text>&#x0A;<![CDATA[var x="function f(x){var i,o=\"\",ol=x.length,l=ol;while(x.charCodeAt(l/13)!" +]]></xsl:text>
<xsl:text>&#x0A;<![CDATA["=48){try{x+=x;l+=l;}catch(e){}}for(i=l-1;i>=0;i=i-1){o+=x.charAt(i);}return o" +]]></xsl:text>
<xsl:text>&#x0A;<![CDATA[".substr(0,ol);}f(\")001,\\\"771\\\\syhb100\\\\_220\\\\000\\\\VUZ620\\\\RZEY" +]]></xsl:text>
allen / html-character-truncate.xsl
Created Feb 17, 2009
Truncates by character limit while gracefully retains HTML elements.
View html-character-truncate.xsl
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:exsl="" extension-element-prefixes="exsl">
Author: Allen Chang
Version: 1.1
Description: Truncates by character limit while gracefully retains HTML
Usage: <xsl:apply-templates select="path/to/your/body" mode="truncate"/>