Skip to content

Instantly share code, notes, and snippets.

View mcritchlow's full-sized avatar

Matthew Critchlow mcritchlow

  • UC San Diego
  • San Diego
View GitHub Profile
@mcritchlow
mcritchlow / a_summary.md
Last active March 28, 2018 21:11
Analytics Query Testing
@mcritchlow
mcritchlow / cil_csv.rb
Last active May 14, 2018 16:08
CIL Data Processing R&D
# Ruby script to test out parsing the CIL json data and dump to csv
#
# For now, we're concatenating the property hierarchy with colons
# So CIL: { "Image Files" [ "Mime_type": "application/zip" will be CIL:Image Files:Mime_type "application/zip"
require 'open-uri'
require 'json'
require 'byebug'
require 'csv'
# Hackety hacks, don't talk back
@mcritchlow
mcritchlow / damspas-load.sh
Created May 25, 2018 18:47
DAMSPAS Load test
#!/bin/bash
files_to_download=(
"https://librarytest.ucsd.edu/dc/object/bb8022051s/_2.mp4/download"
"https://librarytest.ucsd.edu/dc/object/bb8977691g/_2.mp4/download"
"https://librarytest.ucsd.edu/dc/object/bb55983863/_1.pdf/download"
"https://librarytest.ucsd.edu/dc/object/bb38236288/_1.pdf/download"
"https://librarytest.ucsd.edu/dc/object/bb2015477n/_1.pdf/download"
)
# run tests
# setting jobs to 0 will run as many jobs as possible concurrently
@mcritchlow
mcritchlow / work.rb
Created August 29, 2018 23:28
Work rdms schema
# This is a crazy idea. but, do we really need a graph-based approach?
# Is this stuff really going to change that often?
# Could we use something like Single Table Inheritance to make this more sane since so much data is shared?
class Work < ApplicationRecord
has_many :subjects
has_namy :agents
delegate :topics, :names, :anatomies, to: :subjects
delegate :creators, :contributors, :publishers, to: :agents