Skip to content

Instantly share code, notes, and snippets.

View anarchivist's full-sized avatar
🫏

maría a. matienzo anarchivist

🫏
View GitHub Profile
@anarchivist
anarchivist / rails_new_with_template.out
Created September 3, 2017 00:07
ArcLight/Bundler 1.15.4 issues
curtido:tmp matienzo$ rails new my-app -m https://raw.githubusercontent.com/sul-dlss/arclight/master/template.rb
create
create README.md
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/config/manifest.js
create app/assets/javascripts/application.js
@anarchivist
anarchivist / demo.rb
Created August 16, 2017 22:01
rosette_api demo
[7] pry(main)> require 'rosette_api'
=> true
[8] api = RosetteAPI.new('XXXXXX')
=> #<RosetteAPI:0x007fa1f9ae9910
@alternate_url="https://api.rosette.com/rest/v1",
@http_client=#<Net::HTTP api.rosette.com:443 open=false>,
@url_parameters=nil,
@user_key="XXXXXX">
[9] pry(main)> params = NameTranslationParameters.new('فاتن حمامة', 'eng', target_script: 'Latn')
=> #<NameTranslationParameters:0x007fa1f8a0e960
@anarchivist
anarchivist / gist:7fe62e59081b46f2339fa06b5b737904
Created April 12, 2017 16:44
Index a sample EAD for ArcLight
curtido:arclight matienzo$ cd .internal_test_app
curtido:.internal_test_app matienzo$ SOLR_URL=http://localhost:8983/solr/blacklight-core bundle exec rails c
Loading development environment (Rails 5.0.2)
irb(main):001:0> require 'solr_ead'
=> true
irb(main):002:0> indexer = SolrEad::Indexer.new
=> #<SolrEad::Indexer:0x007f7ff6ef42f0 @solr=#<RSolr::Client:0x007f7ff6ef4160 @uri=#<URI::HTTP http://localhost:8983/solr/blacklight-core/>, @proxy=nil, @connection=#<RSolr::Connection:0x007f7ff6ef4188>, @update_path="update", @options={:url=>"http://localhost:8983/solr/blacklight-core"}>, @options={}>
irb(main):003:0> indexer.create(File.new('/Users/matienzo/Google Drive/Stanford/ArcLight/Sample Data/Stanford/SPEC/a0122.xml'))
/Users/matienzo/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/solrizer-3.1.1/lib/solrizer/field_mapper.rb:169: warning: constant ::Fixnum is deprecated
/Users/matienzo/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/solrizer-3.1.1/lib/solrizer/field_mapper.rb:169: warning: constant ::Fixnum is d
@anarchivist
anarchivist / keybase.md
Created December 22, 2016 17:49
Keybase verification

Keybase proof

I hereby claim:

  • I am anarchivist on github.
  • I am anarchivist (https://keybase.io/anarchivist) on keybase.
  • I have a public key ASDArDXDHyr-KOpRwot503KzEX8wrjcBJ1GVZhwMcS8Bnwo

To claim this, I am signing this object:

@anarchivist
anarchivist / pcdm-profile-template.md
Last active October 24, 2017 15:46
Profile template for PCDM-based models

title: PCDM Profile Template author:

  • Mark A. Matienzo
  • Christina Harlow date: 2016-10-20 profile: project: PCDM Profiles namespaces: pcdm: http://pcdm.org/models#
@anarchivist
anarchivist / rs.json
Last active July 27, 2016 22:30
`rdf serialize` turtle -> jsonld for rs.org data
halfsour:ansible mark$ rdf serialize --uri http://rightsstatements.org/vocab/ --format turtle --output-format jsonl http://rightsstatements.org/data/1.0.ttl
Parsed 200 statements with RDF::Turtle::Reader in 0.348437 seconds @ 0.0 statements/second.
{
"@context": {
"cc": "http://creativecommons.org/ns#",
"dc": "http://purl.org/dc/terms/",
"dc11": "http://purl.org/dc/elements/1.1/",
"owl": "http://www.w3.org/2002/07/owl#",
"skos": "http://www.w3.org/2004/02/skos/core#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
# -*- encoding: utf-8 -*-
# frozen_string_literal: true
# This file generated automatically using rdf vocabulary format from http://rightsstatements.org/vocab/
require 'rdf'
module RDF::Vocab
# @!parse
# # Vocabulary for <http://rightsstatements.org/vocab/>
# class RightsStatements < RDF::StrictVocabulary
# end
class RightsStatements < RDF::StrictVocabulary("http://rightsstatements.org/vocab/")
@anarchivist
anarchivist / delete_by_provider_and_ingestion_sequence.sh
Last active July 27, 2016 19:36
Delete from CouchDB/Elasticsearch based on Elasticsearch/Elasticdump results
# Modified based on https://gist.github.com/anarchivist/ba97611d13331ce78307
# Generate a JSON dump file of the records we want to remove from both CouchDB and Elasticsearch
elasticdump --input=http://$ELASTICSEARCH_HOST:9200/dpla_alias --output=missouri_ingestionSequence_4 --searchBody='
{"query":
{"filtered":
{"query":
{"bool":
{"must":[
{"query_string":
@anarchivist
anarchivist / private.xml
Created June 7, 2016 20:38
Karabiner configuration for RDing/PCSensor USB pedal
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>RDing</vendorname>
<vendorid>0x0c45</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>FootSwitch1F1</productname>
<productid>0x7403</productid>
</deviceproductdef>
@anarchivist
anarchivist / oai-pmh-harvester.xml
Created April 28, 2016 21:39
Apache NiFi OAI-PMH harvester (work in progress)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template>
<description/>
<name>OAI-PMH</name>
<snippet>
<connections>
<id>a17830ba-5cff-466a-85cb-f6ef8d2570e2</id>
<parentGroupId>39307b88-cf92-400b-8d28-ca855e4bbf3f</parentGroupId>
<backPressureDataSizeThreshold>0 MB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>0</backPressureObjectThreshold>