Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cbeer's full-sized avatar

Chris Beer cbeer

View GitHub Profile
@cbeer
cbeer / gist:11264457
Created April 24, 2014 18:24
fcrepo4 transactions
after do
resp = FedoraLens.connection.http.post "./fcr:tx"
loc = resp.headers['Location']
cl = Faraday.new url: loc
cl.delete "./#{@library.pid}"
cl.delete "./#{@book.pid}"
cl.delete "./#{@author.pid}"
cl.delete "./#{@publisher.pid}"
cl.delete "./#{@library2.pid}" if @library2
module BlacklightConfigurationHelper
include Blacklight::ConfigurationHelperBehavior
def default_sort_field
if params.has_key? :q
active_sort_fields.select { |k,config| config.default_for_user_query }.first || super
else
super
end
@cbeer
cbeer / license.sh
Created August 14, 2014 20:53
Apply license file to all repositories
#/bin/bash
# Dependencies:
# jq: https://github.com/stedolan/jq
# hub: https://github.com/defunkt/hub
cat > /tmp/LICENSE <<EOF
©yyyy The Board of Trustees of the Leland Stanford Junior University.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@cbeer
cbeer / _urls.md
Last active August 29, 2015 14:15
class Plugin_Search_Parse_ContentOnly
{
static public function register() {
$objHook = Vault_Hook::getInstance();
$s = __CLASS__;
$o = new $s;
$objHook->register($o);
}
public function search_parse_assemble(&$search) {
$search->parts['fq'][] = 'fedora.contentModel:[* TO *]';
<?xml version="1.0" encoding="UTF-8"?>
<foxml:digitalObject VERSION="1.1" PID="djatoka:3001"
xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="???"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2009-10-24T01:30:16.310Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2009-10-24T01:52:56.745Z"/>
[:wqueue_process, TypeError, #<TypeError: singleton can't be dumped>]
./lib/ruote/util/serializer.rb:57:in `dump'
./lib/ruote/util/serializer.rb:57
./lib/ruote/util/serializer.rb:94:in `call'
./lib/ruote/util/serializer.rb:94:in `encode'
./lib/ruote/storage/fs_storage.rb:78:in `[]='
./lib/ruote/storage/fs_storage.rb:77:in `open'
./lib/ruote/storage/fs_storage.rb:77:in `[]='
./lib/ruote/storage/base.rb:54:in `receive'
./lib/ruote/queue/workqueue.rb:100:in `send'
require 'dispatcher'
require 'oai'
require 'rsolr'
require 'rsolr-ext'
module OAI_DocumentPatch
def self.included(base)
base.extend(ClassMethods)
base.send(:include, InstanceMethods)
end
require 'dispatcher'
require 'odrl/lib/odrl'
module Rights_DocumentPatch
def self.included(base)
base.extend(ClassMethods)
base.send(:include, InstanceMethods)
end
module ClassMethods