Skip to content

Instantly share code, notes, and snippets.

View awead's full-sized avatar
🏠
Working from home

Adam Wead awead

🏠
Working from home
View GitHub Profile
# ----------------------------------------------------------------------------
# Name: sendFiles
# Desc: Since this process for sending files from the access and preservation
# folders is pretty much the same, I created a subroutine to do it.
# Inputs: local source directory, remote directory, filename
# Outputs: Errors, if any
# ----------------------------------------------------------------------------
sub sendFiles {
my ($srcDir, $remoteSrcDir, $file) = @_;
t. root
t.titleInfo {
t.title
}
t.term1(:proxy=>[:root, :titleInfo, :title])
t. relatedItem {
t.titleInfo {
t.title
source 'http://rubygems.org'
gem 'rails', '~>3.2.2'
gem 'blacklight', '~> 3.3.1'
gem 'hydra-head', :path => '/Users/adamw/Projects/Github/Hydra-Rock/gems/hydra-head'
# We will assume that you're using sqlite3 for testing/demo,
# but in a production setup you probably want to use a real sql database like mysql or postgres
gem 'sqlite3'
@awead
awead / gist:2580488
Created May 2, 2012 20:59
New HH gemfile
source 'http://rubygems.org'
gem 'rails', '~>3.2.3'
gem 'blacklight', '~> 3.3.2'
gem 'hydra-head', '~> 4.0.0'
#gem 'hydra-head', :path => "/Users/adamw/Projects/Github/Hydra-Rock/gems/hydra-head"
# We will assume that you're using sqlite3 for testing/demo,
# but in a production setup you probably want to use a real sql database like mysql or postgres
SELECT *
WHERE {
?s <http://www.w3.org/2004/02/skos/core#prefLabel> ?o .
}
LIMIT 10
Copy the %Windir%\System32\GroupPolicy (This is a hidden folder, so unhide it first) contents to C:\GroupPolicy (You'll need to create this folder).
Then extract the Security Settings to an inf by running the following command... secedit /export /cfg C:\Security.inf. You now have the needed files to transfer to the new machine.
Bring those files to the new machine and do the following... Overwrite the contents of %Windir%\System32\GroupPolicy (Make a backup of this folder first) with the contents from the other machine.
If these machines are XP import the Security.inf from the other machine by doing the following... Copy the Security.inf to the %Windir%\repair.
Run the following command. secedit /configure /cfg %Windir%\repair\security.inf /db secsetup.sdb /verbose. Restart the machine. That's it for XP.
If these machines are Windows 7disable UAC first, then copy the Security.inf to %Windir%\inf and run the following command: secedit /configure /cfg %Windir%\inf\Security.inf /db defltbase
NoMethodError in Catalog#index
Showing /var/www/rails/blacklight-dev/gems/blacklight/app/views/_user_util_links.html.erb where line #9 raised:
undefined method `downcase!' for 2:Fixnum
Extracted source (around line #9):
6: <% end %>
7: |
8: <% end %>
module HydraPbcore::Datastream::Deprecated
class Instantiation < ActiveFedora::OmDatastream
class_attribute :institution, :relator
include HydraPbcore::Methods
include HydraPbcore::Templates
include HydraPbcore::Conversions
# Note: this is not a complete PBCore document, just an instantiation node
@awead
awead / gist:5296086
Last active December 15, 2015 17:20
NB: A collection has many series, a series is part of one collection.
This doesn't work. After reloding the collection, it still has the same number of series:
> c = ArchivalCollection.find("arc:test")
=> #<ArchivalCollection pid:"arc:test", title:"Test Collection", format:"Collection">
> c.series.count
=> 3
> c.series.pop
=> #<ArchivalComponent pid:"arc:testref3", title:"Series 1: Sample Series">
@awead
awead / gist:5436784
Created April 22, 2013 17:09
running rake ci in hydra-head
[Hydra CI] hydra-core
Running specs
rake aborted!
cannot load such file -- bundler/setup
/Users/adamw/Projects/Github/hydra-head/hydra-core/spec/internal/config/boot.rb:6:in `<top (required)>'
/Users/adamw/Projects/Github/hydra-head/hydra-core/spec/internal/config/application.rb:1:in `<top (required)>'
/Users/adamw/Projects/Github/hydra-head/hydra-core/spec/internal/Rakefile:5:in `<top (required)>'
/Users/adamw/Projects/Github/hydra-head/.bundle/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load'
/Users/adamw/Projects/Github/hydra-head/.bundle/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/adamw/Projects/Github/hydra-head/.bundle/gems/rake-10.0.4/lib/rake/application.rb:589:in `raw_load_rakefile'