Skip to content

Instantly share code, notes, and snippets.

View timathom's full-sized avatar

Tim Thompson timathom

  • Yale University Library
  • New Haven, CT
View GitHub Profile
@anarchivist
anarchivist / pymarc_disco.py
Created October 14, 2010 04:04
sample MapReduce tasks for Disco to get tag counts from MARC files/streams
#!/usr/bin/env python
#
# pymarc_disco.py - Mark Matienzo
# sample MapReduce tasks for Disco to get tag counts from MARC files/streams
# usage: python pymarc_disco.py <input1> [input2 ... inputN]
import sys
from disco.core import Disco, result_iterator
from disco.settings import DiscoSettings
import pymarc
@mbostock
mbostock / .block
Last active July 8, 2023 20:00
SVG foreignObject Example
license: gpl-3.0
@avernet
avernet / gist:1685838
Created January 26, 2012 23:30
Using event('response-status-code')
<xhtml:html xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<xhtml:head>
<xforms:model>
<xforms:submission id="inexistent" resource="http://www.orbeon.com/gaga" replace="instance" method="post">
<xforms:message ev:event="xforms-submit-error" level="modal">submission1 error (<xforms:output value="event('response-status-code')"/>)</xforms:message>
</xforms:submission>
<xforms:instance>
<instance/>
</xforms:instance>
</xforms:model>
@caryfitzhugh
caryfitzhugh / gist:2015072
Created March 11, 2012 04:46
Simple Proof Of Concept For SVG image annotation in browser
<html>
<head>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js"></script>
<script>
/**
* A Simple Vector Shape Drawing App with RaphaelJS and jQuery
* copyright 2010 Kayla Rose Martin - Licensed under the MIT license
* Inspired by http://stackoverflow.com/questions/3582344/draw-a-connection-line-in-raphaeljs
**/
@joewiz
joewiz / collection.xconf.xml
Created April 7, 2012 19:33
My XQuery snippets
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index>
<!-- Old full text index configuration. Deprecated. -->
<fulltext default="none" attributes="false"/>
<!-- New full text index based on Lucene -->
<lucene>
<text qname="SPEECH">
<ignore qname="SPEAKER"/>
</text>
@njh
njh / _README.md
Last active October 5, 2019 12:06
Shell script to create a WebID certificate using OpenSSL
@ebruchez
ebruchez / gist:3061162
Created July 6, 2012 16:24
XForms: Clearing non-relevant elements upon submission
<xh:html
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events">
<xh:head>
<xf:model id="model">
<xf:instance id="instance">
@apb2006
apb2006 / app-basex.js
Last active June 25, 2016 13:59
Node.js + socket.io + BaseX = Xquery chatbot
// Andy bunce jan 2013 based on http://book.mixu.net/ch13.html
var fs = require('fs'),
http = require('http'),
sio = require('socket.io');
var port=8001;
var server = http.createServer(function(req, res) {
res.writeHead(200, { 'Content-type': 'text/html'});
res.end(fs.readFileSync('./index.html'));
});
server.listen(port, function() {
@xquery
xquery / gist:5594054
Last active January 22, 2020 00:12
illustration of mapreduce using xquery 3.0 word count example
xquery version "3.0";
declare function local:mapReduce(
$list as item()*,
$mapper as function(*),
$reducer as function(*)
)
{
let $intermediate := for $l at $pos in $list return $mapper("list" || $pos,$l)
return
@mankyKitty
mankyKitty / SolrQuerySyntaxPrimer.md
Last active July 12, 2024 12:29
The documentation around the basics of the Solr query syntax is terrible, this is an attempt to alleviate the doc-shock associated with trying to learn some fundamentals.

Solr Query Syntax Basics

This is a super basic beginners guide to Solr Lucene query syntax. We're going to cover running a straightforward query, as well as some of the more useful functionality such as filtering and creating facets. We'll point out some things you can't do and generally give you enough instruction so that you can get yourself into trouble.

For testing you need a REST client capable of sending requests to your Solr instance. Either RESTClient for Firefox or Postman for Chrome are good choices.

Misc

Request Specific Fields

To specify a list of fields to return instead of the default Solr response use fl and provide a comma delimited list of fields: