Skip to content

Instantly share code, notes, and snippets.

View kshepherd's full-sized avatar
🎼
🎵🎵🎶🎵🎶🎶

kshepherd kshepherd

🎼
🎵🎵🎶🎵🎶🎶
View GitHub Profile
@kshepherd
kshepherd / docker-compose.yml
Last active June 12, 2023 08:14
simple compose for ocfl workshop (hopefully). create a 'fcdata' dir in the same dir as this file for the volume mount then use `docker-compose up -d` to bring it up including pulling the image for the first startup
version: '3'
services:
fcrepo:
container_name: fcrepo
image: fcrepo/fcrepo
networks:
fedoranet:
aliases:
- fcrepo
ports:
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
* <p>
* http://www.dspace.org/license/
*/
package org.dspace.example;
import java.io.IOException;
@kshepherd
kshepherd / MockSolrServerResolver.java
Created July 18, 2022 21:25
example mock oai solr server resolver
package org.dspace.xoai.tests;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
import org.dspace.xoai.services.api.config.ConfigurationService;
import org.dspace.xoai.services.api.solr.SolrServerResolver;
import org.dspace.xoai.services.impl.solr.DSpaceSolrServerResolver;
import org.springframework.beans.factory.annotation.Autowired;
@kshepherd
kshepherd / MockSolrOAICore.java
Created July 18, 2022 21:23
exampl emock oai core for test - safe to extend SolrSearchCore and override some things, allows use of getSolr() etc
package org.dspace.xoai.tests;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.dspace.discovery.MockSolrSearchCore;
import org.dspace.services.factory.DSpaceServicesFactory;
import org.dspace.solr.MockSolrServer;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
@kshepherd
kshepherd / to_value_pairs.py
Created October 15, 2018 04:42
Turn STDIN lines into DSpace value-pair XML
// Turn STDIN lines into DSpace value pairs with indenting for inclusion in input-forms.xml
// (simple displayed value = stored value case)
import sys
print "<value-pairs value-pairs-name=\"insert-name-here\" dc-term=\"insert-term-here\">"
for line in sys.stdin:
print " <pair>\n <displayed-value>" + line.strip() + "</displayed-value>\n <stored-value>" + line.strip() + "</stored-value>\n </pair>"
print "</value-pairs>"
@kshepherd
kshepherd / publications.md
Last active September 16, 2018 23:18
A selection of Kim Shepherd's papers, presentations, articles, posters
@kshepherd
kshepherd / safe-delayed-retries.js
Last active February 22, 2018 00:15
Draft Pattern: Safe Delayed Retries
var Promise = require('bluebird');
/*
* Safe Delayed Retries
*
* This test pattern simulates a single delayed retry for an operation
* that might have failed but doesn't always... in my case, a MSSQL 'deadlocked transaction, please run again'
* error response that I want to retry rather than skipping that transaction or failing outright.
*
* I've set it up so that on >=0.5 random roll, the operation passes.
* On a pass, results are handled and app carries on.

Keybase proof

I hereby claim:

  • I am kshepherd on github.
  • I am kshepherd (https://keybase.io/kshepherd) on keybase.
  • I have a public key whose fingerprint is 0CCB D957 0C35 F5C1 497E CDCF FC4B ABA3 2A1A FAEC

To claim this, I am signing this object: