Skip to content

Instantly share code, notes, and snippets.

View no-reply's full-sized avatar

tamsin woo no-reply

  • UC Santa Barbara Library
  • United States
View GitHub Profile
(require 'ruby-mode)
(add-to-list 'auto-mode-alist
'("\\.\\(?:cap\\|gemspec\\|irbrc\\|gemrc\\|rake\\|rb\\|ru\\|thor\\)\\'" . ruby-mode))
;; Ruby mode
(add-hook 'ruby-mode-hook 'robe-mode)
(add-hook 'ruby-mode-hook 'company-mode)
(add-hook 'ruby-mode-hook 'electric-pair-mode)
tjohnson@hopper:~/src/hyrax$ bundle exec rake engine_cart:regenerate
Removing sample rails app
create
/home/tjohnson/.rbenv/versions/2.5.3/lib/ruby/2.5.0/fileutils.rb:122: warning: conflicting chdir during another chdir block
create README.md
create Rakefile
create config.ru
create .gitignore
create Gemfile
run git init from "."
class MyActor < Hyrax::Actors::AbstractActor
def create(env)
titlilze(env, attribute: :title) && next_actor.create(env)
end
private
def titlize(env, attribute:)
env.attributes[:attribute] = env.attributes[:attribute].map(&:titlize)
end
@no-reply
no-reply / oregon_rdf_demo.rb
Last active July 12, 2017 00:14
RDF Resources in OregonDigital
# RdfResource is a subclass of RDF::Graph with property configuration, accessors, and some other methods
# for managing "resources" as discrete subgraphs which can be managed by a Hydra datastream model.
#
# The relevant modules and class are:
#
# https://github.com/OregonDigital/oregondigital/tree/master/lib/oregon_digital/rdf/rdf_configurable.rb
# https://github.com/OregonDigital/oregondigital/tree/master/lib/oregon_digital/rdf/rdf_properties.rb
# https://github.com/OregonDigital/oregondigital/tree/master/lib/oregon_digital/rdf/rdf_resource.rb
bnode = OregonDigital::RDF::RdfResource.new
@no-reply
no-reply / thoughts.md
Last active March 23, 2017 20:09
Records, Documents, & Graphs: Accounting for record scope & mutability in metadata management

Records, Documents, & Graphs

Accounting for record scope & mutability in metadata management.

Smoothies cannot be edited @anarchivist -- 6:52 PM PDT - 23 Apr 2015

Questions

The key question I'm setting out to answer is: How can we account for routine change and updates in our metadata records. An initial attempt to derive a model for change from current practice has led to some corollary questions about the relationship between Records, Documents, Description Sets, Application Profiles, Resources, and RDF Sourceslit review:

@no-reply
no-reply / as.rb
Created February 10, 2017 19:42
#neverActiveSupport
class Circle
def intialize
@circle = self
end
end
require 'active_support/core_ext/object/json'
Circle.new.as_json
# SystemStackError: stack level too deep
@no-reply
no-reply / curation_concerns_engine_cart.txt
Created December 29, 2016 21:00
CurationConcerns CI failure with FileSet error
Running RuboCop...
Inspecting 531 files
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
531 files inspected, no offenses detected
create
create README.md
create Rakefile
create config.ru
create .gitignore
@no-reply
no-reply / curation_concerns_solr.txt
Created December 29, 2016 20:56
CurationConcers CI failure with SOLR error
Done generating test app
rake aborted!
Failed to execute solr create:
ERROR:
Core 'hydra-test' already exists!
Checked core existence using Core API command:
http://localhost:53179/solr/admin/cores?action=STATUS&core=hydra-test
. Further information may be available in /tmp/solr-6.3.0/logs
/home/tjohnson/src/hydra/curation_concerns/Rakefile:24:in `block (2 levels) in <top (required)>'
require 'rdf'
require 'rdf/spec'
statements = RDF::Spec.quads
statements.extend(RDF::Enumerable, RDF::Queryable)
statements.count # => 95
pattern = RDF::Query::Pattern.new(nil, nil, nil, graph_name: false)
@no-reply
no-reply / Cargo.toml
Last active June 10, 2016 05:22
Baby's First Rust Server
[package]
name = "hello_server"
version = "0.1.0"
authors = ["Tom Johnson <n0reply@uw.edu>"]
[dependencies]
hyper = "~0.9.7"
log = "*"
env_logger = "*"