Skip to content

Instantly share code, notes, and snippets.

/env/
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match='/'>
<xsl:text>Hello world!</xsl:text>
</xsl:template>
</xsl:stylesheet>
@Klortho
Klortho / .alias-completion.sh
Last active March 4, 2016 19:21
Automatically add completion functions for aliases
# Automatically add completion for all aliases to commands having completion functions
# This should be sourced at the end of your .bashrc
# This is from this answer on Super User: http://superuser.com/posts/437508/revisions,
# saved to this gist: https://gist.github.com/Klortho/38b306f5dcc484b31393
function alias_completion {
local namespace="alias_completion"
# parse function based completion definitions, where capture group 2 => function and 3 => trigger
local compl_regex='complete( +[^ ]+)* -F ([^ ]+) ("[^"]+"|[^ ]+)'
@Klortho
Klortho / A-iso-8859.json
Last active February 26, 2016 20:39
Python requests, json, and encoding
<date date-type='original'
specific-use='rid: original.1'
iso-8601-date='2016-03-01'>
<day>01</day><month>03</month><year>2016</year>
</date>
@Klortho
Klortho / README.md
Last active February 8, 2016 18:17
Demonstrate bug in libxmljs-mt

This test case is currently causing a segfault, and it's not related to the changes I made in libxmljs-cfm. I know this because I set baseUrl to null, and tested with libxmljs-mt, and the problem still occurs.

Note that it does not occur in the original libxmljs library. This gist corresponds to GitHub issue #8 on gagern/libxmljs.

I created show-bug.js here to illustrate it.

@Klortho
Klortho / catalog.xml
Created February 3, 2016 01:02
Using Node.js libxmljs-mt
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public publicId="GOOD" uri="good.dtd"/>
</catalog>
@Klortho
Klortho / named_params.pl
Last active January 4, 2016 16:13
Named parameters in Perl, that you can pass either as a hash or a hash ref. #perl
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
# Pass parameters as a hash
foo(
'name' => 'Fleegle',
@Klortho
Klortho / 0_reuse_code.js
Created November 18, 2015 15:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Klortho
Klortho / gist:684730f1196d6bb56e63
Created April 10, 2015 21:10
invalid-with-dtd.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article [
<!-- This DTD, optimized for use in oXygen XML Editor, is an auto-generated, flat version of the reference DTD, and is not intended for maintenance. -->
<!-- Sponsor: National Center for Biotechnology Information (NCBI) - National Library of Medicine (NLM) -->
<!-- Original DTD and documentation developer: Mulberry Technologies, Inc. - 17 West Jefferson Street, Suite 207 - Rockville, MD 20850 - Phone: 301/315-9631 - Fax: 301/315-8285 -->
<!-- Note: These element and attribute definitions are derived from documentation at http://jats.nlm.nih.gov/publishing/tag-library/ -->
<!-- This variant DTD was developed by Wendell Piez (http://www.wendellpiez.com). -->
<!-- *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** -->