Skip to content

Instantly share code, notes, and snippets.

View rococodogs's full-sized avatar

Anna Malantonio rococodogs

View GitHub Profile
<!-- v3 updated to parse CSV output from gviz url -->
<style type="text/css">/* table styling */
#data-table {
font-size: .85em;
table-layout: fixed;
width: 100%;
}
#data-table th {
background-color: transparent;
@rococodogs
rococodogs / delegates.rb
Created January 27, 2020 20:00
cantaloupe delegate file wip
# frozen_string_literal: true
class CustomDelegate
attr_accessor :context
##
# Returns authorization status for the current request. Will be called upon
# all requests to all public endpoints.
#
# Implementations should assume that the underlying resource is available,
# and not try to check for it.
@rococodogs
rococodogs / readme.markdown
Last active August 13, 2019 16:27
a hyrax job to add files that were previously missed

i originally wrote this as a single script to be run as bundle exec rails runner update-files.rb but that required having a terminal window open + connected, so i rewrote it as a job.

in a rails console:

Publication.where(file_set_ids_ssim: nil).each { |pub| UpdateMissingFilesJob.perform_later(pub) }

make sure you restart the sidekiq server after adding the job file and before you run the above enqueuing! otherwise

@rococodogs
rococodogs / hyrax-to-solr.js
Last active July 5, 2018 19:04
query a hyrax item in solr
(function () {
var url = new URL(window.location.href);
if (url.host.indexOf('localhost') == -1) {
return
}
var path = url.pathname;
if (path.indexOf('/concern/') != 0) {
return
@rococodogs
rococodogs / hyrax-to-fcrepo.js
Created June 28, 2018 13:34
open a hyrax item in fedora (fcrepo)
(function () {
var url = new URL(window.location.href);
if (url.host.indexOf('localhost') == -1) {
return
}
var path = url.pathname;
if (path.indexOf('/concern/') != 0) {
return
@rococodogs
rococodogs / dspace-metadata-fields.md
Created June 11, 2018 13:49
dspace metadata field usage postgresql query

which metadata fields are being used by dspace?

SELECT
  element,
  qualifier,
  scope_note,
  count(*)
FROM metadatavalue
{
"user": "metadb",
"host": "localhost",
"database": "metadb",
"password": ""
}
@rococodogs
rococodogs / islandora_datastream_dc.md
Last active August 18, 2017 15:09 — forked from jrgriffiniii/islandora_datastream_dc.md
Working with Dublin Core Datastreams within Islandora

Working with Dublin Core Datastreams within Islandora

First, retrieve the DC Document using cURL:

$ curl http://digital.stage.lafayette.edu/islandora/object/elc:10/datastream/DC/view

<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
  <dc:title>Ledger 1</dc:title>
  <dc:identifier>elc:10</dc:identifier>
@rococodogs
rococodogs / new-jekyll-post.rake
Last active May 31, 2017 16:57
rake task for creating a bare jekyll post
require "date"
namespace :post do
desc "creates a new post file"
task :new do
now = Time.new
title = ARGV.last
slugified = title.downcase.gsub(/\s+/, '-')
filename = "#{now.to_date}-#{slugified}.markdown"

getting up and running w/ geoblacklight

1a. install: the easy way

$ rails new my-app -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/master/template.rb
// ...
$ cd my-app