Skip to content

Instantly share code, notes, and snippets.

View EdWarga's full-sized avatar

Ed Warga EdWarga

  • Austin, TX
View GitHub Profile
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
for $p in fn:collection("vwwp_tei")//tei:p
where $p contains text "garden" occurs at least 2 times
return $p
@joewiz
joewiz / create-course-topic-list.xq
Last active May 17, 2017 18:55
Use XQuery tumbling windows to create groups of topics to be covered in class meetings
xquery version "3.1";
(: Use tumbling windows to group topics into the number of class meetings for a section of a course.
Our case in this example:
We have an intensive summer course that needs to cover 12 topics in 3 weeks. It has two sections.
The first section meets once per week, so we need to cover 4 topics in each meeting.
The query below tells us which topics should be covered at each meeting.
For the second section, which meets twice per week, can cover 2 topics at each meeting.
(Here, topics listed are the major Chinese dynasties, as sung at https://www.youtube.com/watch?v=xJis9TSw1rE.)
:)
@CliffordAnderson
CliffordAnderson / brew-install-script.sh
Last active February 14, 2024 08:29
Brew script for installing packages and applications on OSX
#!/bin/sh
# Homebrew Script for OSX
# To execute: save and `chmod +x ./brew-install-script.sh` then `./brew-install-script.sh`
echo "Installing brew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Installing brew cask..."
brew tap homebrew/cask
@roachhd
roachhd / README.md
Last active October 30, 2021 22:04
Feed.xml RSS for Jekyll blog on GitHub pages.

Jekyll RSS Feed Templates.

A few Liquid templates to use for rendering RSS feeds for your Jekyll blog. Featuring four kinds of feeds:

  • feed.xml — Renders the 10 most recent posts.
  • feed.category.xml — Only renders posts for a specific category. This example renders posts for a "miscellaneous" category.
  • feed.links.xml — Only contains posts that link to external websites noted by a link variable in the YAML Front Matter. Not a common Jekyll convention, but a good way to generating a linked list.
  • feed.articles.xml — Only showing articles that don't link to external sites; The opposite of feed.links.xml.
@caschwartz
caschwartz / ead-subject-headings.xqy
Last active March 10, 2020 13:35
XQuery - Query to locate EAD documents with <controlaccess> element containing subject headings
xquery version "1.0-ml";
(: 8/6/12 Query to locate EAD documents that have a <controlaccess> element with subject headings. :)
declare namespace ead = "urn:isbn:1-931666-22-9";
for $doc in xdmp:directory("/EAD/")
let $controlAccess := $doc/ead:ead/ead:archdesc/ead:controlaccess[2] (: Second controlaccess element contains subjects :)
let $title := $doc/ead:ead/ead:eadheader/ead:filedesc/ead:titlestmt/ead:titleproper
return $controlAccess