Skip to content

Instantly share code, notes, and snippets.

View terrywbrady's full-sized avatar

Terry Brady terrywbrady

View GitHub Profile
@terrywbrady
terrywbrady / 1 Name and Description
Last active January 3, 2016 09:29
File Analyzer File Test Example
public class NameChecksum extends DefaultFileTest {
public String toString() {
return "Sort By Checksum";
}
public String getShortName(){return "Checksum";}
public String getDescription() {
return "This test reports the checksum for a given filename.\n" +
"The summary report will identify files with the same checksum value.\n" +
@terrywbrady
terrywbrady / override.xsl
Last active August 29, 2015 14:03
Override XMLUI Home Breadcrumb Link
<xsl:template match="dri:trail">
<li>
<xsl:attribute name="class">
<xsl:text>ds-trail-link </xsl:text>
<xsl:if test="position()=1">
<xsl:text>first-link </xsl:text>
</xsl:if>
<xsl:if test="position()=last()">
<xsl:text>last-link</xsl:text>
</xsl:if>
@terrywbrady
terrywbrady / README.md
Last active September 1, 2016 18:56
Compare Sierra Permissions
@terrywbrady
terrywbrady / GoogleSpreadsheet.html
Last active July 19, 2024 10:46
Sample HTML/JS to parse a Google Spreadsheet
<!doctype html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var spData = null;
function doData(json) {
spData = json.feed.entry;
}
@terrywbrady
terrywbrady / summon-customize.js
Created August 4, 2014 21:36
Group Summon Results into 3 Groups: Electronic, Georgetown, Consortium
$(document).ready(function () {
$(document).find("head").append("<style id='gu-custom-css' type='text/css'/>");
$("#gu-custom-css").append(".holding-msg {font-weight: bold; margin-top: 9px; margin-bottom: 9px;}");
$("#gu-custom-css").append(".holding-header-sep {border-top: dashed 1px #8d817b; padding-top: 9px;}");
$("#gu-custom-css").append("div.chart .selection {fill: #679146; stroke: #6caddf;}");
$("#gu-custom-css").append(".savedItemsFolder .badgeContainer .badge {background-color: #679146;}");
$("#gu-custom-css").append(".fulltext {background-color: #679146;}");
$("#gu-custom-css").append(".fulltext .fulltext-inner:before {border-color: #004990 transparent transparent !important;}");
$("#gu-custom-css").append(".resultsPane .rollup {border-left: 4px solid #6caddf;}");
$("#gu-custom-css").append(".resultsPane .imagesRollup .grid {margin-top: 0.6rem;}");
@terrywbrady
terrywbrady / README.md
Last active August 29, 2015 14:08
Copy DSpace Statistics Records to Force UID generation

We found that 5M of our 12M statistics records did not have a uid. The absence of this field caused the sharding process to fail.

  • Add the following to solr.xml

      <core name="tstatistics" instanceDir="tstatistics" />
    
  • Build solrFix-2.0.jar using the pom file listed above

  • Run the solrFix jar repeatedly until all records have been copied from "statitistics" to "tstatistics". This calls the SolrTouch class which reads each statistics record and copies it (exluding uid and version). This will force the re-initialization of these fields.

This process runs into heap or garbage collection contstraints when processing large numbers of items. On line #63, tune the process to set a maximum number of records to process at one time. (Recommended: 100,000 to 500,000)

@terrywbrady
terrywbrady / bookview-banner.html
Last active February 10, 2022 01:15
Sample FlexPaper Document Viewer for XMLUI
<!--
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
http://www.dspace.org/license/
-->
<div id="close"><a href="javascript:window.close();">Close Book Viewer</a></div>
@terrywbrady
terrywbrady / ExceptionReprot.java
Last active August 29, 2015 14:11
DSpace Curation Task - Exception Report
/**
* 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
*
* http://www.dspace.org/license/
*/
package org.dspace.ctask.georgetown;
import java.io.IOException;
@terrywbrady
terrywbrady / SolrLoggerSpecial.java
Created January 21, 2015 20:02
DSpace Special code to run stats-util -s that forces new id/version values
/**
* 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
*
* http://www.dspace.org/license/
*/
package org.dspace.statistics;
import au.com.bytecode.opencsv.CSVReader;
@terrywbrady
terrywbrady / summon-customize.js
Last active August 29, 2015 14:14
Group Summon Results: Online, GU, Consortium
This sample code has been migrated to https://github.com/Georgetown-University-Libraries/SummonCustomization