Skip to content

Instantly share code, notes, and snippets.

View marktriggs's full-sized avatar
💭
PROGRAMMING

Mark Triggs marktriggs

💭
PROGRAMMING
View GitHub Profile
@marktriggs
marktriggs / gist:d481e60ce50799fc532a6eaa8606aa05
Created April 18, 2017 00:55
Search by digital object ID
$ scripts/curl_as admin admin --globoff 'http://localhost:4567/repositories/2/search' \
-F 'filter={"query": {"jsonmodel_type": "field_query", "field": "digital_object_id", "value": "the digital object id"}}' \
-F 'page=1' | python -mjson.tool
{
"facets": {
"facet_dates": {},
"facet_fields": {},
"facet_intervals": {},
"facet_queries": {},
module AutoGenerator
def self.included(base)
base.extend(ClassMethods)
end
def update_from_json(json, opts = {}, apply_nested_records = true)
self.class.properties_to_auto_generate.each do |generate_opts|
next if generate_opts[:only_if] and not generate_opts[:only_if].call(json)
diff --git a/backend/app/converters/lib/xml_sax.rb b/backend/app/converters/lib/xml_sax.rb
index 648eeb1..a079dee 100644
--- a/backend/app/converters/lib/xml_sax.rb
+++ b/backend/app/converters/lib/xml_sax.rb
@@ -189,6 +189,15 @@ module ASpaceImport
obj = ASpaceImport::JSONModel(type).new
obj["import_context"]= pprint_current_node
+ if JSONModel::JSONModel(type).schema['properties'].include?('publish')
+ unless properties.include?('publish')
#!/bin/bash
git for-each-ref --format='%(refname) [%(authorname)] %(subject)' --sort=-committerdate | \
egrep 'refs/(heads|remotes)/' | cut -d'/' -f3- | while read ref msg; do
printf "%-60s %s\n" "$ref" "$msg"
done | less -FS
#!/usr/bin/env jruby
#
# Unpack solr.war into lib then run with:
#
# CLASSPATH="lib/solr-4.10.4/WEB-INF/lib/*" jruby-home dump-stored-fields.rb /path/to/solr_index/index > stored-fields.txt
#
class DumpStoredFields
def call(index_dir)
ir = org.apache.lucene.index.DirectoryReader.open(org.apache.lucene.store.FSDirectory.open(java.io.File.new(index_dir)))
require 'stringio'
class JSONSplitter
def initialize(stream)
@stream = stream
@peeked_char = nil
@positioned = false
end
commit a8a3464cd1e64603b5100f667b90ad1e252b8356
Author: [email protected] <[email protected]@66ffb92e-73f9-0310-93c1-f5514f145a0a>
Date: Fri Sep 4 03:37:48 2015 +0000
CLASSES-1879 First round of HIGHLY EXPERIMENTAL orphan-dealing-with changes
git-svn-id: https://source.sakaiproject.org/svn/msub/nyu.edu/10.4/trunk@321065 66ffb92e-73f9-0310-93c1-f5514f145a0a
diff --git a/lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/service/LessonBuilderEntityProducer.java b/lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/service/LessonBuilderEntityProducer.java
index e039b6d..fe770da 100644
<!-- HAAAAAAAAAAAAAAACK WHEEEEEE -->
<!doctype html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<style>
td, th {
padding: 2px;
archivesspace@drake:~$ env
XDG_SESSION_ID=7
SHELL=/bin/bash
TERM=vt100
USER=archivesspace
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm
require 'net/http'
require 'date'
require 'json'
# Nothing very interesting here. Just boiler plate HTTP-wrangling code to log
# in to ArchivesSpace and fire requests.
class ArchivesSpaceRequest
def initialize(aspace_backend_url, username, password)
@aspace_backend_url = URI.parse(aspace_backend_url)