Skip to content

Instantly share code, notes, and snippets.

View anarchivist's full-sized avatar
🫏

maría a. matienzo anarchivist

🫏
View GitHub Profile
<?xml version="1.0" encoding="UTF-8" ?>
<oai:OAI-PMH xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
<oai:responseDate>2016-04-26T15:49:45Z</oai:responseDate>
<oai:request metadataPrefix="oai_qdc_imdpla" set="PALNI_copcampus" verb="ListRecords">http://dpla.library.in.gov/OAIHandler</oai:request>
<oai:ListRecords>
<oai:record>
<oai:header>
<oai:identifier>oai:dpla.library.in.gov:PALNI_copcampus:oai:digital.library.in.gov:PALNI_copcampus-208</oai:identifier>
<oai:datestamp>2016-02-12</oai:datestamp>
<oai:setSpec>PALNI_copcampus</oai:setSpec>
halfsour:dpla mark$ rails new search_app -m https://raw.github.com/projectblacklight/blacklight/master/template.demo.rb
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
{
"ingestType": "item",
"ingestionSequence": 999999,
"ingestDate": "2016-04-12",
"@context": "http://dp.la/api/items/context",
"aggregatedCHO": "#sourceResource",
"@id": "http://dp.la/api/items/59193c62595d8aca6fa9a4d7016b5b51",
"id": "59193c62595d8aca6fa9a4d7016b5b51",
"dataProvider": "University of Scranton",
"originalRecord": "http://ldp.staging.dp.la/ldp/original_record/59193c62595d8aca6fa9a4d7016b5b51.xml",
```
marmotta=# explain analyze verbose SELECT U1.U1 AS V1
marmotta-# FROM ((SELECT P1.subject AS U1
marmotta(# FROM triples P1
marmotta(# WHERE P1.deleted = false
marmotta(# AND P1.predicate = 568948697535369218
marmotta(# AND P1.object = 717423266866630665
marmotta(# AND NOT (EXISTS (SELECT P1.subject AS V1, _P1.object AS V1
marmotta(# FROM triples _P1
marmotta(# WHERE _P1.deleted = false
@anarchivist
anarchivist / gist:78be4e70f154ef1fbe8d5f0c3018aa5f
Created April 7, 2016 21:11
PostgreSQL 9.4 prepared statement behavior
marmotta=# -- prepare statement
marmotta=# prepare boom as SELECT id FROM triples WHERE subject = $1 AND predicate = $2 AND object = $3 AND context =
$4 AND deleted = false;
PREPARE
marmotta=# -- run 1
marmotta=# explain execute boom('718127302357929984', '564051914678095872', '564051914636152835', '564051914489352192');
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------
@anarchivist
anarchivist / parse_graph_with_basic_auth.py
Created March 20, 2016 22:03
Using HTTP Basic authentication to fetch resources in a Fedora 4 demo install for parsing with RDFLib
import urllib2
from rdflib import Graph, URIRef, Literal
# Register an authentication handler
auth_handler = urllib2.HTTPBasicAuthHandler()
auth_handler.add_password(realm='fcrepo', uri="http://localhost:8080/fcrepo/rest", user="fedoraAdmin", passwd="secret3")
opener = urllib2.build_opener(auth_handler)
urllib2.install_opener(opener)
# Create a new rdflib Graph object and parse the remote resource
diff --git a/app/models/item.rb b/app/models/item.rb
index e405e27..3cc5222 100644
--- a/app/models/item.rb
+++ b/app/models/item.rb
@@ -126,7 +126,14 @@ class Item
end
def preview_image
- @object
+ uri = URI.parse(@object)
@anarchivist
anarchivist / tsk-4.2.0-exclude-jni-sample-verification.patch
Last active January 19, 2016 13:02
Sleuthkit 4.2.0: exclude building JNI samples (see sleuthkit/sleuthkit#510)
diff --git a/bindings/java/build.xml b/bindings/java/build.xml
index 7979fa2..71efb17 100755
--- a/bindings/java/build.xml
+++ b/bindings/java/build.xml
@@ -121,9 +121,9 @@
</copy>
<!-- Verify sample compiles -->
- <javac debug="on" srcdir="${sample}" destdir="${build}" includeantruntime="false">
+ <!-- <javac debug="on" srcdir="${sample}" destdir="${build}" includeantruntime="false">
F, [2015-08-14T09:47:48.552365 #13365] FATAL -- :
ActionView::Template::Error (nil can't be coerced into Fixnum):
1: <%= @field_value_report.headers.to_csv %><% @field_value_report.enumerate_rows.each do |row| %><%= row.to_csv %><% end %>
krikri (0.8.0) app/models/krikri/field_value_report.rb:76:in `+'
krikri (0.8.0) app/models/krikri/field_value_report.rb:76:in `block (2 levels) in enumerate_rows'
krikri (0.8.0) app/models/krikri/field_value_report.rb:67:in `loop'
krikri (0.8.0) app/models/krikri/field_value_report.rb:67:in `block in enumerate_rows'
@anarchivist
anarchivist / gist:3a3078a224ca7ea1dcfc
Last active August 29, 2015 14:27
2015-08-13 indexing issue
I, [2015-08-13T12:38:21.825121 #28648] INFO -- : [2015-08-13 12:38:21 -0400] [28648] [Krikri::Indexer] indexer is running
E, [2015-08-13T13:11:26.155130 #28648] ERROR -- : Indexing error: undefined method `each' for nil:NilClass
/home/dpla/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/krikri-0.8.0/lib/krikri/search_index.rb:227:in `flat_hash'
/home/dpla/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/krikri-0.8.0/lib/krikri/search_index.rb:201:in `solr_doc'
/home/dpla/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/krikri-0.8.0/lib/krikri/search_index.rb:170:in `block in bulk_add'
/home/dpla/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/krikri-0.8.0/lib/krikri/search_index.rb:170:in `map'
/home/dpla/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/krikri-0.8.0/lib/krikri/search_index.rb:170:in `bulk_add'
/home/dpla/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/krikri-0.8.0/lib/krikri/search_index.rb:55:in `block in bulk_update_from_activity'
/home/dpla/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/krikri-0.8