Skip to content

Instantly share code, notes, and snippets.

View dkinzer's full-sized avatar

David Kinzer (he/him) dkinzer

View GitHub Profile
@dkinzer
dkinzer / 0001-Update-references-to-master-branch.patch
Last active November 9, 2021 20:11
Patch for BL Wiki. Updates "master" references to "main"
From 755639b062052ed6b752ab08e220c9ed9857d69a Mon Sep 17 00:00:00 2001
From: David Kinzer <dtkinzer@gmail.com>
Date: Tue, 9 Nov 2021 14:54:55 -0500
Subject: [PATCH] Update references to 'master' branch.
---
Adding-new-document-actions.md | 4 ++--
Atom-Responses.md | 2 +-
Blacklight-configuration.md | 14 +++++++-------
Blacklight-on-Heroku.md | 4 ++--
hello world
FROM harbor.k8s.temple.edu/library/alpine:3.13
CMD [ "echo", "hello world" ]
# build this with:
# docker build --tag=harbor.k8s.temple.edu/tulibraries/hello_world_dkinzer:latest .
# push this with:
# docker push harbor.k8s.temple.edu/tulibraries/hello_world_dkinzer:latest
@dkinzer
dkinzer / pry20201022-13879-1prluqv.rb
Last active October 23, 2020 01:38
compose in Ruby defined as a reduction of its arguments.
def compose(*args)
identity = ->(x) { x }
args.reduce(identity) do |a, b|
if b.is_a? Proc
a >> b
else
a >> method(b)
end
end
@dkinzer
dkinzer / template.py
Last active April 27, 2020 20:06
Versioned Templated Dag Example
from datetime import datetime, timedelta
import os
from airflow.operators.bash_operator import BashOperator
DEFAULT_ARGS = { "retries": 0, catchup: False, max_active_runs: 1, schedule_interval: None }
def create_dag(env, version):
dag_id = "hello_" + env
# frozen_string_literal: true
RSpec.describe Traject::Indexer::NokogiriIndexer do
let(:settings) { {
"nokogiri.each_record_xpath" => "/oai:OAI-PMH/oai:ListRecords/oai:record",
"nokogiri.namespaces" => { "oai" => "http://www.openarchives.org/OAI/2.0/" },
"solr_writer.commit_on_close" => "false",
} }
let(:records) { Traject::NokogiriReader.new(StringIO.new(
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# A script for retrieving a local repository of public and authentication notes
# for electronic collections and services.
#
items_ids = File.readlines("#{ENV["HOME"]}/Downloads/asrs_items.csv")
require "thread"
class Delay
def initialize(&thunk)
@semaphore = Mutex.new
@thunk = thunk
@evaluated = false
end
def value
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?><OAI-PMH xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<responseDate>2018-07-12T08:54:11Z</responseDate>
<request verb="ListRecords" metadataPrefix="marc21" set="blacklight" until="2018-07-12T08:54:02Z" from="2018-07-12T00:54:00Z">https://na02.alma.exlibrisgroup.com/view/oai/01TULI_INST/request</request>
<ListRecords><record><header><identifier>oai:alma.01TULI_INST:991000022389703811</identifier><datestamp>2018-07-12T08:19:13Z</datestamp><setSpec>blacklight</setSpec><setSpec>blacklight_qa</setSpec><setSpec>rapid_print_books</setSpec></header><metadata>
<record xmlns="http://www.loc.gov/MARC21/slim" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" ><leader>01391nam a2200457 a 4500</leader><controlf