Skip to content

Instantly share code, notes, and snippets.

View cjcolvar's full-sized avatar

Chris Colvard cjcolvar

  • Bloomington, IN
View GitHub Profile
@cjcolvar
cjcolvar / changes.diff
Created October 18, 2023 16:40
Changes to fcrepo upgrader for Avalon
diff --git a/pom.xml b/pom.xml
index c5cfaa0..1c9ac10 100644
--- a/pom.xml
+++ b/pom.xml
@@ -226,6 +226,9 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <release>21</release>
@cjcolvar
cjcolvar / gist:456539b0eb4bd2e5e2911529c3a61203
Created August 2, 2023 20:43
Avalon reindexing script for solr 6 -> solr 8/9 migration
# Script for reindexing an Avalon instance into an empty solr instance
#
# This script intends to be rerunnable and more resilient than the rake avalon:reindex task and utilizes a database
# to store information that is used while the script is running and for future runs.
#
# The database connection defaults to the $DATABASE_URL env variable or can be set with the --database option.
# A single table will be createed for this script and can be dropped using the --drop-table option to clean
# out the database prior to running.
#
# There are two phases to this process: identification and reindexing
@cjcolvar
cjcolvar / remote_participation.md
Last active January 17, 2020 16:57
Using Visual Studio Code's Live Share plugin to remotely participate during Developer Congress

Install Visual Studio Code. It is free and has Win/Mac/Linux versions.

Next install the Live Share Extension Pack. This includes the Live Share plugin and the Live Share Audio and Chat plugins.

Once these are installed, read the quickstart for joining a live share.

If you want, read the longer documentation about all you can share (editors, shells, servers, etc.) during the live share.

During the Dev Congress, one person can create the live share, start an audio call, send the live share link on slack, and then others will join. The host doesn't need to be the person leading the swarm but should

@cjcolvar
cjcolvar / samvera-connect-2019-circleci-workshop.md
Last active October 22, 2019 17:05
Samvera Connect 2019 - CircleCI Workshop

Samvera Connect 2019 - CircleCI Workshop

We're going to run through converting a simple ruby gem from a Travis CI build to a CircleCI build using the Samvera orb.

Setup Code

  1. Fork ruby-rdf/linkeddata to your personal github space
  2. Checkout your fork locally: git clone https://github.com/<username>/linkeddata.git
  3. Enter checkout directory: cd linkeddata
  4. Run bundle install: bundle install
  5. Verify the tests pass: bundle exec rspec
@cjcolvar
cjcolvar / index.html
Created February 11, 2018 05:48 — forked from anonymous/index.html
Simple Kanji Game // source https://jsbin.com/kokelihafi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Simple Kanji Game</title>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<style id="jsbin-css">
@cjcolvar
cjcolvar / ntriples_reindexing.rb
Last active April 14, 2021 06:02
Monkey-patch initializer to request ntriples when reindexing to avoid timeouts
ActiveFedora::Fedora.class_eval do
def ntriples_connection
authorized_connection.tap { |conn| conn.headers['Accept'] = 'application/n-triples' }
end
def build_ntriples_connection
ActiveFedora::InitializingConnection.new(ActiveFedora::CachingConnection.new(ntriples_connection, omit_ldpr_interaction_model: true), root_resource_path)
end
end
@cjcolvar
cjcolvar / gist:a7c26de736e5dede6381ea6b31264a16
Created November 2, 2017 19:35
Variations migration script via batch ingest from Paul Hoffman
#!/usr/bin/perl
use strict;
use warnings;
use XML::LibXSLT;
use XML::LibXML;
use POSIX qw(strftime);
use File::Basename qw(dirname basename);
use Getopt::Long
@cjcolvar
cjcolvar / gist:1ca9326120e99ab1bddde0f66c4877fc
Created July 31, 2017 18:13
DescendentFetcher which partitions into model names passed, skips PairTree nodes, and stops after first level of non-PairTree nodes
module ActiveFedora
module Indexing
# Finds all descendent URIs of a given repo URI (usually the base URI).
#
# This is a slow and non-performant thing to do, we need to fetch every single
# object from the repo.
#
# The DescendantFetcher is also capable of partitioning the URIs into "priority" URIs
# that will be first in the returned list. These prioritized URIs belong to objects
# with certain hasModel models. This feature is used in some hydra apps that need to
@cjcolvar
cjcolvar / .fcrepo_wrapper
Created May 19, 2017 17:12
fcrepo_wrapper config that enables jmx
# Place any default configuration for solr_wrapper here
port: 8984
enable_jms: false
fcrepo_home_dir: tmp/fcrepo4-development-data
java_options:
- '-Dfcrepo.log.http.api=WARN'
- '-Dfcrepo.log.kernel=ERROR'
- '-Dfcrepo.home=tmp/fcrepo4-development-data'
- '-Dfcrepo.spring.jms.configuration=file:///Users/cjcolvar/.rvm/gems/ruby-2.3.1/gems/fcrepo_wrapper-0.7.0/data/spring-noop.xml'
- '-Dcom.sun.management.jmxremote'
@cjcolvar
cjcolvar / gist:b56aa87848d6cc519a3f7c36cd24db56
Created June 23, 2016 15:22
Options for determining what migrations need to be run
[cjcolvar@localhost avalon]$ bundle exec rake db:version
Current version: 20160511155417
[cjcolvar@localhost avalon]$ bundle exec rake db:migrate:status
database: /home/cjcolvar/Code/avalon/avalon/db/development.sqlite3
Status Migration ID Migration Name
--------------------------------------------------
up 20120202180525 Devise create users
up 20120202180540 Create searches