Skip to content

Instantly share code, notes, and snippets.


David Kinzer dkinzer

View GitHub Profile
View Dockerfile
CMD [ "echo", "hello world" ]
# build this with:
# docker build .
# push this with:
# docker push
dkinzer / pry20201022-13879-1prluqv.rb
Last active Oct 23, 2020
compose in Ruby defined as a reduction of its arguments.
View pry20201022-13879-1prluqv.rb
def compose(*args)
identity = ->(x) { x }
args.reduce(identity) do |a, b|
if b.is_a? Proc
a >> b
a >> method(b)
dkinzer /
Last active Apr 27, 2020
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
View exract_xpath_bug_spec.rb
# 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" => "" },
"solr_writer.commit_on_close" => "false",
} }
let(:records) {
View Enabling Solr Document
View load_test_asrs.rb
#!/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")
View lazy.rb
require "thread"
class Delay
def initialize(&thunk)
@semaphore =
@thunk = thunk
@evaluated = false
def value
View alma-20180712-85988-19f3fzm.xml
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?><OAI-PMH xsi:schemaLocation="" xmlns="" xmlns:xsi="">
<request verb="ListRecords" metadataPrefix="marc21" set="blacklight" until="2018-07-12T08:54:02Z" from="2018-07-12T00:54:00Z"></request>
View indexer_config.rb
# frozen_string_literal: true
$:.unshift "./config"
$:.unshift "./lib"
require "yaml"
solr_config = YAML.load_file("config/blacklight.yml")[(ENV["RAILS_ENV"] || "development")]
solr_url =["url"]).result
# A sample traject configuration, save as say `traject_config.rb`, then
# run `traject -c traject_config.rb marc_file.marc` to index to