Skip to content

Instantly share code, notes, and snippets.

@jeremyf
jeremyf / cibuild
Created Nov 21, 2017
Cibuild proposal that includes indication on what is starting and stopping
View cibuild
#!/usr/bin/env bash
set -e # halt script on error
echo "=~=~=~=~=~= Starting jekyll build =~=~=~=~=~="
bundle exec jekyll build
echo "=~=~=~=~=~= Finished jekyll build =~=~=~=~=~="
echo "=~=~=~=~=~= Starting htmlproofer =~=~=~=~=~="
bundle exec htmlproofer ./_site
echo "=~=~=~=~=~= Finished htmlproofer =~=~=~=~=~="
@jeremyf
jeremyf / assigning-a-person-to-review-a-submission.md
Created Nov 8, 2017
Assigning a person to review a submission based on properties of the work
View assigning-a-person-to-review-a-submission.md

Goal

Assigning a person to review a submission based on properties of the work. And you don't need multiple admin sets to do this.

Whirlwind Workflow

Two primary concepts of the workflow in Hyrax 2.0:

  1. Permissions are assigned at two levels:
  2. [Sipity::WorkflowResponsibility][sipity_workflow_responsibility] - A person has permissions to all things using this workflow
View compare-new-and-not-new.sh
# Transform JSON (from a file, URL, or stdin) into discrete assignments to make it greppable
for file in new-*; do diff <(gron "`echo $file | sed  's/new-//'`") <(gron $file) >> diffs.txt; done
View catalog.jsonld
{
"@context": {
"xsd": "http://www.w3.org/2001/XMLSchema#",
"deri": "http://sindice.com/vocab/search#",
"und": "http://localhost:3000/show/",
"dc": "http://purl.org/dc/terms/",
"deri:first": {
"@type": "@id"
},
"deri:last": {
@jeremyf
jeremyf / dcc-retiring-procedure.rb
Last active Apr 22, 2017
A script for transitioning characters to retirement, yet not allowing them off of the hook.
View dcc-retiring-procedure.rb
require 'logger'
ABILITY_SCORE_MODIFIER = {
0 => :dead,
1 => -3, 2 => -3, 3 => -3,
4 => -2, 5 => -2,
6 => -1, 7 => -1, 8 => -1,
9 => 0, 10 => 0, 11 => 0, 12 => 0,
13 => 1, 14 => 1, 15 => 1,
16 => 2, 17 => 2,
18 => 3,
@jeremyf
jeremyf / super.rb
Created Apr 13, 2017
Super method definition
View super.rb
module A
def hello
puts 'hello'
end
end
module B
def hello
puts 'potato'
super
@jeremyf
jeremyf / solr_doc_for.rb
Created Mar 21, 2017
Proposed extraction of SolrDocFor
View solr_doc_for.rb
module ActiveFedora
module Plugin
module SolrDocFor
class_attribute :default_solr_document_class
self.default_solr_document_class = ::SolrDocument
# @param [String] id - of the object to cast to the given :solr_document_class
# @param [#new] solr_document_class
# @return Instance of the configured ActiveFedora::Plugin::SolrDocFor.default_solr_document_class
# @see ActiveFedora::Plugin::SolrDocFor.default_solr_document_class
@jeremyf
jeremyf / deep_merge_two_yaml_files.rb
Created Nov 3, 2016
deep_merge_two_yaml_files.rb
View deep_merge_two_yaml_files.rb
gem 'activesupport'
require 'active_support/core_ext/hash/deep_merge'
require 'psych'
first_hash = Psych.load_file(PATH_TO_FIRST_FILE)
second_hash = Psych.load_file(PATH_TO_SECOND_FILE)
File.write(PATH_TO_MERGED_FILE, Psych.dump(first_hash.deep_merge(second_hash)))
@jeremyf
jeremyf / presentation.md
Last active Oct 5, 2016
We added Sipity workflow to CurationConcerns [Hydra Connect 2016 Lightning Talk]
View H20 playlist
"Theme From Flood" by They Might Be Giants
"Good Vibrations" by The Beach Boys
"I'm The Ocean" by Neil Young
"Take Me To The River" by Talking Heads
"Undertow" by R.E.M.
"The Ocean" by U2
"Everyday Is Like Sunday" by Morrissey
"Surf's Up Tonight" by Midnight Oil
"Prince Caspian" by Phish
"Wave Of Mutilation" by Pixies