Skip to content

Instantly share code, notes, and snippets.

View jonathangreen's full-sized avatar

Jonathan Green jonathangreen

  • Prince Edward Island, Canada
  • 01:32 (UTC -03:00)
View GitHub Profile
@jonathangreen
jonathangreen / delegates.rb
Created July 24, 2019 15:02
Cantaloupe Islandora Lookup
require 'yaml'
require 'java'
require 'monitor'
class CustomDelegate < Monitor
attr_accessor :context
def shared_context
synchronize do
@jonathangreen
jonathangreen / tuque.php
Last active May 1, 2018 19:33
Tuque datastream versions
<?php
// Some docs here:
// https://github.com/Islandora/islandora/wiki/Working-With-Fedora-Objects-Programmatically-Via-Tuque
// https://github.com/Islandora/islandora/wiki/Build,-Access,-Modify-and-Delete-Fedora-objects-with-the-Tuque-interface
$object = islandora_object_load('my:pid');
$dsid = $object['DSID'];
$number_of_versions = count($dsid);
foreach ($dsid as $version) {
print $version->createdDate->format('Y-m-d H:i:s');
@jonathangreen
jonathangreen / ansible-role-test.sh
Created February 5, 2018 19:31 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
# - test_idempotence: whether to test playbook's idempotence (default = true)
@jonathangreen
jonathangreen / keybase.md
Created December 23, 2016 21:24
Keybase

Keybase proof

I hereby claim:

To claim this, I am signing this object: