Skip to content

Instantly share code, notes, and snippets.

cjcolvar

Block or report user

Report or block cjcolvar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cjcolvar
cjcolvar / samvera-connect-2019-circleci-workshop.md
Last active Oct 22, 2019
Samvera Connect 2019 - CircleCI Workshop
View samvera-connect-2019-circleci-workshop.md

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
View index.html
<!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 Sep 4, 2018
Monkey-patch initializer to request ntriples when reindexing to avoid timeouts
View ntriples_reindexing.rb
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 Nov 2, 2017
Variations migration script via batch ingest from Paul Hoffman
View gist:a7c26de736e5dede6381ea6b31264a16
#!/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 Jul 31, 2017
DescendentFetcher which partitions into model names passed, skips PairTree nodes, and stops after first level of non-PairTree nodes
View gist:1ca9326120e99ab1bddde0f66c4877fc
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
fcrepo_wrapper config that enables jmx
View .fcrepo_wrapper
# 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 Jun 23, 2016
Options for determining what migrations need to be run
View gist:b56aa87848d6cc519a3f7c36cd24db56
[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
@cjcolvar
cjcolvar / example.vtt
Created Mar 9, 2016
Example vtt file for testing
View example.vtt
WEBVTT
1
00:00:01.000 --> 00:00:10.000
This is the first line of text, displaying from 1-10 seconds
2
00:00:15.000 --> 00:00:20.000
And the second line of text
separated over two lines
@cjcolvar
cjcolvar / gist:a7ead7472e9ffd6673f1
Created Aug 3, 2015
Matterhorn distribute-hls stacktrace
View gist:a7ead7472e9ffd6673f1
2015-07-28 17:45:16 INFO (AbstractCmdlineEncoderEngine:237) - Executing encoding command: /usr/bin/ffmpeg -i /usr/local/matterhorn/work/opencast/workspace/mediapackage/8677661e-0e40-4585-a94d-6ae8c4af664d/bf058e85-3770-4607-b10e-82b09f4c7bec/filename.mp4 -codec copy -map 0 -bsf h264_mp4toannexb -f segment -segment_list /usr/local/matterhorn/work/opencast/workspace/mediapackage/8677661e-0e40-4585-a94d-6ae8c4af664d/bf058e85-3770-4607-b10e-82b09f4c7bec/filename_b20051ba-dc9c-409b-b62d-6ad46e068dce.m3u8 -segment_time 10 /usr/local/matterhorn/work/opencast/workspace/mediapackage/8677661e-0e40-4585-a94d-6ae8c4af664d/bf058e85-3770-4607-b10e-82b09f4c7bec/filename_b20051ba-dc9c-409b-b62d-6ad46e068dce-%03d.ts
2015-07-28 17:45:16 INFO (AbstractCmdlineEncoderEngine:261) - Video track filename.mp4 successfully encoded using profile 'profile.hls.http'
2015-07-28 17:45:16 WARN (HLSDistributionServiceImpl:269) - Error distributing http://avalon.example.com:18080/files/mediapackage/8677661e-0e40-4585-a94d-6ae8c4af664d/d48e
View gist:1d821fe502016aceea1b
#Adding a new document action:
#Override the catalog controller or subclass and add your action:
#needs user feedback from a form
self.add_action(:translate, :translate_action, validator: :validate_translate_params)
def translate_action
Translator.translate(documents, params[:language])
end
#doesn't require form feedback
You can’t perform that action at this time.