Skip to content

Instantly share code, notes, and snippets.

Avatar
🧊

tamsin johnson no-reply

🧊
  • UC Santa Barbara Library
  • United States
View GitHub Profile
View gist:7b4eab233d2ae8dcd02e414a844cbc40
(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)
View gist:d07c751074510ba4643484f1d19ddabc
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 "."
View custom_actor.rb
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 Jul 12, 2017
RDF Resources in OregonDigital
View oregon_rdf_demo.rb
# 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 Mar 23, 2017
Records, Documents, & Graphs: Accounting for record scope & mutability in metadata management
View thoughts.md

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 Feb 10, 2017
#neverActiveSupport
View as.rb
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 Dec 29, 2016
CurationConcerns CI failure with FileSet error
View curation_concerns_engine_cart.txt
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 Dec 29, 2016
CurationConcers CI failure with SOLR error
View curation_concerns_solr.txt
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)>'
View pattern.rb
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 Jun 10, 2016
Baby's First Rust Server
View Cargo.toml
[package]
name = "hello_server"
version = "0.1.0"
authors = ["Tom Johnson <n0reply@uw.edu>"]
[dependencies]
hyper = "~0.9.7"
log = "*"
env_logger = "*"