Skip to content

Instantly share code, notes, and snippets.

View terrywbrady's full-sized avatar

Terry Brady terrywbrady

View GitHub Profile
@terrywbrady
terrywbrady / Dockerfile
Created May 15, 2023 18:06
Sample Capybara Driver Running Headless Chrome in a Container
#FROM ruby:2.7
FROM ruby:3
RUN apt-get update -y && \
apt-get -y upgrade && \
apt-get install -y libarchive-tools zip
RUN gem install bundler
COPY Gemfile Gemfile
@terrywbrady
terrywbrady / README.md
Created June 9, 2022 15:37
Maven integration tests utilizing external containers for testing

Overview

The io.fabric8 docker-maven-plugin can start and stop docker containers to support junit integration tests.

These tests run during the integration test phase.

Example Container - test S3 api interactions during integration tests

For instance, create a container build on minio/minio to simulate interactions with a cloud service.

Keybase proof

I hereby claim:

  • I am terrywbrady on github.
  • I am terrywbrady (https://keybase.io/terrywbrady) on keybase.
  • I have a public key ASCUdDs5dO-EZlFetC02Ta16Lof1jUlIUCnlXna4RDrmlwo

To claim this, I am signing this object:

@terrywbrady
terrywbrady / sharestream.xsl
Created January 28, 2019 20:31
Sharestream Embed Logic
<xsl:template name="summaryHeaderSharestream">
<xsl:variable name="isAudio" select="dim:field[@element='type'][text()='Audio']"/>
<xsl:for-each select="dim:field[@element='relation' and @qualifier='uri']">
<div class="row">
<div class="col-sm-12">
<xsl:variable name="media">
<xsl:choose>
<xsl:when test="contains(.,'/sharestream2gui')">
<xsl:text>https://mediapilot.georgetown.edu:443/ssdcms/embedplayer.do?aid=</xsl:text>
<xsl:value-of select="substring-before(substring-after(.,'mediaPath='),'&amp;')"/>
@terrywbrady
terrywbrady / vendor.xsl
Last active April 24, 2018 21:27
Alma to GMS Vendor Stylesheet
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:vend="http://com/exlibris/repository/acq/invoice/xmlbeans" version="1.0">
<xsl:output method="text"/>
<xsl:template match="/vend:payment_data">
<xsl:apply-templates select="vend:invoice_list/vend:invoice"/>
</xsl:template>
<!-- Question: Special handling of Credit Card Stuff -->
@terrywbrady
terrywbrady / Mirage2Theme.xsl
Last active December 13, 2023 09:46
DSpace / IIIF Integration for DigitalGeorgetown
<!--
The following XSL lives in a top-level theme xsl file.
This block of code controls all of loose integrations that we have embedded in our custom themes.
Since our work with IIIF is still evolving, we offer a number of mechanisms for linking a IIIF manifest into DSpace
- Add the manifest file as a specially named item bitstream ("IIIF Manifest")
- Link a manifest to an item in dc.relation.uri
- Link a manifest file to a collection page with special markup in dc.description.tableofcontents
We expect to eventually standardize the integration on a smaller set of options.
@terrywbrady
terrywbrady / sample.xsl
Created December 12, 2017 16:58
DSpace XMLUI XSLT to convert URL's to links and Markdown to Html
<xsl:template name="summaryHeaderMarkdown">
<xsl:apply-templates select="dim:field[@element='description' and not(@qualifier)][starts-with(.,'[MD]')]" mode="markdown"/>
</xsl:template>
<xsl:template match="dim:field[@element='description' and not(@qualifier)][starts-with(.,'[MD]')]" mode="markdown">
<xsl:call-template name="markdown-text">
<xsl:with-param name="val" select="substring-after(text(),'[MD]')"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dim:field" mode="markdown"/>
@terrywbrady
terrywbrady / LightweightNavigableObjectRest.java
Last active March 17, 2017 22:26
Community/collection hierarchy navigation object
DSpaceObjectRest extends BaseObjectRest {
private String uuid;
private String name;
private String type}
}
BrowsableObjectRest extends DSpaceObjectRest {
private String handle;
//link to breadcrumb trail
@terrywbrady
terrywbrady / NavigableObjectRest.java
Last active March 20, 2017 16:13
Community/Collection Hierarchy in DSpace 7 REST
/*
* Only items, collections, communities, and sites have handles, so handle should move out to a separate object.
* Every navigable item has a breadcrumb trail.
*/
NavigableObjectRest extends DSpaceObjectRest {
private String handle;
//Is this embedded - too slow
//Is this retrieved through a separate endpoint - cumbersome
//Is this embedded but populated only on request - how do we represent that in our framework
@terrywbrady
terrywbrady / theme.css
Created December 12, 2016 18:23
XMLUI: Avoiding Broken Image Icon Display for Restricted Thumbnails
/*
Code to prevent broken image icon display
http://stackoverflow.com/questions/22051573/how-to-hide-image-broken-icon-using-only-css-html-without-js/37192970#answer-37192970
*/
a.image-link img,div.artifact-preview img {
font-family: 'Helvetica';
font-weight: 300;
line-height: 2;
text-align: center;
height: auto;