Skip to content

Instantly share code, notes, and snippets.

View helderdarocha's full-sized avatar

Helder da Rocha helderdarocha

View GitHub Profile
<!-- Highlight syntax for Mou.app, insert at the bottom of the markdown document -->
<script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>
<link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/github.min.css">
<script>
hljs.initHighlightingOnLoad();
</script>
@helderdarocha
helderdarocha / SAX XML Schema processing
Created February 3, 2014 20:24
Example processing a simple XML schema in SAX and generating a tree
public class SAXReaderExample {
public static final String PATH = "/tmp/resources";
public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader reader = sp.getXMLReader();
reader.setContentHandler(new SchemaSaxHandler());
reader.parse(new InputSource(new FileInputStream(new File(PATH, "source.xsd"))));
<query_results>
<row id="1">
<distance>.1..</distance>
<post_title>.1..</post_title>
<post_excerpt>..1.</post_excerpt>
<ID>.1..</ID>
</row>
<row id="2">
<distance>.2..</distance>
<post_title>..2.</post_title>
@helderdarocha
helderdarocha / example.svg
Last active August 29, 2015 14:00
SVG example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<!-- Prints the root node and selects all descendant nodes -->
<xsl:template match="/">
<xsl:text>/</xsl:text>
<xsl:apply-templates select="descendant::node()" mode="print-path"/>
</xsl:template>
@helderdarocha
helderdarocha / AnimatedLoaderComp.svg
Created May 9, 2016 16:11
SVG Loader Example 1 (using SMIL animations)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@helderdarocha
helderdarocha / .block
Last active May 15, 2016 14:57
Animated loader example 2
license: cc-by-sa-4.0
@helderdarocha
helderdarocha / .block
Last active May 30, 2016 02:30
Worlds larger than the moon of Makemake
scroll: yes
license: cc-by-sa-4.0
@helderdarocha
helderdarocha / README.md
Last active May 12, 2016 23:24
Main asteroid belt (SVG animation)