Skip to content

Instantly share code, notes, and snippets.

View mark-dce's full-sized avatar

Mark Bussey mark-dce

  • Data Curation Experts
  • Minneapolis, MN
View GitHub Profile
@mark-dce
mark-dce / rspec admin set setup
Last active September 17, 2022 14:52
Hyrax tests that require workflows
# set up workflows for Sipity test (or use before context block to setup AdminSet outside of transactions)
# Hyrax::PermissionTemplate.create!(source_id: Hyrax::AdminSetCreateService::DEFAULT_ID)
# Hyrax::Workflow::WorkflowImporter.load_workflows
# Sipity::Workflow.activate!(permission_template: Hyrax::PermissionTemplate.last, workflow_name: Hyrax.config.default_active_workflow_name)
# alternately, delete default adminset to trigger recreation of default admin set and workflows
# default_admin_set = AdminSet.where(id: 'admin_set/default').first
# default_admin_set.delete(eradicate: true) if default_admin_set
@mark-dce
mark-dce / posters_collection_iiif.v3.json
Created July 28, 2022 19:22
Sample IIIF Collection - Posters
{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "https://tenejo.curationexperts.com/collections/bk128b23n/iiif_collection",
"@type": "sc:Collection",
"label": "Poster Collection",
"manifests": [
{
"@id": "https://tenejo.curationexperts.com/concern/works/dr26xx76j/manifest",
"@type": "sc:Manifest",
"label": "When attending the World's Fair, visit beautiful Sea Cliff 250 ft. altitude : No mosquitos."
@mark-dce
mark-dce / etd_ids.json
Last active December 23, 2021 15:55
ETD IDs as JSON
// 20211223095436
// http://localhost:8993/solr/laevigata/select?fl=id&indent=on&q=has_model_ssim:Etd&rows=100000&sort=system_create_dtsi%20ASC&wt=json
{
"responseHeader": {
"status": 0,
"QTime": 5,
"params": {
"q": "has_model_ssim:Etd",
"indent": "on",
@mark-dce
mark-dce / etd_ids.csv
Last active December 23, 2021 15:56
ETD IDs as csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
id
6d56zw601
br86b356q
4m90dv48q
1c18df763
4m90dv490
8336h188j
3t945q76s
0g354f20t
6395w709f
@mark-dce
mark-dce / rails console input.txtx
Created November 12, 2021 21:36
New Work Creation (Abridged)
stack = Hyrax::CurationConcern.actor
curation_concern = Work.new
user = User.where(email: 'mark@curationexperts.com').first
attributes = {:title=>["Testing Actor Stack"], :rights_statement=>["http://rightsstatements.org/vocab/UND/1.0/"], :creator=>["Me"]}
env = Hyrax::Actors::Environment.new(curation_concern, user.ability, attributes)
stack.create(env)
@mark-dce
mark-dce / rail console ouput.txt
Created November 12, 2021 21:31
New Work Creation Using the Actor Stack (Unabridged)
irb(main):037:0> stack = Hyrax::CurationConcern.actor
=> #<Hyrax::Actors::OptimisticLockValidator:0x00007f93f0c7c280 @next_actor=#<Hyrax::Actors::CreateWithRemoteFilesActor:0x000...
irb(main):038:0> user = User.where(email: 'mark@curationexperts.com').first
User Load (0.9ms) SELECT "users".* FROM "users" WHERE "users"."email" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["email", "mark@curationexperts.com"], ["LIMIT", 1]]
=> #<User id: 3, email: "mark@curationexperts.com", created_at: "2021-11-10 22:05:32", updated_at: "2021-11-10 22:06:23", gu...
irb(main):039:0> attributes = {:title=>["Testing Actor Stack"], :rights_statement=>["http://rightsstatements.org/vocab/UND/1.0/"]
, :creator=>["Me"]}
=> {:title=>["Testing Actor Stack"], :rights_statement=>["http://rightsstatements.org/vocab/UND/1.0/"], :creator=>["Me"]}
irb(main):040:0> env = Hyrax::Actors::Environment.new(curation_concern, user.ability, attributes)
Role Load (0.8ms) SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "role
@mark-dce
mark-dce / gist:004ad0d3c5b03a62ff223e016a3627dc
Created November 12, 2021 21:05
Actor stack environment dump
in /Users/mark/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/hyrax-3.1.0/app/controllers/concerns/hyrax/works_controller_behavior.rb
197: # @return [#errors]
198: def create_work
199: byebug
200: case curation_concern
201: when ActiveFedora::Base
=> 202: actor.create(actor_environment)
203: else
204: form = build_form
205:
{"@context":"http://iiif.io/api/presentation/2/context.json","@type":"sc:Manifest","@id":"https://tenejo.curationexperts.com/concern/works/2r36tx551/manifest","label":"Clubs","description":["Cards in the hearts suit"],"sequences":[{"@type":"sc:Sequence","@id":"https://tenejo.curationexperts.com/concern/works/2r36tx551/manifest/sequence/normal","rendering":[],"canvases":[{"@type":"sc:Canvas","@id":"https://tenejo.curationexperts.com/concern/works/2r36tx551/manifest/canvas/r781wg01v","label":"As-Tr%C3%A8fles-Recto.tiff","width":766,"height":1141,"images":[{"@type":"oa:Annotation","motivation":"sc:painting","resource":{"@type":"dctypes:Image","@id":"https://tenejo.curationexperts.com/cantaloupe/iiif/2/r781wg01v%2Ffiles%2F3597e6e0-8095-4af0-9843-9df4c36f6431%2Ffcr:versions%2Fversion1/full/600,/0/default.jpg","height":1141,"width":766,"format":"jpg","service":{"@context":"http://iiif.io/api/image/2/context.json","@id":"https://tenejo.curationexperts.com/cantaloupe/iiif/2/r781wg01v%2Ffiles%2F3597e6e0-8095-4af0-9843
@mark-dce
mark-dce / postcards_from_paces.css
Created July 12, 2021 22:36
Postcards from Places colors
/* Color Theme Swatches in Hex */
.My-Color-Theme-1-hex { color: #3C731C; }
.My-Color-Theme-2-hex { color: #A6D433; }
.My-Color-Theme-3-hex { color: #BDBA37; }
.My-Color-Theme-4-hex { color: #D4C133; }
.My-Color-Theme-5-hex { color: #C9A830; }
/* Color Theme Swatches in RGBA */
.My-Color-Theme-1-rgba { color: rgba(60, 115, 28, 1); }
.My-Color-Theme-2-rgba { color: rgba(166, 212, 51, 1); }
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
oid
2111711
2111712
2111714
2111715
2111717
2111718
2111719
2111720
2111721