Skip to content

Instantly share code, notes, and snippets.

View lorawoodford's full-sized avatar

Lora Woodford lorawoodford

View GitHub Profile
@lorawoodford
lorawoodford / accessions_spec.rb
Created August 12, 2020 21:08
Test modifications for ANW-849
# frozen_string_literal: true
require_relative '../spec_helper'
describe 'Accessions' do
before(:all) do
@repo = create(:repo, repo_code: "accession_test_#{Time.now.to_i}")
set_repo @repo
@coll_mgmt_accession = create(:accession)
@lorawoodford
lorawoodford / container_location.rb
Created July 2, 2020 19:14
Changes to transfer location link
class ContainerLocation < Sequel::Model(:container_location)
include ASModel
corresponds_to JSONModel(:container_location)
define_relationship(:name => :top_container_housed_at,
:contains_references_to_types => proc {[TopContainer, Location]}
)
end
@lorawoodford
lorawoodford / search_helper.rb
Last active June 18, 2020 16:05
Changes to build_search_params to enable second sort
module SearchHelper
IDENTIFIER_FOR_SEARCH_RESULT_LOOKUP = {
"accession" => "identifier",
"agent_corporate_entity" => "authority_id",
"agent_family" => "authority_id",
"agent_person" => "authority_id",
"agent_software" => "authority_id",
"archival_object" => "component_id",
"assessment" => "assessment_id",
@lorawoodford
lorawoodford / notes_spec.rb
Created June 16, 2020 20:49
Example test for note ordering bug
# frozen_string_literal: true
require_relative '../spec_helper'
describe 'Notes' do
before(:all) do
@repo = create(:repo, repo_code: "notes_test_#{Time.now.to_i}")
set_repo @repo
@resource = create(:resource)
@lorawoodford
lorawoodford / rakefile.rb
Created May 15, 2020 20:41
Docs will build
namespace :doc do
desc "Generate the documentation"
task :yard do
puts "Generating YARD documentation"
system(File.join("..", "build", "run"), "doc:yardoc")
end
desc "Create the API.md file"
@lorawoodford
lorawoodford / linker.js
Created May 12, 2020 18:34
ANW-700 draft
//= require jquery.tokeninput
$(function() {
$.fn.linker = function() {
$(this).each(function() {
var $this = $(this);
var $linkerWrapper = $this.parents(".linker-wrapper:first");
if ($this.hasClass("initialised")) {
return;
<ul style="padding-left: 20px;">
<% (record['job_data'] || []).each_with_index do |data, i| %>
<li>
<% if (record['files'] || [])[i] %>
<% type, filename = data.split(' --- ', 2) %>
<%= type %>: <a href="<%= AppConfig[:frontend_proxy_url] + record['files'][i] %>"><%= filename %></a>
<% else %>
<% data = data.split(': ', 2) %>
<%= "#{I18n.t(data[0])}: #{data[1]}" %>
<% end %>
import requests, json, secrets, time, urllib, re
startTime = time.time()
# import secrets
ASbaseURL = secrets.ASbaseURL
ASuser = secrets.ASuser
ASpassword = secrets.ASpassword
DSbaseURL = secrets.DSbaseURL

Keybase proof

I hereby claim:

  • I am lorawoodford on github.
  • I am lorawoodford (https://keybase.io/lorawoodford) on keybase.
  • I have a public key whose fingerprint is 94C0 DF0A DC3E A58F 0371 A6E2 4D9A D7B8 4AC9 A3A4

To claim this, I am signing this object: