Skip to content

Instantly share code, notes, and snippets.

View CanOfBees's full-sized avatar
😶‍🌫️

Bridger Dyson-Smith CanOfBees

😶‍🌫️
View GitHub Profile
@CanOfBees
CanOfBees / test-mods.xml
Last active December 11, 2017 15:51
a test MODS dsid
<?xml version="1.0" encoding="UTF-8"?>
<mods:mods xmlns:mods="http://www.loc.gov/mods/v3" xmlns="http://www.loc.gov/mods/v3" xmlns:etd="http://www.ndltd.org/standards/metadata/etdms/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-5.xsd" version="3.5">
<mods:titleInfo>
<mods:title>A Testing Title For A Test</mods:title>
</mods:titleInfo>
<mods:name type="personal">
<mods:namePart type="given">Smeagol</mods:namePart>
<mods:namePart type="family">Trahald</mods:namePart>
<mods:role>
<mods:roleTerm authority="marcrelator" type="text" valueURI="http://id.loc.gov/vocabulary/relators/aut">Author</mods:roleTerm>
@CanOfBees
CanOfBees / quantiles.xq
Created October 26, 2017 01:33
bad thoughts regarding quantiles
(:for $q in $qs
let $count-nums := fn:count($nums)
let $mid := fn:ceiling($count-nums div 2)
let $rounded := fn:round(($count-nums + 1) * $q)
return (
if ($count-nums mod 2 eq 0)
then (fn:avg(fn:subsequence($sorted-nums, $mid, 2)))
else ($sorted-nums[$mid])
):)
(:
@CanOfBees
CanOfBees / alternate-take.xml
Last active October 23, 2017 19:39
embargo_date vs publication_date
This file has been truncated, but you can view the full file.
<res file="utk_graddiss/3018">
<note>same values for embargo and publication dates</note>
</res>
<res file="utk_graddiss/1621">
<note>same values for embargo and publication dates</note>
</res>
<res file="utk_graddiss/3115">
<emb>2011-01-01T00:00:00-08:00</emb>
<pub>2014-12-01T00:00:00-08:00</pub>
</res>
@CanOfBees
CanOfBees / gist:98a9bb246734450ad9d59f3024774b89
Created October 14, 2017 14:31
the advisor2 values just keep getting weirder and weirder
This file has been truncated, but you can view the full file.
<results>
<result>
<submission-path>utk_graddiss/3018</submission-path>
<field name="advisor2" type="string">
<value>Luther Kindall, Larry DeRidder, Anand Malik</value>
</field>
</result>
<result>
<submission-path>utk_graddiss/1621</submission-path>
<field name="advisor2" type="string">
@CanOfBees
CanOfBees / functx-1.0-nodoc-2007-01.xsl
Created May 14, 2017 16:54
functx stylesheet included in repox_test_1
<!--
********************************
The FunctX XSLT Function Library
********************************
Copyright (C) 2007 Datypic
This library is free software; you can redistribute it and/or
@CanOfBees
CanOfBees / repox_test_1.xsl
Created May 14, 2017 16:51
example repox identity transform
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.og/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:oai_qdc="http://worldcat.org/xmlschemas/qdc-1.0/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
xmlns:functx="http://www.functx.com"
xmlns="http://www.loc.gov/mods/v3"
exclude-result-prefixes="#all"
@CanOfBees
CanOfBees / user-testing-xacml-verification.md
Created May 1, 2017 15:34
user* testing process: XACML verification

steps

  1. ensure that you are using the TRAC-675 branch of robert's islandora_scholar
  • e.g. in TRACE/scripts/modules.sh, change line 43 to
git clone https://github.com/robert-patrick-waltz/islandora_scholar
  • then, at line 118 in the same modules.sh, add the following:
cd "$DRUPAL_HOME/sites/all/modules/islandora_scholar || exit
@CanOfBees
CanOfBees / xacml_delete_embargo_rule.xsl
Created April 21, 2017 21:10
delete-embargo-policy -- hey maybe this will work
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ext-str="http://exslt.org/strings"
xmlns:policy="urn:oasis:names:tc:xacml:1.0:policy"
xmlns="urn:oasis:names:tc:xacml:1.0:policy"
exclude-result-prefixes="xs ext-str policy"
version="1.0">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:strip-space elements="*"/>
@CanOfBees
CanOfBees / example-table.xml
Created December 21, 2016 15:15 — forked from xokomola/example-table.xml
Create ODS Spreadsheet with XQuery and BaseX
<tables>
<table name="Sheet 1">
<thead>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</thead>
<tbody>
@CanOfBees
CanOfBees / formatting_islandora_solr_base_filter.md
Last active November 18, 2016 21:57
Drush -- how would you format input for a variable that expects '\r\n' between values?

The Problem

How can I programmatically update the values in a variable that expects that something that kinda-sorta looks like an array but contains \r\n?

The Variable

islandora_solr_base_filter is modified at Islandora's Solr Settings page, under the Query defaults section in the Solr base filter.

Checking The State Of The Value

Before doing anything else, visit your VM with a vagrant ssh: